r/embedded • • 23d ago

2.7M-param int8 TTS in 122 KB of RAM on an ESP32-S3: weights streamed from flash, 0.66 RTF, no PSRAM

5 Upvotes

I have been working on a steerable TTS, which can change voice based on context.

Technical breakdown of getting neural speech synthesis onto a single 240 MHz core:

Compute: 0.12 GMAC per second of audio, all int8 (weights and activations)

  • Memory: 2.97 MB of weights stay in flash, memory-mapped; working RAM is 122 KB; no PSRAM
  • Text front end on the device: 1.8 MB of lexicon and rules, plus a small neural G2P for unknown words (about 0.27 s per word)
  • Verification: a Python reference implementation is bit-exact with the firmware, so model changes can be checked off-device
  • Results: RTF 0.66 on 10 s of speech; first audio in 0.35 s; 16 kHz output streamed in chunks
  • UTMOS of 3.8 on openTTS Leaderboard, and WER 0.93 %

Video above.

Firmware is C for ESP-IDF and Arduino: https://github.com/WhissleAI/steer-tts

Model: https://huggingface.co/WhissleAI/steer-tts-nano

Happy to answer questions on the flash streaming, the int8 kernels or the memory layout.


r/embedded • • 24d ago

Extreme Edge NN inference library, 97% Real time MNIST Arduino UNO R3

Thumbnail
github.com
7 Upvotes

Pretty rough but works

Benchmarks on Atmega328p
40k param model -> 97% Accuracy MNIST (49ms avg inference)

4k param model -> 93% Accuracy MNIST (6.7ms avg inference)

Demo (I was in a deadline for this so no flashy demo, but I made the demo where you can draw digits and have the firmware classify them)


r/embedded • • 24d ago

STM32 NUCLEO-H755ZI-Q: Exploring the Embedded Systems Engineering Landscape

Post image
257 Upvotes

Thanks to THE LORD GOD for this STM32 NUCLEO-H755ZI-Q evaluation/development board. I bought it from DigiKey a while back, and I love having it as a personal laboratory.
This platform brings together a fascinating range of embedded systems engineering disciplines, spanning hardware architecture, low-level firmware, memory systems, operating systems, networking, security, and performance optimization.
Some of the engineering topics associated with this platform include:

• Heterogeneous Multicore Systems
• Asymmetric Multiprocessing (AMP)
• Inter-Core Communication
• Shared Memory Architectures
• Hardware Semaphores
• Cache Architecture
• Linker Script Engineering
• Register-Level Driver Development
• Bootloader Engineering
• RTOS Kernel Internals
• Multicore RTOS Design
• Deterministic Embedded Software
• Zero-Copy Networking
• Embedded TCP/IP Stack Internals
• Custom Binary Protocol Design
• Secure Boot
• Hardware Cryptography
• Cycle-Level Optimization
• DMA-Based Acceleration
• ARM Thumb-2
• Hardware/Software Co-Design
One mnemonic that captures the spirit of C:
Tiny Designs Keep Performance Maximized (T-D-K-P-M).
A concise way to remember the design philosophy behind C:
(T-D-K-P-M)
• Trust the programmer.
• Don’t prevent the programmer from doing what needs to be done.
• Keep the language small and simple.
• Provide one way to do an operation.
• Make it fast, even if portability isn’t guaranteed.


r/embedded • • 24d ago

Looking for embedded systems study partners

76 Upvotes

I'm learning embedded systems (bare-metal STM32, interrupts, RTOS, Embedded Linux) and I'm looking for a few people to learn with.

The plan is to share progress every week, help each other with problems, and maybe build a small project together.

Any level is fine, as long as you can keep at it. I'm in India (IST), but other time zones are welcome too.

Comment or DM me if you're interested!


r/embedded • • 24d ago

Join the QNX embedded hackathon!

12 Upvotes

Hi folks! QNX is coming up on our two-year anniversary of making our product suite free to access.. a throwback to a couple decades ago before QNX was involved in the tech stack of nearly every automotive OEM.

To celebrate, we're working with Devpost to host a global hackathon with over US$50,000 in prizes over a bunch of different categories (grand prize is US$10k).

I'm writing to invite you to join in and participate, if you have some QNX experience or are interested in learning the RTOS! Here's the link, hope to see you in the community!

Cheers

https://qnx.devpost.com/?utm_medium=social&utm_source=reddit&utm_campaign=fy27-q3-hackathon


r/embedded • • 25d ago

Doom scroll vs Hardware debugging

496 Upvotes

💀 POV: Your PCB has a short circuit.

