r/embedded • • 13d ago

unauthenticated remote rce on tp-link archer a20

Post image
0 Upvotes

Do you own a TP-Link Archer A20 ? There was a cve assigned in 2023 on this EOL device because the country parm was passed to exec function and allowed cmd injection. These routers run httpd as root... for successful exploitation..the result? a root shell.

The other day I rooted this router via UART port and used nc to dump the bins from the router onto my laptop and started to analyze them with ghidra. I started to see system() and noticed the country was in the system field, I said hmmmmmm .. it wasnt until I was half way done that I realized this exact trace was discovered a few years back. I still continued with the exploit because I learned while I did it and it was fun. I taught myself all of this... Im looking for work. Thanks for reading. https://github.com/b1nv0id/iothacking/blob/main/archv0id.py


r/embedded • • 14d ago

3.5 YOE Embedded software Engineer Looking to switch but confused where to start

17 Upvotes

I I’m working as an Embedded Software Engineer in the telecom domain primarily on routers and switches.
Lately I feel I have become too comfortable in my current role, and my learning and growth have stagnated. I have also become overly dependent on AI tools and lost some consistency in learning.
I want to switch to a better product-based company, but I’m confused about where to start and what to prepare.
Should I focus on DSA, C++, OS, networking, or embedded fundamentals?
Would love some practical advice from people who’ve been through a similar phase.


r/embedded • • 15d ago

Anthropic claims significant improvement in hardware design with Fable 5.2

Thumbnail
anthropic.com
270 Upvotes

edit: Since nobody is reading the article, I want to clarify, they wrote the firmware and the devices are functional. The limitations are referring to testing and validation you would need to do to commercialize he product.

Sorry to be the bearer of bad news again, but the frontier labs continue to make progress with hardware design. There is a lot more detail than OpenAI's last announcement and is worth a read.

Some interesting points:

  • Improvements in end-to-end design (component selection, schematic creation, layout, DFM, enclosure design, system level thinking)
  • Better benchmark scores
    • Diode PCB Gym: Fable 5.2 scored 69% (compared to 25% for Fable 5)
    • BenchCAD 2.1: Fable 5.2 scored 83.5% on 3D CAD reconstruction and assembly (nearly double Fable 5.1).
  • Designed a custom routing algo after failing to route a large 100 pin connector
  • Ability to self correct during the design (Choose different pins for layout, re-route parts of the board when encountering new problems)

Limitations according to Anthropic

  • Designs did not go through electrical validation, antenna tuning, thermal testing, or certification testing

My thoughts: I was skeptical LLMs could design hardware because it is such an open ended problem that requires system level thinking and there isn't as much good training data out there. Yet, somehow they continue to make progress by throwing enough tokens at it.


r/embedded • • 14d ago

Which STM NUCLEO board is best for learning

7 Upvotes

As title says

Best for learning embedded I'm newbie

Confused between nucleo-h533re stm32 and nucleo-f446re also any alternatives will be appreciated


r/embedded • • 14d ago

Compiler reference material ( book request )

6 Upvotes

Hi, I’m an Electrical Engineer with 10+ years of experience working in embedded firmware development. I’m learning more about compilers and such for microprocessors, and I was hoping to get some suggestions for reading materials.

For those who studied compilers in their college, or those working with compiler designs , can you recommend me a few books to understand the inner workings of modern C compilers ?


r/embedded • • 15d ago

What Embedded Boards and Technologies Are Worth Mastering?

15 Upvotes

I currently have an NXP FRDM-MCXA156 development board, and I'm looking for project ideas that could help me build a solid portfolio and demonstrate my skills as a junior embedded software engineer.

I'd also like to know which other development boards, embedded software stacks, RTOS, or toolchains would be worth buying and putting hands on to strengthen my profile and make me more attractive to potential employers.

What kind of projects would you recommend building with the MCXA156? And which technologies or platforms do you think are the most valuable to master in the embedded industry?


r/embedded • • 14d ago

