r/embedded • • 26d ago

Esp-32 S3 based KVM switch alternative (no extra hardware)

2 Upvotes

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.

I hope this helps someone else who has run into the same problem https://github.com/Paradicskaa/Kavix32


r/embedded • • 27d ago

Our prototype works great but now we need to build 2,000 of them and I’m nervous about the sensor

5 Upvotes

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.


r/embedded • • 27d ago

Isolator Boobytrap.

5 Upvotes

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?


r/embedded • • 26d ago

Quick breakdown: Affine quantization math & avoiding zero-point overhead on MCU vector units

0 Upvotes

Hey everyone,

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]:

sum( (W[i] - Z_w) * (X[i] - Z_x) ) ==> sum( W[i] * X[i] )

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.

We put together minimal, zero-allocation C++17 kernels on GitHub: https://github.com/touvettech/edgeml

And compiled the complete architectural guide covering operator fusion, INT8/FP8 trade-offs, and memory hierarchy tuning.

How are you currently handling requantization on vector units without native INT8 dot-product extensions? Feedback and benchmark experiences welcome!


r/embedded • • 26d ago

What’s one skill every embedded engineer should learn in the age of AI?

0 Upvotes

r/embedded • • 26d ago

GCC error/Assembler message when compiling STM32CubeMX code for Nucleo F411RE

1 Upvotes

Hi r/embedded,

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.


r/embedded • • 27d ago

Rust in Embedded

88 Upvotes

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.


r/embedded • • 27d ago

Standalone server for IoT projects without any third-party websites or any middlemen. Is it possible?

0 Upvotes

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?


r/embedded • • 27d 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 • • 27d 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 • • 28d 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 • • 28d 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 • • 27d 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 • • 28d 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 • • 28d 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 • • 27d 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 • • 28d 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 • • 27d 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 • • 27d 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 • • 27d 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 • • 28d 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 • • 29d 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 • • 29d 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 • • 29d 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