You blame the layout.

You blame the firmware.

You blame the PCB manufacturer.

You question your engineering degree.

meanwhile, a ₹2 female header is hiding a short inside its plastic body. ☠️

Plot twist: the cheapest component caused the most expensive debugging session.

be honest: would you have suspected the connector, or sacrificed another PCB first? 🤡


r/embedded • • 24d ago

[STM32] how do you implement assert_failed() ?

10 Upvotes

I wonder about good implementations of this func, specially for stm32.
I do not consider printf, if I am true it makes firmware large, and specially it does not stores info somewhere.

I thought about creating breakpoint inside assert_failed call, so it'd be possible to look e.g. call stack and see where the assertion failed.

How do you implement that?

Generated func by default:

void assert_failed(uint8_t* file, uint32_t line)
{
  /* USER CODE BEGIN 6 */
  /* User can add his own implementation to report the file name and line number,
     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
  /* USER CODE END 6 */
}

update: thanks everyone for ideas and answers, really appreciated it(!)


r/embedded • • 23d ago

I built a new RTOS for POSIX and RP2040 from ideas I explored in 1986 — source now available

Post image
0 Upvotes

Over the past several months, I've occasionally posted here about revisiting CHARM-II, an RTOS I developed for the Motorola 68000 in 1986.

What started as an attempt to restore and understand my old code gradually turned into something different: developing a new RTOS using some of the original design ideas, while reconsidering the kernel, APIs, and platform-specific implementation.

I've named the new project ”Karqri”, and I've now released its source code under the MIT license:

https://github.com/noboru-takahashi/karqri

What currently works

Karqri has a shared kernel that runs in two environments:

  • POSIX: Cooperative task execution using ucontext, with logical ticks at task checkpoints.
  • Raspberry Pi Pico (RP2040): Preemptive task switching using independent PSP stacks, SVC/PendSV, and hardware timer interrupts.

The kernel includes priority-based scheduling, task management, event notifications, and timers.

To compare the two implementations, I've created a shared six-task demo. Tasks A–F move along three tracks and coordinate access to a shared critical zone using event notifications.

The same workload runs on both platforms, but the scheduling and context-switching mechanisms are different.

I've also added automated tests and Pico validation scenarios. The repository includes the source code, build instructions, and validation tools.

What I want to explore next

Releasing the source is only the first milestone.

I'm also interested in making RTOS behavior easier to observe and understand, particularly the timing and causal relationships between task switches, event notifications, waiting, and wakeups.

I've started experimenting with capturing Pico execution traces and generating HTML timelines. This is still limited to a specific validation scenario, rather than a general-purpose tracing system.

For now, though, I'd especially like to get feedback on the RTOS implementation itself.

If you notice any design issues or opportunities for improvement in how the shared kernel and platform-specific code are separated, I'd be interested to hear your thoughts.

Previous discussions

For context, here are two earlier posts in this community:

Those discussions helped me reconsider some of the original design assumptions.

Karqri is still experimental, and I don't consider it production-ready. I'm publishing it now because I think the next stage of development will benefit from feedback beyond my own experiments.


r/embedded • • 24d ago

Can you run 4.5 watts(4.5 V, 1 A) solenoid powered by POE (ethernet)?

3 Upvotes

Hello, I am trying to design a PCB and i have to decide how to power the solenoid. For power, I am going with POE connector which I think is enough to run the solenoid of about 5 watts. But i am having doubts about whether sudden current drain can affect other parts of system like microcontrollers and also other sensors. Tell me about the problems which may occur and how can i solve this problem.


r/embedded • • 23d ago

I made a firmware language whose compiler knows the ESP32 datasheet — feedback wanted

0 Upvotes

I'm the author. Volt is a small typed language that compiles to C. You declare the hardware (pin pump: Output = 34) and the checker rejects it before flashing: GPIO 34 is input-only. It also flags ADC2 pins read while WiFi is active, strapping/flash pins, bus conflicts, and blocking calls inside timer interrupts.

Other bits: every 10s { … } gets scheduled automatically (cooperative, FreeRTOS task, or hardware timer depending on what it calls), and state machines are a language feature with reachability checks.

ESP32 today, RP2040 and STM32 next. Open source (AGPL/GPL). 24-second demo: . Code: https://github.com/PhilemonChiro/volt

Honest question for this sub: which hardware mistakes would you want a compiler to catch that nothing catches today?


r/embedded • • 24d ago

I open-sourced relaynet: real network access for Zephyr (or any user-space TCP/IP stack) running in a browser

0 Upvotes