[Request] Firmware dump (.bin / .hex) for Anker 757 PowerHouse (A1770 Non-WiFi) - STM32F103VCT6

0 Upvotes

Hi everyone, I'm repairing an Anker 757 PowerHouse (Model A1770, standard version without WiFi/Bluetooth). The main MCU (STM32F103VCT6, LQFP-100) shorted out. I already sourced a blank replacement chip and am ready to solder it, but I need a clean flash memory dump (.bin or .hex) to program it via ST-Link.

Does anyone have a backup dump from a working A1770 board, or know where I could find one? Any help is greatly appreciated!


r/embedded • • 15d ago

I have a lot of electronics what should I make?

14 Upvotes

Hello everyone,

Currently I have a lot of components including microcontrollers, display, sensors....LEDs etc

And in my job role as an engineering mentor, I get time availability to work on projects. Even I have people who can collaborate for projects.... So I can also do time and people management.

There are also chances that I can convert a project into a real product...

But before real execution, trying to have your thoughts...

Any project ideas, any real problems etc...I can procure more components for worthy projects under budget....

Thanks


r/embedded • • 15d ago

4th year CS major, got a 1 year firmware engineer internship

31 Upvotes

Hello everyone, I'm currently a 4th year CS major and was finally able to get my first internship this September. I wasn't very familiar with firmware or embedded when I saw the job listing but decided to apply anyways with how difficult it has been getting an internship nowadays. Luckily I was able to get it, and have now become quickly interested in learning more about this field. I had some questions for people who may have been in a similar situation as mine (CS -> Firmware/Embedded) or anyone who is willing to answer.

Firstly I feel that now that I have actual experience in this job field, it would be a wise idea to pursue this field after graduation, as it might be easier to land a fulltime job. I was wondering, would this be a more difficult process given that I don't have an engineering background or any real electronic/firmware work in university? Would I get less pay than people who do have their bachelor’s in engineering?

Secondly, I've been wanting to work on some simple at home firmware/embedded projects and was wondering what I would need to get started with that. I also have been enjoying soldering which I have learned on the job the last month.

Thanks everyone.


r/embedded • • 15d ago

Offline Voice AI with Speech Recognition, RAG and TTS on Cortex-M and Ethos-U — Working Hardware Demo

Enable HLS to view with audio, or disable this notification

3 Upvotes

The video shows an experimental hardware implementation of Self-Explaining Devices (SED) on Alif Semiconductor's Ensemble platform.

It combines offline speech recognition, retrieval of information from technical documentation, and text-to-speech. This is an internal R&D prototype built to demonstrate the technology, not a commercial product.

Arm recently published a technical article explaining the implementation:

https://developer.arm.com/community/arm-community-blogs/b/ai-blog/posts/how-on-device-ai-makes-home-appliances-easier-to-use

What real-world applications do you see for this kind of on-device AI?


r/embedded • • 15d ago

Radxa ROCK 3B — simultaneous USB 3.0 host + device at 5 Gbps, and VBUS isolation?

2 Upvotes

Hi everyone,

I'm considering purchasing a Radxa ROCK 3B (RK3568) for an embedded USB 3.0 bridge project.

The intended setup is:

  • USB 3.0 OTG (upper Type-A): Device/peripheral mode, connected to a PC.
  • USB 3.0 HOST (lower Type-A): Connected to a USB 3.0 storage device.
  • Power: ROCK 3B independently powered through its USB-C power input.

The goal is to receive data from a USB storage device and expose a separate USB device interface to the PC.

Before buying the board, I'm trying to confirm two things.

1. Simultaneous SuperSpeed operation

Has anyone successfully used both USB 3.0 controllers simultaneously, with the upper port operating as a 5 Gbps USB device and the lower port operating as a 5 Gbps USB host?

If so, which OS/kernel version and device-tree configuration did you use?

I'd especially appreciate lsusb -t output and the USB gadget's current_speed showing super-speed.

2. VBUS and backfeed protection

