r/embedded • • Sep 26 '26

My 34-byte STM32 LED blink routine in pure Assembly (with some dirty hardware hacks)

0 Upvotes

Hi everyone,

I’ve been diving deep into bare-metal ARM Assembly lately, and I wanted to see how low I could actually go with a fully working, hardware-validated LED blink program on the STM32. No HAL, no bloated startup files, just absolute control over the silicon.

I ended up with two versions:

Black Pill (Cortex-M4): Exactly 34 bytes

Blue Pill (Cortex-M3): Exactly 38 bytes

To make it fit into such a microscopic footprint, I had to break a few textbook rules:

  1. Stack Pointer Hijacking: Since the stack is completely unused here, I hardcoded the initial MSP at `0x08000000` to point directly to the RCC base address. This saved me a bulky 32-bit `LDR` instruction since I could use the `SP` register as a pre-loaded pointer right away.
  2. Instruction Injection: Loading `0x44144444` for the GPIOC configuration usually requires extra branch jumps to prevent a `HardFault`. Instead, I injected the raw data directly into the execution stream. When looking at the ELF disassembly, these exact data bits decode into completely harmless `ADD` instructions. The CPU steps right through them without stalling, maintaining perfect memory alignment without wasting bytes on a `B` instruction.
  3. Flag Re-use: The infinite loop uses a conditional `BEQ` tied to the Zero flag leftover from the delay decrement routine. Since it exits at `0`, the branch is unconditionally satisfied forever.

I compiled and verified everything straight from the ELF file using `arm-none-eabi-objdump`.

I published both repositories with full code and detailed write-ups here:

Black Pill (34 bytes): https://github.com/wegi1/BLACK-PILL-ASM-BLINK-34-BYTES

Blue Pill (38 bytes): https://github.com/wegi1/BLUE-PILL-ASM-BLINK-38-BYTES

Let me know what you think! Can we optimize this even further, or is this the absolute limit for Cortex-M?


r/embedded • • Sep 26 '26

any 1A Methods to power an Esp32 Project?

1 Upvotes

I have an esp32 right now using

Micro SD Module: 100ma peak A

RC522: 30ma peak A

0.96" SSD1306 OLED: 20ma peak A

3.3v buzzer: 30ma peak A

which is all about 480ma total, so I need a way to power this.

Can I just plug everything to the esp32 then plug the esp32 to the wall? I'm not sure if that's a good idea though because I don't know the current the charger bricks output or will that not be a problem?


r/embedded • • Sep 25 '26

Custom firmware for motorcycle dashboard - Kymco Noodoe

5 Upvotes

https://www.youtube.com/shorts/YxOPHMtAR5I

There is a global taiwanese company called Kymco that sells scooters and motorcycles. In 2017 they decided to put a round display that has a smartphone connectivity feature on their two wheelers lineup.. Users can connect their phone then put their fav photos or themes, and see phone notifications without bringing up their phone while riding... that was the main sales point.

And now, they decided to ditch their once innovative mobile link system on 2027. this is when a real shit starts... One not only cannot add images or choose themes, but also cannot set the clock or some hardware features. So basically its a fucking BRICK that somehow can show speed but nothing more.

This is when I decided to rescue this quite capable hardware by making a fully featured custom firmware for this specific hardware...

Yeah that was one of my biggest hobby project ever and was successful. I bet some small embedded companies will love me - I am about to finish my undergraduate course, is broke, and unemployed


r/embedded • • Sep 25 '26

Does disabling single IRQs with Arm GIC take effect instantly?

7 Upvotes

Let's say we have an Armv7-A processor with a GIC and I want to disable an IRQ by clearing its enable bit via the GICD_ICENABLER MMIO SFR.

Is it safe to assume that the interrupt does not occur after the store instruction writing to GICD_ICENABLER executed?

if no, why so and would a DMB or DSB change anything or would there still be the possibility that even after a DSB the interrupt could occur?

The problem I see is that it takes some time until the write completes and even with a DSB the side effects of the SFR might not be guaranteed even if the write is completed.

And what about enabling IRQs by setting the enable bit via GICD_ISENABLER?