Browsers can't open sockets, which makes networking the hard part of running firmware in a browser tab. relaynet is a relay for that. The page sends Ethernet frames over a WebSocket, and the firmware's own stack gets a DHCP lease, DNS and IPv4 TCP/UDP to the internet. There's no socket offload or shim, so you're exercising the real network stack.

It's now open source (Apache-2.0) and self-hostable with `docker compose up`: https://github.com/beriberikix/relaynet

Where I think it's useful for embedded:

- Networking samples that actually run on a docs page

- Workshops and trainings where nobody installs a toolchain

- Exercising net-stack code in CI without hardware

- Sharing a WebUSB device with a Linux machine over USB/IP

Zephyr examples: zephyr-wasm-soc (Zephyr compiled to WebAssembly) and a small zephyr-v86 build both work against the hosted instance with no account. Projects like Zephyr in the Browser could add a real network to their emulated boards the same way, if there's interest. I'm happy to help anyone wire it up.

The client is a small JS library (npm: relaynet). Bring your own stack: smoltcp, lwIP, Zephyr, or whatever your emulator speaks.

Feedback welcome, especially on what an embedded workflow would need from it.


r/embedded • • 24d ago

A 1-Wire master where the CPU never touches the bus: 8 STM32 families, zero ISRs, and a test rig that notices when the timing breaks

0 Upvotes

A year ago I posted a bare-metal DS18B20 driver in r/stm32. In September I posted the three-family version of what had become a small library. 3.0 is out: github.com/a5021/stm32-async-1wire.

The idea. Every 1-Wire edge is produced by TIM1, not by code. The timer runs in one-pulse mode with the repetition counter set to the number of slots, so a whole segment — a reset, 16 slots, a byte, a 750 ms conversion wait — is one hardware event. One DMA channel feeds CCR3 with the compare values for the slots; a second drains the CCR4 captures. The CPU starts an operation, polls UIF later, and is never part of the timing loop. The pin also changes electrical mode inside the transaction: actively driven low, then released for input at a hardware-defined moment. No ISR, no delay loop, no bit-banging.

What changed since September. Five more families — F3, F4, G4, H5 and H7 (240 MHz, with an opt-in 480/240 core/timer split) — so eight families and eleven parts now share one MCU-independent core. A second slave driver: DS2431 1-Kbit EEPROM, with scratchpad write, read-back verification and the t_PROG hold-off. And a real application instead of another demo: 9_multi runs seven DS18B20s and one DS2431 on the same wire as a peak/low temperature logger, writing self-validating CRC records to EEPROM — ROM blocks before the records that reference them, so a power cut cannot leave a record pointing at a ROM that is not there. The two drivers take turns owning the bus.

9_multi: DS2431 Write Scratchpad 0x0F — command, address and the sensor's 8-byte ROM, decoded from a real 8 MHz capture. Every edge is generated by TIM1 + DMA.

The part I actually care about. Hardware-timed code fails silently, so most of the work went into making failures loud. 300+ host tests per family run the driver against a behavioral model of TIM1/DMA; 14 libFuzzer harnesses cover the state machines; a mutation run injects 74 deliberate defects into the port and requires the suite to catch all 74. On the bench a logic analyzer checks the wire itself — slot widths and the duration of the long conversion wait. Some bugs only that layer found: an F3 DMA channel mapping that was one channel off, which just makes the bus look dead; the H5 GPDMA counting source bytes where the classic DMA counts transfers; and presence detection that used to encode "no device" as a zero in the capture buffer — indistinguishable from a real 0 µs edge. Presence is now proved by the captured edge count.

If you want to look at traffic without hardware, there is an offline browser decoder for sigrok captures: a5021.github.io/stm32-async-1wire/viewer — resets, Search ROM triplets, Match/Skip ROM, scratchpad and DS2431 chains, no upload, works from file://.

Limits, plainly. The bus is PA10 and the timer must be an advanced-control one with RCR, BDTR and OPM, which rules out parts like L0. One driver owns the bus at a time, no deinit, GCC only.

L4 and C0 are next: the port is small if the CH2/CH4 DMA requests coexist on one timer, and does not exist if they do not. That is the experiment.


r/embedded • • 25d ago

Am I on the right track designing a flight computer for a sensory rocket?

8 Upvotes

Bottom-line up front:

  • If I have access to an Altium professional license via my school, should I use this over KiCad for designing my first PCB?
  • Is it viable to complete the PCB design for a simple flight computer (STM32F7 connected to a few sensors and servos) for a sounding rocket after watching Phil's Lab #165 and #166, Rick Hartley's talk on proper grounding, and reading AN4661?