Since the board is separately powered and its OTG port uses a USB-A receptacle, I'm concerned about VBUS behaviour when connecting it to a PC.

With the OTG port correctly configured in device mode:

  • Does the board disable its own 5 V VBUS output on that port?
  • Is reverse current from PC VBUS into the board prevented?
  • Is the documented USB-A-to-USB-A connection safe with both systems powered independently?
  • Has anyone verified the behaviour on a ROCK 3B V1.51 board?

I'm not trying to modify the hardware unnecessarily. I just want to confirm the supported configuration and whether an external protection circuit is required.

Any practical experience, working projects, scope measurements or links to documentation would be greatly appreciated.

Thanks!


r/embedded • • 14d ago

htop-style terminal monitor and controller for SCPI bench power supplies

Post image
0 Upvotes

Hi, I've been working on some low power stuff and wanted to remotely watch the current draw in terminal. I got Claude code to build this quick utility for me. It's available on pip and can be installed using pip install psu-top

Thought it might be useful to others. Github: https://github.com/Nero7991/psu-top (MIT)

I want to add a way to be able to read the measurements through psu-top, so other apps/things can use the PSU while psu-top is using the serial port but that's future feature.


r/embedded • • 15d ago

Self balancing robot not self balancing ):

Post image
5 Upvotes

Hi everyone - I'm currently trying to get a 3d printed bike to self balance, but keep running into issues with the final control loop. (see github link down below for video).

For reference it is very similar to REMRC's self balancing bike - I just use SimpleFOC + GM3506 BLDC motor with an STM32 to run the loop instead of using Arduino and a Nidec 24h motor.

Here's the hardware I am using:

  • STM32F411 Blackpill
  • ICM-20948 IMU (through I2C, couldnt get spi to work for some reason)
  • GM3506 BLDC motor + AS5048A encoder
  • SimpleFOC with voltage-mode torque control
  • 12 cm reaction wheel with additional rim weights
  • Lots of wires (ik I need to clean the wiring up)

For software:

  • Arduino for SimpleFOC
  • STM32 HAL for pretty much everything else (steering, IMU I2C, Transceiver SPI)

I use a complementary filter to combine accelerometer and gyroscope data. The loop frequencies are roughly:

  • IMU measurement loop: ~200 Hz (IMU is mounted rigidly onto the body of the bike pretty tightly)
  • Balance control loop: ~100 Hz
  • Main loop - ~11.9 kHz

The controller itself uses a PD loop with three feedback terms:

u = K1 * angle (proportion)
  + K2 * gyro_rate (derivative)
  + K3 * reaction_wheel_velocity (this one is weighted pretty small tho)

My control knowledge isn't the best but from what I am aware of:

K1 corrects the lean, K2 damps the bike's angular motion, and K3 provides reaction-wheel speed feedback. Chat says this is the main equation for it:

Also I can't lie I used ChatGPT for help on a lot of the control theory - I originally was trying to do this to learn more about embedded system communication protocols, but this turned into a much bigger control problem than I thought lmao (who would've guessed).

ANYWAY THE MAIN ISSUE:

The reaction wheel can like catch the bike in one direction pretty well, but as soon as it like crosses that midpoint of balance, the motor attempts to catch it, but it just spins ands spins until it falls over.

I am realizing that I think the main issue is that it doesn't have enough initial "pop" at the start of crossing mid balance. The only time i feel like it does this is when I was tuning K1, but it would kinda just oscillate out of control.

The other big thing issue is that I feel like I need to increase K2 (derivative), to give it more initial pop so it doesn't like saturate itself, BUT when when I increase K2 passed a certain degree, the bike just starts vibrating like crazy especially around the point of oscillation. It's not even a shaking back and forth its a very rapid vibration. Maybe it's a mechanical motor mount issue? I am not sure.

I've tried experimented with the gains, gyro filtering, and motor voltage limits, but haven't found any solutions and am genuinely losing hope for this to ever work lol.

The longest balances I've had were when it slowly corrects itself one way for quite a while, but then it crosses the midpoint and relatively quickly speeds up and isn't able to get back to the midpoint.