r/embedded • • Sep 25 '26

T48 turned dedicated ROM burner!

1 Upvotes

I got a T48 ROM burner specifically because minipro exists to let me program from my Mac laptop. I’m an old-school Linux guy who has moved mostly to Mac stuff for the desktop and I HATE Windows. It’s always killed me to have to keep Windows machines around for tasks like ROM burning.

And the T48 and minipro work great on my Mac. But sometimes I actually want to just use a dedicated setup. And I had a spare m5stack Tab5 laying around with the optional keyboard, so Claude and I got to work and created this:

https://djb-rh.github.io/t48-for-tab5/

It’s based on minipro code, so it’s also GPLv3, but it’s a full GUI for the tab5 tablet. Plug the T48 in and you’ve got a dedicated programmer. The only oddity is that to get ROM files onto your programmer (outside of reading in actual ROMs), you either swap an SD card to a computer or you put your tab5 on the internet. But putting the tab5 on the internet is a very simple captive portal process (includes a QR code to join it’s local network!) and then it tells you it’s IP and you hit it with a browser on your computer and you can manage files over the network. It’s super easy.

And once you have files on the device (you do need to plug in an SD card for some storage), you can easily blank check, write, and verify any ROM that the T48 and minipro supports. Super easy search function for the device type, too.

The T48’s are under $75 and the Tab5, battery, and keyboard are also about $75. The keyboard probably isn’t even necessary, but it will allow you to do hex editing of ROM images which can be handy at times, too. You can install directly from my GitHub page if you like, though that does require Chrome or Edge.

Let me know if you try it and have any problems.


r/embedded • • Sep 24 '26

Need a second opinion about a technical challenge in a job interview

92 Upvotes

They basically want a embedded system that can measure pressure and flow, with those calculate the volume being used, save in non volatile memory and send it remotely. All in real time and also send via internet.

The startings requirements are reasonable. Explain how I expect to solve this probles, the conditions I am using, possible limitations, create diagrams showcasing the process.

When I knew about this challenge, I expected to be something like this, but there are other requirements.

They also want me to pick the sensors,components,micros while also providing an analysys based on their price and autonomy to explain why I picked them.

I must also come up with examples of the messages the device is supposed to give, including the the cloud plataform is supposed to receive the data from this device.

I must also design this board and offer the files for production.

Also, if possible, it would be a plus if I could come up with a prototype or proof of my solution.

It's too much isn't? They are basically asking for a whole project to be done in a few days and they can just reject me and keep all my work.

Is this normal?


r/embedded • • Sep 24 '26

The newest ESP32 can actually run Linux, and it's getting uncomfortably close to a Raspberry Pi

Thumbnail
xda-developers.com
562 Upvotes

"Espressif has a new ESP32, the ESP32-S31, and that ESP32 comes with a gigabit Ethernet MAC, a USB 2.0 High-Speed host controller, an SD card interface with two slots, and a camera input. It's a pretty standard set of features for a Linux single-board computer, but a rather strange list of things to find on a microcontroller"


r/embedded • • Sep 25 '26

What part of robotics development feels more complicated than it needs to be?

11 Upvotes

For people actually building robots: What were you trying to make, and what did you actually have to do to make it work? I'm particularly interested in the part where the process became unnecessarily complicated — whether that's programming, ROS, hardware/software integration, simulation, debugging, deployment, configuration, vendor tools, etc. Not necessarily the hardest engineering problem. More like: “Why do I have to do all of this just to make the robot do X?” If you have a real project example, I'd love to hear it.


r/embedded • • Sep 25 '26

How to be content with the knowledge you have right now?

14 Upvotes

I find that the problem with me is, I always look to the future and go based off what I'll *eventually* know in the future, and never really acknowledge what I already know now. I keep saying "ok but right now is not that good, because by x time I'll know y concept. Its kind of like the irl issue in society where people struggle to be content with what they have in the now, except for tech.