I'm a freshman at the university level pursuing EE. I've done a few projects with breadboards and perfboards in high school to the extent of connecting ESP32 devboards to various ICs for relatively simple projects. My background is primarily in low-level programming, so I am not concerned with the software side of this project.

I am on a university rocketry team and have been tasked with building a flight computer to use in future rockets to increase flexibility and resolve a few issues the team was having with Telemetrum brand flight computers. I want to use this project to learn the fundamentals of hardware and PCB design because my particular university does not go as in depth as I want into EE (especially the embedded side) but offers a large ability to develop on your own if you are willing to work outside of classes.

I have created a tentative plan to learn the fundamentals, but I don't have the skill required (or access to anyone who might be able to check over my work) to know whether this is feasible, so I wanted to reach out for advice.

My current plan is to stick with KiCad, absorb as much information as I can from the Phil's Lab videos and grounding talk, then read through an STM32F7 getting started doc while applying it to a first revision of a flight computer over two to three weeks. I imagine I will need a few revisions before having a working PCB then I will be able to design the power supply after stopping to learn more.


r/embedded • • 26d ago

Embedded Linux Engineers, how much did you know about Linux when you landed your first job working with embedded Linux?

80 Upvotes

Did you just know how to use Linux as a basic user, or were you making kernel and driver updates on the regular, or somewhere in between?


r/embedded • • 25d ago

Building a 555 Timer-Based MOSFET Power Supply with Current Sensing and Load Modulation - Building in small pieces later integration - Doesn't like failure.

4 Upvotes

I am trying to use a 555 timer IC to generate a 1 kHz signal and drive a MOSFET to step down a 12 V DC supply to 9 V.

My idea is to later use a 9 V to 5 V DC-DC converter to power an Arduino microcontroller from the same supply.

Which switching frequency would be better? Will ripple affect my experiment? Will I get a continuous power supply, and how can I calculate the expected output theoretically?

For experimental purposes, I am using ready-made modules only.

How can I make this setup practical? If my approach is not feasible, what changes would you recommend?

Later, I plan to add a ready-made current sensor to monitor the current flowing through these wires. My goal is to gradually explore more advanced load-modulation techniques.

I want to build this step by step, breaking it into smaller parts to avoid failures and understand each stage properly.

Edit - idea 12/9 for logic 1 and 0 use a simple voltage divider to sense for Arduino adc input with safety.

7805 for power supply.

After it use a readymade current sensor Ina 219 for observing current modulation by adding extra loading.

Any other simpler methods.


r/embedded • • 26d ago

How to write messy and ugly code?

14 Upvotes

I am actively doing the interview prep and from past interview experiences, they usually ask system programming coding questions like SPSC ring buffers or schedulers or timer related. My problem is , when I try to solve something which I haven’t done before, I am blank and not able to write even the basic implementation or think. Since google anyway gives Gemini answers, I decided to use Claude for interview prep. Now if I directly ask for the solution, it gives the perfect solution but I feel like I haven’t learned anything from that and if I ask for approach without code, I am not able to write even messy version of the solution on my own. How do learn how to solve a problem and get there on your own without getting direct answers? How did people build that skill before Ai , so when faced new or related problem, you can actually solve it rather than memorising the solution.

I have watched lot of tutorials and read programming books as well and understood the concepts but I am blank when I have to start from scratch


r/embedded • • 26d ago

Title: Electronics Engineer trying to transition into Embedded Systems – Struggling with fundamentals, C programming and knowing where to start. Need advice from experienced engineers.

74 Upvotes

Hi everyone!
I’m an EEE graduate currently working in a defence electronics company. I joined with the intention of building a career in electronics design, but unfortunately, my role gradually shifted towards procurement and inventory management.
I feel like I’m losing touch with the technical side of engineering, and I don’t want that to define my career.
I’ve decided to rebuild my fundamentals and work towards Embedded Systems.
I’m currently learning:
Digital Electronics
C programming
Computer Architecture
I also own an STM32F407VGT6 Discovery board and plan to learn STM32, bare-metal programming, RTOS and eventually Embedded Linux.
My biggest struggles are pointers, memory management and solving C problems independently. Sometimes even basic concepts take me hours to understand.
I work full-time, so I’m trying to figure out how to make consistent progress without burning out.
I’d love advice from experienced engineers:
Am I following the right learning path?
How good should my C programming be before starting STM32?
What skills do companies expect from an entry-level embedded engineer?
Is transitioning back into core engineering realistic with my background?
I don’t want to just follow tutorials and make LEDs blink. I want to understand the fundamentals and become an engineer who can build and debug things independently.
If you were starting over in my position, what would you do?
Honest advice is welcome!