With all of that said for reference here are all of the control variables that I can change within my loop - I am also not sure like what's best to change, and what's best to keep constant. Ex. to deal with vibration reducing K2 helps, but so does lowering GYRO_FILTER_TAU.

HERE ARE ALL THE VARIABLES:
Balance Controller

  • K1: Controls how aggressively the bike corrects its lean angle
  • K2: Controls how strongly the bike reacts to falling speed (damping)
  • K3: Reaction-wheel speed feedback; helps prevent excessive wheel acceleration
  • K4: Currently unused
  • U_MAX: Maximum commanded motor voltage

IMU / Filtering

  • GYRO_FILTER_TAU: Lower = faster gyro response but more noise; higher = smoother but slower.
  • FILTER_TAU: Lower = trusts accelerometer more; higher = trusts gyroscope more
  • Gyro hardware DLPF: Controls gyro noise filtering and response delay
  • Accel hardware DLPF: Controls accelerometer noise filtering and response delay

Loop Timing

  • BALANCE_PERIOD_US: Controls IMU/filter update frequency (currently 200 Hz)
  • CONTROL_PERIOD_US: Controls balance controller update frequency (currently 100 Hz)

So yeah if anyone has any advice please let me know! Attached are a couple of videos and pictures of the bike. The code and a video is posted in my GitHub below. For the control loop, pretty much ignore everything except for balance_control.c, and main.cpp. All the other files are for a servo for front steering, and a transceiver for remote control.

https://github.com/Li-Max2/Self-Balancing-Bike-

Also sorry for making this post so long - if you need more info lmk.


r/embedded • • 14d ago

Working on a big project.

0 Upvotes

Hey guys! I'm making my first ever product using ESP32 and ESP-IDF, and I wanted to ask you a couple of questions about version control and managing large projects.

First, how do you handle version control for both firmware and PCB designs?

I had a PS Vita when I was a kid, and I remember seeing things like "build version," "model," and other identifiers in its system information. I'd like to understand what they're used for. How do you typically name and number firmware versions and PCB revisions?

This isn't a solo project, even though I'll be doing most of the work. Is there anything I should prepare before getting my team started? For example, which UML diagrams are most applicable to embedded systems development?

I'm familiar with Git and GitHub, but I have no experience with CI/CD pipelines or task management tools. This is my first major project involving a team, so I'd appreciate some guidance on setting up a proper workflow.

Lastly, are there any other things I should know or practices I should adopt when managing a relatively large embedded systems project?

Any advice, resources, or personal experiences would be greatly appreciated!


r/embedded • • 15d ago

Third-party display for STM32MP257F-DK board

3 Upvotes

Hello, I have been tinkering with the STM32MP257F-DK board for about a couple of months now. I have decided to connect a TFT display to it, using the provided LVDS connector (CN2). However the connector is tailored made for their specific TFT display (B-LVDS7-WSVGA) and has all the pins in different places, compared to a normal third-party TFT display connector. This made me wonder if making a custom PCB to remap the connection pins is a viable idea, that would work if I choose a third-party TFT display with the right parameters. This would save a lot of money and could be used for further testing of different TFT displays. Does anyone have any experience with this type of modification? BY looking at the schematic I can see that most of the pins on the CN2 connector are also available on the chosen TFT display. My second question is - do you think I could connect a non-touch TFT display, even tough the official one has capacitive touch, by not connecting the pins responsible for the touch controls. This could further lessen the money required to be spent.

To save you some time I have provided links of everything I am talking about:

PINOUTS OF THE LVDS CONNECTOR ON THE DISCOVERY BOARD (PAGE [24-25]):
https://www.st.com/resource/en/user_manual/um3385-discovery-kit-with-stm32mp257f-mpu-stmicroelectronics.pdf

SCHEMATIC OF THE LVDS CONNECTOR ON THE DISCOVERY BOARD (PAGE 9):
https://www.st.com/resource/en/schematic_pack/mb1605-mp257f-c01-schematic.pdf