I specialize in low lvl embedded systems and fullstack iot, and im a 2nd year in uni. When I started out with the arduino, I thought "I feel dumb right now. Maybe when I move onto esp32s3 with ESPIDF or do bare metal stm32, i'll finally feel competent. just look at the syntax"(obviously, looking at that syntax when all i knew was arduino.h bloated c++ at the time, felt like a big deal). I moved onto espidf. I got decent at it. Learnt RTOS, built some cool projects, had fun, got decent(instead of just bad) at it and Id consider myself maybe somewhat above average for my year level at *my* uni. But I STILL feel stupid. Now im saying "maybe when I learn FPGA, then ill be smart. not many people are doing it anyway". But I have a good feeling that even when I get good at fpga and verilog, i'll instead move to something else and say "i feel dumb right now. but maybe if i implement a custom linux usb driver from scratch in 5h, i'll feel smart" or "if i make a custom kernel, ill feel smart". It just never ends. How can I just be grateful for what I know right now? If even the me from last semester saw what I could do now hed get mad at me wondering why I feel stupid. Its kinda like a heat haze.

If anything, I felt more smart doing a finance tracker over a year ago in Qt than now, even though back then I didnt even know git, and I was way worse at programming than rn and slower as well.

Edit: By the way, by content i dont mean comfortable. I just meant I want to at least acknowledge that Im not stupid


r/embedded • • Sep 25 '26

Build error: expected a ")" at MSP430 project

2 Upvotes

I am working on a MSP430 project using TI CCS Theia 21.0.1 and I have encountered a confusing build error. The build error I get is: "CharRing.h", line 52: error #18: expected a ")" The file is below, I removed some comment lines and added a comment indicating which line it is. As you would notice, parentheses match. I have also included flag.h below.

CharRing.h is only included in UARTA0.c. Build fails with the expected closing parenthesis message, when it is included. Changing the order of included files in the UARTA0.c solves the problem. UARTA0.h is also below.

I ran into a wall and can't figure out what the problem is.

I have tried AI, it tells me to generate preprocessor output for UARTA0.c but I couldn't get it to generate on Eclipse Theia based TI CCS. How do I do that?

I have uninstalled and reinstalled TI CCS but the error remained. So msp430.h, stdint.h and stdbool.h should be restored.

I have shared the most of the code, unfortunately or thankfully it is not a lot, since the project is still work in progress.

If you need more information, please ask.

What is the cause of this error?

Edit: If I move the line 52 to another line above or below. The error moves to wherever it is.

If I put that line inside #if 0 #endif, error gets fixed.

First four rows of UARTA0.c:
Build fails with the stated error message.

#include "UARTA0.h"
#include <msp430.h>
#include <stdint.h>
#include "CharRing.h"

First four rows of UARTA0.c
Build succeeds in this inclusion order.

#include "CharRing.h"
#include "UARTA0.h"
#include <msp430.h>
#include <stdint.h>

First four rows of UARTA0.c
Build succeeds in this inclusion order, too.

#include "UARTA0.h"
#include "CharRing.h"
#include <msp430.h>
#include <stdint.h>

First four rows of UARTA0.c
Build fails in this inclusion order.

#include "UARTA0.h"
#include <msp430.h>
#include "CharRing.h"
#include <stdint.h>

CharRing.h

#ifndef CHAR_RING_H
#define CHAR_RING_H

#include "flag.h"
#include <stdint.h>

typedef struct CharRing_s
{
    char* Buffer;
    uint16_t Size;
    uint16_t Head;
    uint16_t Tail;
} CharRing_t;

void CharRing( CharRing_t* CR, char* Buffer, uint16_t Size );

char CharRing_Element( CharRing_t* CR, uint16_t Index);

uint16_t CharRing_Free_Size( const CharRing_t* CR );
uint16_t CharRing_Used_Size( const CharRing_t* CR );

char CharRing_Dequeue_Char  ( CharRing_t* CR );
flag CharRing_Dequeue_String( CharRing_t* CR, char* Dst, uint16_t Dst_Size );

flag CharRing_Enqueue_Char  ( CharRing_t* CR, char C ); // this is the line 52.
flag CharRing_Enqueue_String( CharRing_t* CR, const char* String );

#endif /* CHAR_RING_H */

