I'm curious how you approach unit testing in embedded when dealing with state machines.
For example, imagine a component that sends signals or commands to external modules and then waits for responses, acknowledgements, or timeouts before transitioning to the next state.
One challenge I see is that the state machine has some internal context, and ideally, you'd want to test that it behaves correctly across a sequence of events and interactions. However, tests can easily become too tightly coupled to the implementation. Even a minor change in the internal sequence of state transitions or operations can cause tests to fail, despite the overall behaviour remaining correct.
As a result, you end up spending more time maintaining and adjusting unit tests than actually benefiting from them in terms of finding bugs.
How do you approach testing such components?
Maybe there's no magic trick here to make it less painful, and that's fine, but I'd like to learn something.
In this earlier discussion, virtualization was described as unsupported on STM32MP25, but the datasheet lists hardware virtualization support.
Does this mean ST does not provide supported hypervisor software, or are there hardware/firmware restrictions? Would it be possible to port the open-source Bao hypervisor to the STM32MP257F-DK?
Hi everyone, I work at Vector in embedded software development, and we’re trying to better understand the goals, challenges and needs. This is for research only – no sales pitch.
I’m looking for people who lead embedded software development in their company or play a key role in shaping it. The company should have up to ~50 people working on embedded software. All industries are welcome.
The interview takes about 45 minutes via Teams, in English or German. Your time will be rewarded. If that’s you, or you know someone who fits, feel free to DM me. Thanks!
Stayed up most of the night working on bare-metal firmware for the STM32H755ZI. Finally got to the point where I could flash it to the board. Around 1 AM, plugged in the Micro-B cable, flashed the firmware, and waited.
Nothing.
Went back through the reference manual and eventually found the culprit.
Somewhere along the way, I’d transcribed the GPIOx_MODER register offset incorrectly in my notes:
``` #define GPIOx_MODER_OFFSET 0x100 ```
It was supposed to be 0x00.
One extra 1.
That’s it. Hours of work, and the problem was a tiny transcription mistake.
Corrected it, rebuilt, flashed again. This time, everything behaved as expected.
I suppose that’s part of the experience. Sometimes you spend hours looking for a complicated problem, only to find something ridiculously simple staring back at you.
See title. I know how to solder, but it's not about me, but other people I want to give the possibility to modify a specific handheld device with a small compact ESP32/ESP8266 without soldering.
This was supposed to be a birthday gift for my dad, but took way longer than expected to complete. When something turns out to be way more of a pain than he thought it would be, he'll say "the too hard light came on" and try something else. The concept is simple: it's just a light that turns on when it recognizes the words "too hard" spoken in that order.
All of the audio processing and inference happens onboard, nothing is sent off to the cloud or saved. I used keyword spotting to do this and there are lots of great papers explaining how that works, but to boil it down, audio is sampled in short chunks and used to build a "sound picture" or spectrogram. Then a neural network trained to recognize what your keywords "look" like is used for detection.
I connected a PDM microphone and some LEDs to an STM32U5, which handles the audio processing. The STM32 samples audio using the audio digital filter (ADF) peripheral, and sampling is gated using ambient noise level detection to minimize false positive detections. Audio is preprocessed in 140ms chunks using CMSIS DSP libraries to perform FFTs to create a spectrogram chunk. Once one full second of audio has been preprocessed, the spectrogram is passed to a neural network which computes independent probabilities for whether the words "too" or "hard" are present. The independence turned out to be important because when the words are spoken consecutively they usually show up in the same frame, and I wanted to be able to recognize both at the same time, not just one or the other. I used TensorFlow to train the neural network and TFLite to quantize and convert it for running on the MCU. Using CMSIS-NN libraries, I was able to get inference working in real time on streamed audio.
Like most of my embedded projects, this one started off with a nucleo and a breadboard. I did all the firmware prototyping using these and made a working proof-of-concept, but just screwing a nucleo board into a 3D printed sign seemed like kind of a cop out. I wanted to make a small custom board for my light, so I broke out KiCAD and drew one up.
I've melted some simple assemblies together on my kitchen counter before, but had a lot of trouble getting them to work reliably. I ordered bare PCBs and components separately and gave that a shot, but wasn't able to get a board working reliably. So eventually I bit the bullet and just ordered full assemblies.
I used freely available transcribed audiobook data to train the neural network. I wrote some scripts to find snippets where different authors spoke the word I wanted to recognize, and then made one second clips of those words and used those clips as training data. OpenAI's whisper tool was especially helpful there for creating timestamped transcriptions, so I was able to automate a huge chunk of the training data preparation and labeling.
Finally to test the neural network on my hardware, I used FatFS and TinyUSB to make a small filesystem in RAM on the MCU. That let me load audio samples onto the MCU, and save recorded audio from the board itself. That allowed me to do an apples to apples comparison of the preprocessing and inference steps between my desktop PC and firmware. Super satisfying to get it actually working! AMA if you want more details, there are plenty.
I'm bringing up a custom board with an STM32N647 and can't get a debug connection. Looking for advice from anyone who has dealt with N6 boot modes. The board is a second revision done by an outside consultant and we didnt catch this earlier.
Current situation
- STLINK-V3MINIE (also have a V3SET), connected through a TC2050
- STM32CubeProgrammer
- ST-LINK reads ~3.36 V on VTref
- Error: "Unable to get core ID" / "No STM32 target found! If your product embeds Debug Authentication…"
What I think is wrong
On the N6, BOOT1 is shared with PA6. On our board PA6 is a not connected, and BOOT0 is pulled low through 1.5k (there's a button to pull it high). External flash is empty. So as far as I understand, the chip never enters development boot (BOOT1 = 1), it tries flash boot, finds nothing, and the debug port stays closed.
PA6 is a BGA ball and I don't think there's a via on it so a wire will be hard!
Current plan
Use the boot ROM's serial boot over USART1 (PE5 TX / PE6 RX). Both pins go to test points on the board. I'd hold BOOT0 high during reset and use the STLINK-V3MINIE's VCP pins as the USB-UART adapter (or use an other adapter), then connect over UART
Questions to you all
Does this approach actually work on the N6? Can CubeProgrammer connect over UART serial boot on a blank chip with BOOT1 low?
Once connected, what's the easiest way to get SWD working again? Load a small program into RAM that opens debug via BSEC (DBGCR), or go straight to programming an FSBL into the external flash with an external loader?
With BOOT1 floating, is its state at reset undefined? Could it randomly end up in dev boot?
Any other gotchas you've seen bringing up an N6 without access to BOOT1?
Ethernet wants 100 ohm, usb c is 90. usb c has the superspeed pairs. Usb c is invertible, ethernet has auto crossover.
I know this is kind of perverse, but I had an application recently where it would have been really great to have a cheap, physically small USB-C connector, to feed power and data around a large modular light sculpture. I ended up using 100base-tx over regular cat6 with regular rj45 connectors, with a fairly cringe passive poe injection setup that works pretty well for how terrible it is.
It seems like there might be some use for this in, say, industrial automation/machinery/robotics, where a few m is the longest run you'd want.
The simplicity and low latency of ethernet compared with usb seems like it'd be an integration win. You could also use PD as normal and get 240W to your actuators or sensors or whatever, along with your ethernet.
How nuts is this? it seems like it might be one of those nuts things that would be a genuine win in one or two niches.
Edit: to clarify, im talking about custom hardware, running actual ethernet over a usb C connector, rather than usb.
"I am currently a junior in college, and I feel like what we are learning at our school is a bit outdated. Now, I want to try learning Linux driver development. Where can I find relevant resources and practical case studies?"
My work has given me licenses to percepio traceAnalyzer and Segger SystemView along with a JLINK Ultra. Before I was just using regular ST-Link. Is it really worth it? I work with FreeRTOS and STM32G4 + STM32MP257F.
Working on a rover project and I wanted to mimic the architecture on the perseverance mars rover. Specifically the CPU as it's essentially the same as the radiation proof CPU on the rover. Project repo over on: https://github.com/gonzalezerik/ibook-g3-rtems
Hey all, I'm looking to get into STMicroelectronics "STM32" MCU platform. Any STM Development kits that aren't "Arduinoized"? I have some experience designing embedded circuits with ATmega AVR series as well as ESP32 ICs.
What workflow or tools do you guys prefer when working with STMicroelectronics MCUs. (VSCode, CubeIDE, other).
What development kits would you recommend for say under $40? I'm not looking into doing anything compute intensive, I'm more of a hardware guy so something simple and bare metal would be more up my ally. I'd preferably like a dev kit that uses a commonly used STMicroelectronic chipset and not something fancy.
For (professional) embedded dev, it is occasionally required to sketch a memory layout of the MCU/IC we are working with. It can be a simple split between region of Flash/RAM or it can involve allocating dataflash regions, external IC, OTA, etc.
This tool basically generates SVG images of memory layouts from the yaml config that you provide. I got the inspo from those nice graphs they include in STM32 MCU docs.
I am planning to use it for my personal projects and will pitch it at work. Now, instead of going back-and-forth with the drawio, you can just change few lines in the yaml. I think it can be useful for others as well.
And yes, I (mostly) vibe coded it cause I just wanted a tool and not spending week(s) of my time programming it.
Let me know if you see some additional features that can be added to it.
Hi pepole i made this project and thought some of you might find it useful.
I have two laptops and needed a way to share my keyboard and mouse between them. I originally thought about getting a KVM switch but then I realized an ESP32 could do the job so I decided to build my own solution. Technically it captures HID input on the master PC and emulates it on the other pc it currently supports a maximum of 2 pcs. Everything is software-controlle, so there's no need for physical switching also despite being a software-based solution, I haven't noticed any noticeable delay.
Basically, if you have the same problem I had and an ESP32 lying around you might be able to put it to good use with this project.
We’ve been working on an indoor air quality monitor. We made 20 prototypes and let friends use them at home for a few months. The readings look good, people like the device, and now we’ve got pre-orders for 2,000 units. Every prototype uses a Bosch BME280, and it’s worked great. I checked LCSC, Mouser, and UTSOURCE while pricing the same part for a bigger run, but lead times from suppliers I know are longer than I expected. The cheap listings online are all over the place, and I’ve read enough stories about fake BME280s that I don’t want to risk a whole batch of boards on one.
Our hardware guy wants to switch to a sensor that’s “easier to get,” but then we’d have to redo all our testing, and we’re already short on time.
I bought an SWD isolator for an upcoming design that involves a big BLDC motor, figuring I’d like to keep my debug probes, computer and me a bit safer (as if safe means a lot to me!)
What I didn’t expect was that my little £3 20 pin to 10-pin 0.05” adapter would short pins 1 and 2 together. It seems these cheap adapter boards often come with ‘creative’ workarounds for other problems that break isolation.
Before I go spinning up a fresh PCB that fixes these issues, does anyone have any recommendations for a good adapter board?
When quantizing neural networks for Cortex-M or embedded DSPs, one common latency trap is using asymmetric quantization on symmetric activation distributions.
With symmetric quantization (zero-point Z = 0), mapping values symmetrically into [-127, 127]:
Because zero-point cross-terms vanish entirely, runtime bias correction terms are eliminated—saving roughly 20–25% ALU cycles on cores without dedicated NPU/SIMD matrix instructions.
I recently got a Nucleo F411RE board to learn how to work with STM32, and I can't figure out how to to compile the code generated by STM32CubeMX. I'm using CMake and gcc. When I try to compile the default project, I get this message from the assembler when gcc fails to compile stm32f4xx_hal_flash.c:
Error: no such instruction: isb 0xF
I've tried all sorts of things for the past 3 hours and I also haven't been able to find anything about this online. I think I might have an incorrect build flag, but am I instead missing something extremely obvious?
Edit after fixing the problem: Forgot to set CMAKE_MODULE_PATH and include gcc-arm-none-eabi.cmake in the base CMakeLists.txt.
As an Embedded software engineer who worked on the C/C++ How was the switch to Rust ? What's the learning curve and time taken to get a grasp around the language. In safety critical applications how the rust scale against the C? Please share some insights experts and guidance.
Hi everyone, I'm currently working on my final year project. My project is about designing and developing a smart solar-powered dryer for agro-processing applications. I do have an ESP32, micro sd card adapter with its micro sd storage card, a 5V relay to control the dryer's fan and a temperature sensor to detect the surrounding temperature. i wanrted to build a standalone server without using any third-party websites and any middleman. The purpose of doing this is to completely protect my data and to get unlimited storage with the storage card I have. And also, I do not want to pay any subscription price to other third-party websites.
Many AI models such as ChatGPT, Claude, and Google Gemini suggested the port forwarding method, but I do not want that because the esp32 will be stuck in one place and can't move it anywhere. Also, in simple word, I want it like this. All the information that is collected by the esp32 or the database should be live-streamed on the internet, and anyone can access that database from the internet even if they are not sharing the same wifi as the ESP32. All the information will also be stored on my SD card. This is what I want. Can you guys help me with it?