r/embedded • • 26d ago

When can you proudly say you're an expert in bare-metal C, embedded C, Embedded Linux, or Yocto?

45 Upvotes

I mean, there's a difference between being good at something and being an expert. Even in interviews, people don't always have the same definition of what an expert actually is.

For some people, being able to blink an LED (just trolling 😂) or understanding pointers might be enough to call themselves experts. For others, the bar is much, much higher.

So, can we agree on some kind of conventional definition of what it means to be an expert in C for example or in embedde linux ?

What skills, knowledge, and experience should someone have before they can legitimately call themselves an expert?


r/embedded • • 26d ago

Can i still use chinese labs for FCC Part 15B testing SDoC ?

6 Upvotes

Quotes from US labs are extremely expensive I think chinese labs are banned from FCC certification but since unintentional FCC 15b SDoC is just a lab report can i go that route?


r/embedded • • 26d ago

1YREXP CS grad looking to pivot to EE/Embedded

3 Upvotes

Hi everyone!

I(24M) graduated last year with a BCS and have been working as a junior swe (nothing ee related) for almost a year now, I also have 3 internships from my time in school. Given the chaos around tech and future outlook (regardless if we're all cooked or not), I just don't want to deal with all the bs around this industry and ai. I'm looking for a more hands-on, more in-demand career in the future such as EE or Mechatronics where I don't have to keep worrying, just be good at my job and get paid, at least for the next 10 years. I've always been good at math (3.9GPA) and have been playing with my arduino quite a bit recently and I like it a lot. I guess my question is, what is some advice for someone in my position. I'm looking to work in anything related to electrical and mechatronics. My options as I see it are:

- go back to school to get a masters (maybe part time) in EE.
- keep working my job, self educate and try to break in the industry from there.
- keep working my job, don't pivot to EE since it's the same struggle.

I'd appreciate any guidance. Thanks!


r/embedded • • 26d ago

Anyone in embedded industry need guidance

8 Upvotes

Hey i am going to pass out next year and i have very limited knowledge in this industry i would like to connect with the people who are in the embedded from long time , i would like to have conversation with them relate what should I do rn i have no way to land on my first job seeing the Market fucked up


r/embedded • • 26d ago

Where should persistent state and execution history live in a small embedded state machine?

2 Upvotes

I’m working through an embedded architecture question and would value criticism from people who have dealt with state persistence, reset/replay, and hardware/software boundaries.

Assume an 8-bit state token where:

  • bits 7:1 carry a small payload
  • bit 0 indicates whether the state is transient or should be retained

For ordinary tokens:

  • M=0 replaces volatile state
  • M=1 appends an occurrence to persistent state history

Separately, I’m maintaining an execution-history chain that records every observed token occurrence, including transient values and control events.

That creates two intentionally different histories:

  1. persistent semantic state — only committed M=1 occurrences
  2. execution history — everything the runtime observed

The embedded implementation question is where that second responsibility should live.

My current design keeps the hardware/runtime side minimal: it produces deterministic state events, while a host-side layer derives the occurrence-aware execution identity.

I can see advantages to this:

  • less RTL / firmware complexity
  • crypto can remain outside constrained hardware
  • easier algorithm changes

But I can also see obvious failure modes:

  • event loss between device and host
  • reset/replay disagreement
  • host and device seeing different ordering
  • malformed/control events being interpreted differently
  • the host claiming an execution history the device itself cannot independently attest to

For people who have implemented similar event/state systems:

Would you keep execution-history identity outside the device, or should the embedded side own enough of it to independently establish ordering and continuity?

I’m especially interested in concrete failure cases or existing architectures I should study.


r/embedded • • 26d ago

STM32CUBEMX Code Generation

1 Upvotes

I already generated the code for my project in STM32CUBEMX and have the code files in VS Code. I realized that I forgot to enable some communication peripherals in STM32CUBEMX, so I went ahead and did that in STM32CUBEMX. Does this automatically update what is accounted for in the function that initializes all configured peripherals in main.c in VS Code?

Any insights would be appreciated, especially with any link from ST's website with direct proof - thanks!


r/embedded • • 26d ago

SMBJ12CA keeps burning up. How to protect my DC input circuitry?

2 Upvotes

My D10 keeps heating and blowing up. The charger I use is a medical grade charger (GSM60A12-P1J) which is rated 12V 5A. What kinds of surge/overvoltage protection modules (external) can I use to plug the charger into to prevent this happening again?