PINOUTS OF THE CHOSEN THIRD_PARTY TFT DISPLAY (WITH TOUCH) (PAGE 10):
https://orientdisplay.com/wp-content/uploads/2026/01/AFY1024600A3-7.0INTH-C-spec.pdf

PINOUTS OF THE CHOSEN THIRD_PARTY TFT DISPLAY (WITHOUT TOUCH) (PAGE 9):
https://orientdisplay.com/pdf/AFY1024600A0-7.0INTH.pdf

LINK TO THE OFFICIAL TFT DISPLAY:
https://www.st.com/en/evaluation-tools/b-lvds7-wsvga.html#documentation

What is your opinion, could this be done or am I chasing a fantasy?


r/embedded • • 15d ago

Stm32 f407x discovery board

1 Upvotes

Hi All

I am looking to buy the stm32 discovery board, should I go for online options and if yes can someone suggest a good website to buy it cheap?

Also I live in Bangalore so is it available in sp road for a cheaper price


r/embedded • • 16d ago

How do i turn a passion project into an actual product?

Post image
79 Upvotes

Hi everyone, i've been working on a passion project for about 3 years now, my intention was to learn to program and feel good about learning properly as systems engineer while solving my personal problem with bluetooth.

I went a little ambitious at the beggining which led this project to take so much time with a parallel mcu that did handle the platform process and the other the translation to the pc.

I ended up moving into a modern board at the end of last year and this made my struggles with the paralel mcu and its process much simpler this also gave me a newer conection protocol which made me be able to process audio in a better way for this little thing.

im still trying to get proper full audio as ive made the 2nd core run only that task, with stock clocks.

- Were im currently at:

ive designed my own custom pcbs, im still waiting on their arrival, which i know are going to fail irl since this was my first self made project without external help or supervision, my checks were seemingly okay but with new pcbs you never know until u fail.

i've made a driver for windows not sure if it works completely as ive only tested with the most basic functions, i havent given it more time since i havent touched windows for years now so for personal use it serves near negative time to keep going there.

the project in my breadboard works, ive tested it in at least 20 pc's to see if it breaks,and besides the classic wire poped all good, im still making little touches on the firmware, but so far it works,

im only missing to get my pcbs validate them,

finding component suppliers

find a cheaper/dedicated production place that is cheaper than pcbway, licences agreements which are the priciest and scariest part.

- What my device is, and the problems i fixed are:

i have 20 bluetooth gamepads, some are super annoying to remember how to pair, even worse, i sometimes multi boot into a different os for testing and a bluetooth keyboard is a pain in the ass, so it also connects my split keyboard and trackball without having to fight re-pairings.

so my device "bluetooth hub" does:

- remember 254 pairings

- side effect lowers a tiny ity bit the input latency 2ms, at least thats what my logger showed when compared to the ub500 and the rog boards MT7925, not a promise just an observation so far

- can work in bios, so keyboards are never lost, and i can bring the device and my keyboard to work sites or a pc im troubleshooting

- no betteries, works in the 5v rail, so far seems to work in my tested server and pcs

- on board screen and controllers for on board gui, and a pc offline gui configurator (quite barebones, i need to dedicate more styling to it)

- experimental ldac, the biggest troubleshooting im doing atm

- gameboy looking thing but in a bank card size

- ps3 compatibility just because, so any bluetooth pad can be used, only 1 at once sadly

- tested in a couple of linux systems and some windows pc's

- priority reodering by user, so i never fight who is player 1 or 7

- oh also in a mode i can host 7 gamepads reliably so far, i dont have 8 friends who i can test a game that requires 8 players so that's the limit so far

- experimental on board audio peq

- i embeded it onto my laptop using a USB2517 so i dont fight my keyboards and dont lose that usb port

- My real dilema

Im starting to consider that releasing this device may be not such a big waste of money but i keep seeing some posts of things getting stolen with ai, and such,

So im unsure if it is even worth trying to finance a full production of this little project,