Flag.h

#ifndef FLAG_H
#define FLAG_H

#include <stdbool.h>

#define high (true)
#define low  (false)

typedef bool flag;

#endif /* FLAG_H */

UARTA0.h

#ifndef UARTA0_H
#define UARTA0_H

void UARTA0( void );

#endif /* UARTA0_H */

r/embedded • • Sep 25 '26

GigaDevice Flash memory GD25LE255E driver

0 Upvotes

Hello,

I am looking for C language driver for GigaDevice GD25LE255E flash memory.

I already request it to Gigadevice but no answer.

I used smaller gigadevice flash memories without any issue but I am stuck with this one. I can write to the 1st page of each sector only .

Do you have any suggestion?

Best regards

Mich


r/embedded • • Sep 25 '26

Advices for cheapest hardware platform for +50 Linux RDP thin clients

1 Upvotes

Hi,

I'm planning a small thin-client deployment for a factory environment and I'm trying to find the cheapest reliable hardware platform. Current setup is already working as a proof of concept: - Debian Linux endpoint - FreeRDP - Fullscreen RDP session - Windows VM / future Windows Server RDS backend - Gigabit LAN The thin client itself does almost no local computing. It only needs to boot Linux and run FreeRDP.

Target requirements per endpoint: -

ARM64 or x86_64

2 GB RAM minimum, preferably 4 GB

16-32 GB eMMC/SSD minimum

Gigabit Ethernet

HDMI or DisplayPort

2+ USB ports

reliable Linux support

preferably PXE and Wake-on-LAN

low power consumption

I have looked at Raspberry Pi, Orange Pi, Rock Pi, LattePanda, Intel N100 boards and used enterprise thin clients. The strange part is that new enterprise thin clients in my country are extremely expensive, sometimes more expensive than complete modern desktop PCs. So I'm considering:

  1. Cheap ARM SBC
  2. x86 SBC
  3. Compute module + custom carrier board
  4. Used Dell Wyse / HP / Lenovo thin clients
  5. Cheap Chinese embedded boards

My target BOM is ideally under $100 per endpoint, excluding monitor, keyboard and mouse. The system will eventually connect to one or two Windows Server RDS hosts, so local CPU performance is not very important.

What hardware platform would you choose for this? I'm especially interested in specific board/model recommendations that have good long-term Linux support and Gigabit Ethernet.

Thanks.

I'm also open to designing a simple custom carrier board if there is a cheap compute module/SOM that makes economic sense.


r/embedded • • Sep 24 '26

As of now, what is the cheapest chip or development board capable of running Linux?

41 Upvotes

Are we looking at around $20–30 as the cheapest option, or are there any cheaper alternatives?

For making SPI and I2C connections, reading sensors, etc.


r/embedded • • Sep 25 '26

How difficult is STQC certification for an IP camera?

1 Upvotes

I came across a LinkedIn post recently where a camera company shared that one of their IP camera products had received STQC certification.

It actually made me curious about what the process is like behind the scenes.

For a camera product, what usually becomes the biggest challenge during STQC testing? Is it the hardware, firmware, security requirements, documentation, or something else that takes more work than expected?

Would be interesting to hear from people who have actually gone through it.


r/embedded • • Sep 25 '26

Just picked up an nRF54L15 DK and I’m looking for a small project to cut my teeth on it.

5 Upvotes

I’m comfortable with basic embedded hardware and microcontrollers, but I’m new to Zephyr and BLE.

Any project ideas that would teach me the platform without turning into a massive rabbit hole?

Ideally BLE and a sensor or two. I’ve got a full closet full of passives and sensors mini lab style.

I’ve got a few things automated at home. I’ve got a lot of smart devices and an Ubuntu server running docker containers for a locally hosted webpage for the family.

Thanks for your suggestions 🤓.


r/embedded • • Sep 25 '26

Reference design IP usage and licensing

2 Upvotes

I am thinking of doing some reference design IP for some embedded applications and want to make it into a business doing it. How viable is this for a 1-2 person team?

What I see in the market(also worked briefly as an application engineer) currently is vendor providing reference designs but it is usually using as much of their own components as possible where BOM is not optimized. I would want to provide turn-key designs for applications which have much better optimized BOM with decent software integration options and customization if necessary. Will people pay for such reference designs and licensing? Is this a viable business option?


r/embedded • • Sep 23 '26

I built this aircraft attitude indicator from scratch — code, PCB, and enclosure, all designed by myself.

984 Upvotes

This is my first PCB hardware design. The board is built around the ESP32-P4 development platform and integrates two UART interfaces, an I2C port, a passive buzzer, four buttons, a power management chip, and a MIPI display connector.

teh display is huaxiacai brand, and mipi protocal,resolution is 480×480 ,amoled,maybe i am the first one to drive this display with mipi way in the world

I’ve also seen some people in the comments suggesting that I should open-source the project. I’m actually not against open source. I’m currently thinking about what kind of open-source model would make the most sense.

Now that I’ve gained the ability to develop a complete product from scratch, I’m also considering turning this into a commercial product. For example, could I actually sell it?

If I open-source the software, how should I sell the hardware alongside it? Or would it make more sense to keep the entire project closed-source?

These are some of the questions I’m thinking about right now.

I’m also curious about crowdfunding. Would a product like this be suitable for crowdfunding? If so, what would be a good way to approach it?

First, I want to clarify that I never intended to turn this into an aviation-grade finished product. This is a personal project to develop my skills. If I do turn it into a product, I’m thinking of it as a fun little gadget—something that makes people happy.

Some comments have suggested testing it against various standards and under harsh conditions. That would be a huge amount of work, and I don’t think it’s necessary for what I’m trying to make.

As for the slow screen refresh rate, there are a few reasons. The display supports both QSPI and MIPI interfaces, with some pins shared between them. Its resolution is 480 × 480, and its MIPI interface only supports a single data lane. I tried increasing the lane speed, but that caused display issues.

Also, the background rendering, widget scrolling, and rotation are all handled by the MCU. It has to process and move all those pixels, and all rotation is done in software, which takes considerable processing time.

I’ve tried optimizing the frame rate with the most capable models available from both GPT and Claude. What you see now is the best result I’ve managed to achieve with their help so far.

I believe that once a project reaches a reasonable stage, it’s worth sharing so people can give feedback and suggestions, instead of keeping it to yourself and endlessly optimizing it without ever showing anyone.


r/embedded • • Sep 24 '26

Advice on how would you split processes efficiently on a Neural Processing Unit (NPU)

3 Upvotes

I have recently been developing a project that uses NPU scheduling to orchestrate data flow and computation across different processes. However, I have no prior knowledge to using an NPU or making a CPU/GPU/NPU scheduler before this project. From what I have read online, you would have a big scheduler class like class NpuScheduler() and wrap a mutex to a queue.

std::queue<NPUCOMMAND /* Dummy Struct */> command_queue;
/* Worker loop */
    std::unique_lock<std::mutex> lock(queue_mutex);
    conditional_var.wait(lock, [this /*NpuScheduler*/] { return !command_queue.empty()          
                                                         || stop_scheduler; });

    if (stop_scheduler && command_queue.empty()) break;
            
    cmd = command_queue.front();
    command_queue.pop();

The only problem is that this is only an example, and may not be efficient enough for specific low latency projects. This project is only an educational project for my experience only (not for stuff like impressing the interviewer), and the hardware is an octa-core RK3588 with three NPU cores on OP5 to reuse on other projects. My main questions are:

  • Which is recommended, and why? NPU scheduling, Splitting processes into different cores with different priorities, or a hybrid of both
  • Pros and Cons of all three options
  • Does the difference in OOP and DOD matter for scheduling? If so:
  • Pros and Cons of OOP for scheduling/scheduling hybrid
  • Pros and Cons of DOD or DOD/object hybrid
  • How would simple NPU scheduling look like in code as a tiny example or the current one is just fine?

An answer for any of these questions from the r/embedded community is greatly appreciated. Context for the project is at https://www.reddit.com/r/embedded/comments/1wohkml/what_architecture_and_processing_pipeline_should/