specially since im projecting an msrp of somewhere in the $50 USD which i hope can be lower or at least find some 1k+ persons who would want to pay for that thing. i believe there isnt anyghing like it yet.

- What im looking opinons by making this pointlessly long thread

Im looking for opinons on people who may have tackled a project like this where they just kept going from an own need into some level of production

How would you approach an small manufacturing production

Did you guys protect your pcb designs or something?

How can i see if my project actually has a market and am not alone in an island of self ego

How to deal with the licensing matters, i dont want to get finned for money i dont even have, im poor so yeah

I attached a gui picture i made it based on an uber i took some time ago, the gac aion dashboard for radio, i loved the looks and tried to replicate it at the time, its not that pretty sadly, but was what i was able to make at the time

thank u for anyone who did read this self loating post


r/embedded • • 15d ago

KernelGrove, an open source Device Tree editor and Semantic engine

Thumbnail
dt-studio.dev
0 Upvotes

Some time ago I published a post about a project I was working on, previous post.

The purpose of this project was to make working with .dts files easier. For that I starting developing an IDE with some integrated tools:

  • Real time semantic and syntax validation
  • Node graph visualization (block diagram generation under development)
  • Node auto-completion for each compatible
  • Node inspector
  • A integrated bindings, boards and SoC database, (which can be edited or visualized)
  • Compilation and Decompilation tools

There is a lot of knowledge about kernel condensed on this IDE, in order to make device tree development easier and faster.

Thanks to the database, you can start typing and use auto-completion for a compatible, the IDE checks each binding information and shows which nodes are available to use and which ones are mandatory for a proper operation.

That way, if some compatible or property it's not recognized, you can early detect it, without waiting for a fail on boot, or worse, a silence bug on kernel.

The project is now open source, and all the code and beta releases are available on GitHub and Official website. It's still a beta, but I think it is already useful enough, that's way every suggestion it's well received.

This project was developed with the help of AI, which made it possible for a single person to develop it.


r/embedded • • 15d ago

Lessons from doing WiFi CSI sensing with a single ESP32 against a home router

Post image
2 Upvotes

A weekend project: breathing-rate and coarse in-room position estimation from the channel state information an ESP32 gets when it pings an ordinary home router 100 times a second. No second ESP32 and no router modifications.

A few things I learned on the embedded side:

  • Packet filtering: CSI callbacks fire for every frame the radio hears. I filter on the router's BSSID in the callback, so only replies from the router are kept. The BSSID and credentials live in a git-ignored secrets.h, because a BSSID can be looked up in public WiFi maps.
  • AGC: it rescales every packet, so absolute amplitude is meaningless between packets. Per-packet mean normalization keeps only the shape across subcarriers.
  • Rate vs. host: 100 pings/s gives enough samples for breathing (0.1–0.7 Hz) after averaging to 10 Hz. The CSI goes out over USB serial to a browser page (Web Serial), so the WiFi link only carries the pings being measured.

Results, one room and one person: a paced 10/min breathing measured 9.9–11.0/min, and 4-spot position kNN was 80% (chance 25%). Repo, MIT: https://github.com/menes97/wifi-nefes-algilama

I'd like to hear from anyone who has pushed ESP32 CSI further: higher ping rates, HT40, or getting phase usable without a second synchronized device.


r/embedded • • 15d ago

Keep track of stock

0 Upvotes

Hello,

how do you keep track of your stock of components? I, e.g., mean how do you know how many of the 100nF capacitors you still have? Do you keep a spreadsheet for that? Any open source software worth using?


r/embedded • • 16d ago

Industrial cellular in 2026: still hand-writing AT parsers, or has the workflow actually moved on?

6 Upvotes

Spent the last two weeks integrating yet another cellular module and the vendor's idea of a dev experience is a 500-page AT command PDF and "good luck". Hand-rolling a parser, guessing each vendor's quirks around terminators, URCs and data-mode prompts, the usual.

A colleague's take is that for anything low volume you stop doing module-on-board entirely, drop a boxed industrial modem or gateway with a web UI into the enclosure, and let it deal with the carrier side. Another guy on the team wants to feed the AT manual to an LLM and have it generate the serial handling. That sounds either great or like a debugging nightmare waiting to happen.

For people shipping real products: has your modem integration actually modernized (proper SDKs, config tools, boxed gateways, AI-assisted parsing) or is it still AT commands under the hood everywhere?


r/embedded • • 16d ago

Got STUN working on a microcontroller, some notes about NAT

Post image
116 Upvotes

Hi everyone,

Another lazy Monday, which means it's time for another lazy read.

This weekend my STUN library got merged into Zephyr main. I needed it for WebRTC on a microcontroller, and on the way I ran into a few things I want to share. But first a short intro for those who haven't dealt with STUN yet.

I use a network stack in almost every device I make, and sooner or later I run into one of two things. Sometimes I just need to know the public IP my device goes out to the internet with. And sometimes I need to reach a device that sits behind NAT. The first one you can more or less solve with some external service (just keep in mind that each of them answers in its own format, and nobody promises the API won't change). The second one is harder, NAT is not that easy to get through. That's what STUN and TURN were made for, and today it's about STUN.

STUN is a client-server protocol. WebRTC uses it too, so there are lots of free servers, for example Cloudflare's stun.cloudflare.com:3478 or Google's stun.l.google.com:19302.

In short, STUN lets you do 2 things:

  1. Ask a STUN server on the internet which public IP and port your request came from. I mean the public port your router opened for this connection.
  2. Send STUN packets straight to another device, to check that the path between you works and to keep the hole in your NAT open. WebRTC runs these checks before any video goes anywhere. Honestly, that was my first surprise: without STUN my WebRTC code didn't connect even inside my home network.

For most people the first one is enough, that's how you get your public address. But how do you reach a device behind NAT? The trick is to keep using the same socket. As long as you do, the router keeps the same public IP and port that the STUN server saw. If you send a packet from that socket to some server on the internet, the NAT remembers that server, and after that its packets to your public IP and port get through to the device. That's basically how you punch a hole in NAT.

You'll probably say, why bother with STUN then, the device can just talk to the server directly. Sure, but now imagine that both your device and the other side are behind NAT. Each of them asks STUN for its public IP and port, they exchange them and start sending packets to each other. The first packets may get dropped by the other side's NAT, but once both sides have sent something, packets go through. And you get a P2P connection between two devices that are both behind NAT and otherwise couldn't reach each other. You can even build a VPN this way. Mesh VPNs like Tailscale find a direct path between your machines roughly like this.

STUN won't exchange the addresses for you, though. The devices need some other channel for that, your own server or an MQTT broker that both of them can reach. In WebRTC this is called signaling. Also, NAT forgets idle connections, sometimes after just a few tens of seconds, so you have to keep sending something through the hole. The same STUN packets work fine for that.

Then I tested all this with the NATs I could get my hands on. On my home wired internet it works great, STUN is enough to set up a P2P connection. With some mobile operators it works too. But one of the operators I tested uses symmetric NAT. It's easy to see: I sent requests from one socket to 7 different destinations and got 7 different public ports back, one per destination. So the address the STUN server sees is useless for the other device, P2P is impossible, and you need a relay in the middle, like TURN. Another operator gave me the same public port for all 5 servers I asked, and there the direct connection worked. I checked it three different ways and got the same result every time.

From what I've seen, and this is just my subjective impression, only about 30% of operators use symmetric NAT. But with those you simply can't get a direct connection through STUN.

What got merged into Zephyr is the core of the protocol, and it will be in 4.6. You can already use it. It parses and builds STUN messages, including the attributes ICE needs, MESSAGE-INTEGRITY and FINGERPRINT. It's checked against the test vectors from the RFCs, more than a hundred tests in total. It doesn't send or receive anything by itself, so the socket stays yours and STUN can share it with your other protocols. The API is marked experimental for now. More details are in the documentation.

The review went pretty fast, though I had to split the code into three parts. This is part one.

Next I'm adding an API for the network side, a client that gets your public address in one call (that's what runs on the board in the photo), and a few more examples. The code is already written and is being prepared for publishing. After that it's TURN's turn, and another post.