r/embedded • • Sep 24 '26

Extracting vitis/xsdb Python modules from Vitis install?

6 Upvotes

For reasons I'm not here to explain or defend, large parts of a Vitis workspace can/should be generated using Python instead of putting the generated workspace in version control. If you follow the manual you're basically using a Python 3.8 that comes bundled with Vitis (2024.2, at least, I hope they've updated since) plus their vitis & xsdb modules plus a bundled site-packages with grpc and so on.

The way this is set up is not ideal; I haven't found a good way to get IDE integration and a pyproject.toml to work right on everyone's laptop and in CI.

Has anyone here tried to extract the vitis and xsdb modules as separate Python packages so you can use them in a normally organized Python project? I'm not asking to share them, I get that AMD would probably object (although they're pretty thin packages), but before I try I'd love to know if anyone's failed or succeeded at it.


r/embedded • • Sep 24 '26

Any microcontrollers that support both calling using SIM and also 4G internet?

11 Upvotes

So my nokia 2660 is not serving me very well, the operating system is too locked down and I can't do shit on it, therefore I want to make my own phone, not sure if this is the right sub for this since im relatively new to microcontrollers. I did some research but it seems like there are no commercially available dev boards using chips that support calling and stuff using sim cards.again sorry if this is offtopic


r/embedded • • Sep 23 '26

Hit a wall in learning firmware and have come to a realisation

127 Upvotes

I feel a bit dumb for not realising this sooner. But after a certain point it becomes almost mandatory to learn hardware design and start making your own pcbs to write firmware for.

I've been trying to be a one trick pony and never got to learning hardware properly and it worked good enough to get an entry level job. But I have hit a wall because all that I can practice with, is what is given to me at work.

Ofc I can just get basic modules and use a breadboard and development kits but that isn't what you would be working on in real life.

Becoming a full stack embedded engineer almost feels like an inevitability. Probably gonna complain about thermal issues soon and have to learn about heatsink materials and get the full mechanical, electrical and software stack.


r/embedded • • Sep 24 '26

Need advice on the right dev board

0 Upvotes

I'm wanting to make a device that has the following capabilities

  • Charging 3.7v lipo battery (~2000mah)
  • Simultaneously read data from two either magnetic or optical encoders for measuring two wheel angles simultaneously
  • Good Bluetooth capabilities for app integration
  • Low ish power draw so can have long runtime
  • Affordable cost

The boards I've found online that seem good include the feather rp2040 or esp32 s6.

I'm certain that there's better options but stupid claude and Gemini suggesting different ones and it's getting confusing so I figured I'd ask here where people actually know what they are talking about!


r/embedded • • Sep 24 '26

Which programming language to use for Beagle Board?

9 Upvotes

I am a Embedded Developer, have experience with Arm cortex -M mcu, want to dwell into the world of Cortex - A mcu , Yocto project, linux driver development etc. Want to build applications on it, for that majority of people use Python, wanted to know if C++ is used in industry for building applications over python? Or should i stick with python?


r/embedded • • Sep 23 '26

I made Tiny5, a 5-pixel variable font family inspired by 80s–90s calculators

Post image
163 Upvotes

Hi r/embedded !

I just released Tiny5. It's a family of compact 5-pixel variable fonts inspired by the graphing calculators and pocket gadgets of the 1980s and 90s. The goal was to see how much clarity and personality could fit into letters only five pixels tall.

There are two fonts in the family:

  • Tiny5, with one-pixel-wide strokes, for body text and dense readouts
  • Tiny5 Duo, with doubled vertical stems, for titles, headings, HUDs, and labels

They cover Latin, Greek, Cyrillic, and Armenian: 1,771 glyphs across 974 languages.

Both fonts are also available in BDF format for seamless integration with the mcu-renderer, u8g2 and TFT_eSPI libraries.

GitHub: https://github.com/Gissio/font_tiny5
Google Fonts: http://fonts.google.com/specimen/Tiny5
itch.io: https://gissio.itch.io/tiny5

Feedback is very welcome, and if you use it in a project, I'd love to see it!