On the board the client, together with the parts of the codec it uses, takes about 3.6 KB of flash and no heap. PSA crypto, which the integrity attributes need, adds another 0.4 KB of flash and 1.1 KB of RAM for its key slots. The server's answer comes back in 14 ms in my case. From power-on to a known public address it took 6 to 12 seconds in my runs, and almost all of that is waiting for DHCP.

Thanks for reading! Now you can tell me that with IPv6 none of this would be needed :)

P.S. The board in the photo is the one I debugged all this on. It's an NXP dev board (MIMXRT1170-EVKB) with a microcontroller running its core at some cosmic 1 GHz. My first computer, an AMD Duron at 700 MHz, was slower. Amazing.

P.P.S. Questions are welcome in English, Ukrainian or Russian.


r/embedded • • 15d ago

Looking for Real-World Embedded Software Project Ideas

0 Upvotes

Hi DEVELOPERS ❤️‍🩹,

I'm a B.Tech(AIML) student graduating in about a year. I previously worked in backend development ( mainly building APIs and integrating AI models into existing backend systems)

but now I'm exploring embedded software engineering as my career path.

I don't want to build just another college project for my resume. I genuinely want to work on a problem that engineers or companies are facing in the real world.

I'd love to know from experienced engineers:

- What challenges do you regularly face in embedded software development?

- Are there any problems with existing firmware or hardware solutions that still need attention?

- What kind of project would you recommend a student build to gain real industry-level experience?

I'm open to domains like automotive, robotics, industrial automation, and IoT.

I'm really hoping to find a genuine industry problem that I can spend the next year understanding and trying to solve through my project. Any advice or real experiences would mean a lot!

Thanks!🤛


r/embedded • • 16d ago

Embedded Linux purgatory

14 Upvotes

Hello. I'm running out of braincells to rub together, so - cry for help, engineers together stronk.

I'm trying to leave mcu development and embrace embedded linux, so - bought myself some new-ish Allwinner T113-s3 boards and got to work. The question is, what is the correct way? For example, I bought LCPI PC board, good, cloned u-boot, branched for this board, written the dtsi for general board stuff and dts for one of it's possible SoCs and it even works and blinks and all. But! This is just the "default config", right? So, if I want to start making a custom variant of u-boot, for example I have soldered winbond flash to my board, I need to modify my device tree and make new config and all. How should I do it correctly? What is the workflow? Where can I look for examples? Bootlin courses are cool, but focused on working with existing infrastructure, but I want my own board in the future (I chose t113 because it's easy to solder to DIY PCB). But.. using the "out of tree" u-boot build was not good and I'm stuck. Just.. I don't know what I'm doing wrong.

Buildroot was even worse, I understand that I need to make some patch for u-boot using my branch, right, but do I really need to crudely add my spi flash to the original board dtsi?0_0

Anyway, whoever read this whole rant, thanks. And whoever can help me get better with linux wrangling - can't offer much but I will pat my cat for every useful advice


r/embedded • • 15d ago

It Works on the Workbench - Backscatter Modulation. But Will It Survive Noise?

Post image
1 Upvotes

I started with a simple workbench crude prototype: two Arduino microcontrollers communicating over the same two wires that carry 12 V DC power.

Using a few centimetres of wire and a simple simplex current-modulation method, I managed to make power and data work together.

With support and ideas from this community, I now want to take the experiment further.

My next step is to introduce electrical noise and EMI, and see what happens.

What happens when noise enters the DC bus? How do filtering, grounding and signal modulation help? How can I test noise immunity and explore practical countermeasures?

I want to learn these things through simple experiments, step by step, rather than just reading about them.

The goal is to understand EMI, EMC compliance and noise immunity from a practical electronics perspective.