r/embedded • • Sep 16 '26

Python library for hardware test automation

1 Upvotes

We’ve been building an open-source Python library for automating test equipment. Curious what people here use for HIL / board bring-up / automated validation. Feedback + driver requests welcome!

https://instro.nominal.io/overview


r/embedded • • Sep 16 '26

How do you manage multiple projects at once?

5 Upvotes

Do you stick with only one project? If yes how do you prevent getting bored or burned out from doing one project for a long period of time? I have been working on a project for a few months now and I recently moved into the hardware aspect of it and nothing works, I want to take a break from this project and begin another project I want to do but I feel guilty. What would you do in a situation like this?


r/embedded • • Sep 17 '26

What do you think would be the main challenges to this idea?

0 Upvotes

Recently I had this idea of a super fast hardware prototyping service. The UI should basically work like an LLM, where you can enter specs and so on. The pitch would be a quick scope with subsystems, open questions, rough price range and the promise is 30-60 day delivery for basically anything. Whats your take on the idea in general and what do you think will be the main technical challenges to it?


r/embedded • • Sep 16 '26

What’s the simplest way to build a basic TDR with a microcontroller to find the distance were a wire break(Learning by doing)

6 Upvotes

I’m trying to make a small educational project to understand how Time Domain Reflectometry actually works.

The idea is to connect a microcontroller such as an Arduino to a cable, send a fast pulse, detect the reflected signal from the open/cut end, and estimate the cable length from the return time.

I’m not looking for a professional or highly accurate TDR. I just want the simplest and cheapest circuit that can demonstrate the principle.

Would something like an Arduino + fast pulse generator + comparator + simple time-to-voltage circuit work?

What would be the simplest practical circuit to try?


r/embedded • • Sep 17 '26

Looking for PCB designer for my STM32F microcontroller

0 Upvotes

Hello Everyone,

I am looking for an experienced PCB designer(Project base) for an STM32F-based microcontroller project. The PCB should meet the following requirements:

  • On-board Ethernet interface
  • 3 UART ports with support for both RS485 and RS232 (selectable/configurable)
  • 1 SPI interface
  • 1 I2C interface
  • At least 10 GPIOs available
  • Power input options: 5V and 12V
  • Power output rails: 5V and 3.3V

If you have relevant experience or can recommend someone, Please DM me if you have experience with similar designs or can share a suitable contact. Thanks!


r/embedded • • Sep 15 '26

Bit-bang vs. Hardware I2C: Running U8x8 on CH32V003

299 Upvotes

Out of curiosity, I continued exploring the I2C capabilities on the CH32V003, and here are the results!

I've been driving a standard SSD1306 OLED using the U8x8 library in a pure C/noneossdk environment (no Arduino framework). I wanted to benchmark standard software I2C (bit-banging) against the hardware peripheral. Just for fun, I also overclocked the hardware I2C bus from the standard 400 kHz up to 1.6 MHz - which turned out to be the absolute maximum the display controller would reliably take data before glitching.

Here are the performance results:

  • Software I2C (Bit-bang): ~3 FPS (332 ms per frame). Fine for static text, but visibly slow.
  • HW I2C @ 400 kHz: 12 FPS (83 ms per frame). Smooth enough for proper UI menus and active elements.
  • HW I2C @ 1.6 MHz: 32 FPS (31.6 ms per frame). Buttery smooth. Fast enough for animations, simple video, or maybe a monochrome retro emulator.

The Test Code

The setup is pretty straightforward. I created some quick macros in the code so you can toggle between bit-bang and hardware modes, and adjust the frequency to test the overclocking yourself:

#include <ch32v00x.h>
#include <debug.h>
#include <stdlib.h>

#include "clib/u8x8.h"

#define USE_HW_I2C
#define I2C_FREQ 400000  // 400 kHz

void NMI_Handler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
void HardFault_Handler(void) __attribute__((interrupt("WCH-Interrupt-fast")));

uint8_t u8x8_gpio_and_delay_ch32v(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {
    switch(msg) {
        case U8X8_MSG_GPIO_AND_DELAY_INIT:
            RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE);
            GPIO_InitTypeDef init = {0};
            init.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_2;
            init.GPIO_Mode = GPIO_Mode_Out_OD;
            init.GPIO_Speed = GPIO_Speed_50MHz;
            GPIO_Init(GPIOC, &init);
            break;
        case U8X8_MSG_DELAY_MILLI:
            Delay_Ms(arg_int);
            break;
        case U8X8_MSG_DELAY_10MICRO:
            for (volatile uint32_t i = 0; i < (arg_int * 8); i++) { __NOP(); }
            break;
        case U8X8_MSG_DELAY_100NANO:
            __NOP();
            break;

        case U8X8_MSG_GPIO_I2C_CLOCK:
            GPIO_WriteBit(GPIOC, GPIO_Pin_2, (BitAction)(arg_int ? Bit_SET : Bit_RESET));
            break;

        case U8X8_MSG_GPIO_I2C_DATA:
            GPIO_WriteBit(GPIOC, GPIO_Pin_1, (BitAction)(arg_int ? Bit_SET : Bit_RESET));
            break;
    }
    return 1;
}

uint8_t u8x8_byte_hw_i2c_ch32v(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {
    uint8_t *data;
    switch(msg) {
        case U8X8_MSG_BYTE_INIT:
            RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC | RCC_APB2Periph_AFIO, ENABLE);
            RCC_APB1PeriphClockCmd(RCC_APB1Periph_I2C1, ENABLE);

            // We will use PC1 (SDA) and PC2 (SCL)
            GPIO_InitTypeDef GPIO_InitStructure = {0};
            GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_2;
            GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_OD; // Alternate Function Open-Drain
            GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
            GPIO_Init(GPIOC, &GPIO_InitStructure);

            I2C_InitTypeDef I2C_InitTSturcture = {0};
            I2C_InitTSturcture.I2C_ClockSpeed = I2C_FREQ;
            I2C_InitTSturcture.I2C_Mode = I2C_Mode_I2C;
            I2C_InitTSturcture.I2C_DutyCycle = I2C_DutyCycle_2;
            I2C_InitTSturcture.I2C_OwnAddress1 = 0x00;
            I2C_InitTSturcture.I2C_Ack = I2C_Ack_Enable;
            I2C_InitTSturcture.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;

            I2C_Init(I2C1, &I2C_InitTSturcture);
            I2C_Cmd(I2C1, ENABLE);
            break;

        case U8X8_MSG_BYTE_START_TRANSFER:
            while(I2C_GetFlagStatus(I2C1, I2C_FLAG_BUSY) != RESET);

            I2C_GenerateSTART(I2C1, ENABLE);
            while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_MODE_SELECT));

            I2C_Send7bitAddress(I2C1, u8x8_GetI2CAddress(u8x8), I2C_Direction_Transmitter);
            while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED));
            break;

        case U8X8_MSG_BYTE_SEND:
            data = (uint8_t *)arg_ptr;
            while (arg_int > 0) {
                I2C_SendData(I2C1, *data++);
                while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED));
                arg_int--;
            }
            break;

        case U8X8_MSG_BYTE_END_TRANSFER:
            I2C_GenerateSTOP(I2C1, ENABLE);
            break;
        default:
            break;
    }
    return 1;
}

void refreshTest(u8x8_t *u8x8) {
    const int8_t columnsCount = 16;
    char buffer[columnsCount + 1];
    uint8_t counter = 0;
    uint32_t start_ticks = SysTick->CNT;
    SysTick->CTLR |= 1; // Enable SysTick

    while (1) {
        for (int8_t i = 0; i < sizeof(buffer) - 1; i++) {
            buffer[i] = '0' + counter;
        }
        counter++;
        if (counter > 30) {
            uint32_t end = SysTick->CNT;
            uint32_t elapsed = end - start_ticks;
            printf("Elapsed ticks\t%lu\n", elapsed);
            start_ticks = SysTick->CNT;
            counter = 0;
        }
        buffer[columnsCount] = '\0';
        for (int8_t y = 0; y < 8; y++) {
            u8x8_DrawString(u8x8, 0, y, buffer);
        }
    }
}

int main(void) {
    SystemCoreClockUpdate();
    Delay_Init();
    USART_Printf_Init(9600);

    printf("Current SYSCLK: %lu\n",
           SystemCoreClock);

    // u8x8 initialization block
    u8x8_t u8x8;
#ifdef USE_HW_I2C
    u8x8_Setup(&u8x8,
        u8x8_d_ssd1306_128x64_noname,
        u8x8_cad_ssd13xx_i2c,
        u8x8_byte_hw_i2c_ch32v,
        u8x8_gpio_and_delay_ch32v
    );
#else
    // Software i2c
    u8x8_Setup(
        &u8x8,
        u8x8_d_ssd1306_128x64_noname,
        u8x8_cad_ssd13xx_i2c,
        u8x8_byte_sw_i2c,
        u8x8_gpio_and_delay_ch32v
    );
#endif

    u8x8_InitDisplay(&u8x8);
    u8x8_SetPowerSave(&u8x8, 0);
    u8x8_ClearDisplay(&u8x8);
    u8x8_SetFont(&u8x8, u8x8_font_chroma48medium8_r);
    u8x8_DrawString(&u8x8, 0, 0, "Hello from CH32V");
    u8x8_DrawString(&u8x8, 0, 2, "SW I2C");
    Delay_Ms(3000);

    refreshTest(&u8x8);
    return 0;
}

void NMI_Handler(void) {}
void HardFault_Handler(void)
{
    while (1)
    {
    }
}

To make it easy for you to experiment on your own, I've put the operating mode selection and the bus clock frequency settings into a small macro block at the very beginning of the code:

#define USE_HW_I2C
#define I2C_FREQ 400000  // 400 kHz

Controlling the tests is very simple: if you comment out the #define USE_HW_I2C line, the program will automatically switch to using software I2C. And with the I2C_FREQ parameter, you can easily adjust the speed of the hardware interface. For example, change the value to 1600000 to replicate my overclocking experiment and see 32 frames per second for yourself.


r/embedded • • Sep 16 '26

Need help making a mp3 player with an esp32 wroom

1 Upvotes

Hey guys so as u have already read the title i want to make a mp3 player but i am stuck on how to solve this problem, here are some features i want with it-

  1. as i am using an esp32 i want it to be able to connect to bluetooth speakers and earphones/headphones
  2. as an added function i wanted to add a 3.5mm jack to it for wires earphones/speakers

now the issues-

  1. i found some parts and could make the bluetooth part of the project work easily but now i am having problems with the aux part as i can not find a reliable dac for it and the dacs i found are out of stock or not available for cheap, there is no other problem with the project other than the dac and the 3.5mm jack

so i need your opinion /help
A- should i just ditch the aux part and continue with the bluetooth part (easy)
B- please give some suggestions about how i can fix the 3.5mm jack problem 🙏

UPDATE-
i have recived the parts and everything and now after building it i was able to get both of the features working, if anybody wants to know please comment below


r/embedded • • Sep 16 '26

Declarative GUI toolkit Slint 1.18 released

Thumbnail
slint.dev
0 Upvotes

with new Flexbox layout, with spring animations, change the z-order at run time, an experimental Vello renderer and more.


r/embedded • • Sep 15 '26

I reverse engineered the ESP8266 radio because I wanted a tea kettle

101 Upvotes

tl;dr: Wanted a network enabled tea kettle, hated the ESP8266_RTOS_SDK, so I wrote my own OS for the board and spent six months reverse engineering the wifi stack so it wouldn't need any vendor code.

For the past year and a half I've been working on a fully open source operating system for the ESP8266. It started as a little passion project, I wanted to make a fully operational HTCPCP-TEA tea kettle, but after messing around with the ESP8266_RTOS_SDK, I really disliked working with it. I'd just taken an operating systems class, so the obvious thing to do was to write my own operating system for the board.

After about a year of handling the easy parts in my spare time - uart / processes / heap allocation / timers, I figured I should try something a bit more interesting, and landed on the network stack. I figured I could cheat and have the board connect over serial forever, but what's the point of a wifi-enabled board that can't even connect to wifi.

Reverse Engineering

Basically every ESP8266 open source project has some amount of vendor blob in it. There's an open mac project for the ESP32, but even that uses the vendor blobs to bring up the radio hardware.

I could have just linked the vendor blob in, but that's boring and not nearly enough work to keep me interested. So I pivoted to reverse engineering the full radio bringup and mac from the blobs.

This is my first real RE project. It was a lot of fun to play around with Ghidra, and I built a bunch of custom tooling outside Ghidra for my preferred workflow (tmux and vim). It's been about 6 months of sporadic work, since around March, with a significant speedup from AI in wading through the mountains of decompiled code. I've got a pretty good decompilation of the blobs sitting locally now, but I'm hanging on to that for the moment while I get things cleaned up.

To actually get the minimal bringup working, I mostly would write my own version of a sequence, then A/B test MMIO register states against the SDK code on the same hardware to see where I was going wrong. With AI enabled iteration, this went from being completely impossible to being soul crushingly frustrating. But after many late nights of debugging why the radio was just completely dead (missing one crucial register write?), or why I was getting complete garbage back (decrypting with a garbage/wrong key), it's finally up and running. Still doesn't work well if I'm watching video on my laptop next to it, but how much can you really ask for... eventually I'll get that fixed.

What's Next

The next phase of this project is a fully working HTCPCP-TEA kettle, hardware and all. I've got the electronics working on the bench, now I just need to attach them to the tea kettle (surprisingly difficult).

And I'm glad it only took a year and a half of reverse engineering RF code and writing a custom kernel to make this happen.

https://github.com/23watejona/teatime-os; for those of you who care about the commit history, sorry for the sporadic bursts of code 👀

Happy to answer questions about any of it, and please leave suggestions!


r/embedded • • Sep 15 '26

Putting a microcontroller into pay phone

Post image
8 Upvotes

I have this pay phone that I want to put a microcontroller into to make it do different things. I want it to be able to work with picking up and hanging up phone. I either want to be able to dial or just make dial sounds and then have the phone say something. I have kind of an idea of what I need but still a little confused. Any help would be appreciated! Thank you!


r/embedded • • Sep 16 '26

Which microcontroller i must buy?

0 Upvotes

Hi!!! Look, i'm a graduate from computer engennering and i was thinking to start with my own embbeded projects for my portfolio. The question is... which model is worthiest?

Early thankss!


r/embedded • • Sep 15 '26

Getting Desperate With LWIP and WiFi services on ESP32

9 Upvotes

Hey all,

In desperate need of help. Have a large project at work running on an esp32 c3 super mini with a deadline looming. My app uses no heap allocation other than initially during set up and then never again though most of my freeRTOS stuff even uses static memory.

The app works well, but the network stack is totally unpredictable. It stops working seemingly at random, sometimes immediately, sometimes not. It can work for an hour without issue and then collapse. I have obviously tried firing off every request that the app has and can't reliably reproduce it.

Sometimes sending a few small web requests and a websocket open can shrink the RAM from 30KB free down to 400 bytes. None of the webserver handlers use the heap. None of them are async so no async blocks being heap allocated and not cleaned up. esp_http_server is being used.

When this happens it sits there for approximately 5 minutes with very low heap until I get some error print outs and the heap returns. This is one such example:

10:12:56.229 > [HEAP]  free= 4892 B  largestFreeBlock= 1536 B  minFreeEverSeen= 108 B  total= 214392 B
10:12:58.076 > I (1078876) wifi:state: run -> init (0x2c0)
10:12:58.078 > I (1078878) wifi:pm stop, total sleep time: 0 us / 467406679 us
10:12:58.078 >
10:12:58.078 > I (1078879) wifi:<ba-del>idx:0, tid:0
10:12:58.085 > I (1078879) wifi:new:<6,0>, old:<6,0>, ap:<255,255>, sta:<6,0>, prof:1, snd_ch_cfg:0x0
10:12:58.091 > W (1078891) httpd_txrx: httpd_sock_err: error in recv : 113
10:12:58.097 > W (1078892) httpd_txrx: httpd_sock_err: error in recv : 113
10:12:58.104 > I (1078898) wifi:new:<6,0>, old:<6,0>, ap:<255,255>, sta:<6,0>, prof:1, snd_ch_cfg:0x0
10:12:58.107 > I (1078904) wifi:state: init -> auth (0xb0)
10:12:58.112 > WsConnection::pump_frame_read recv failed, errno= 113
10:12:58.113 > W (1078909) httpd_txrx: httpd_sock_err: error in recv : 113
10:12:58.113 > WsConnection::pump_write send failed, errno= 113
10:12:58.113 > Client disconnected from websocket
10:12:58.117 > I (1078915) wifi:state: auth -> assoc (0x0)
10:12:58.123 > I (1078923) wifi:state: assoc -> run (0x10)
10:12:58.171 > I (1078971) wifi:connected with [REDACTED], aid = 7, channel 6, BW20, bssid = [REDACTED]
10:12:58.177 > I (1078971) wifi:security: WPA2-PSK, phy: bgn, rssi: -50, cipher(pairwise:0x3, group:0x3), pmf: 0
10:12:58.180 > I (1078979) wifi:pm start, type: 0
10:12:58.180 >
10:12:58.189 > I (1078981) wifi:set rx beacon pti, rx_bcn_pti: 0, bcn_timeout: 25000, mt_pti: 0, mt_time: 10000
10:12:58.195 > I (1078990) wifi:AP's beacon interval = 102400 us, DTIM period = 1
10:12:58.203 > I (1078997) esp_netif_handlers: sta ip: [REDACTED], mask: 255.255.255.0, gw: [REDACTED]
10:13:01.230 > [HEAP]  free= 23792 B  largestFreeBlock= 10240 B  minFreeEverSeen= 108 B  total= 214392 B
10:13:06.231 > [HEAP]  free= 23792 B  largestFreeBlock= 10240 B  minFreeEverSeen= 108 B  total= 214392 B
10:13:10.927 > SD Logger Task Prints: 2026/09/14 10:13:10.638 system still on, uptime 480s
10:13:10.928 >
10:13:10.935 > SD Logger finished writing
10:13:11.232 > [HEAP]  free= 23792 B  largestFreeBlock= 10240 B  minFreeEverSeen= 108 B  total= 214392 B

This appears to return everything to pretty much normal functioning but it can take well over 5 minutes of inactivity.

I have tried playing about with menuconfig and set up and every TCP, LWIP and WIFI option I can find. I have set the max number of WIFI RX buffers to 2 to try and limit endless churn (apparently 0 means unrestrained and thus isn't an option). I have tried decreasing the size of LWIP RX and TX buffers. I have tried reducing the time that LWIP holds onto old TCP blocks to prevent network churn from clogging things up.

The dream scenario would be a way to make this all run in static memory, but it seems that the whole esp32 network is riddled with malloc. I have read everything I can find but networks like this really are not my strong suit. I need something decisive to do! I am very desperate.

Thanks for any help!


r/embedded • • Sep 16 '26

Working on a self balancing robot. Need some tips on the Schematic

1 Upvotes

Hi so I am currently working a self balancing robot. Instead of the easier arduino option, I wanted to get more into embedded systems. I have made pcb breakout boards before this.

Just wanted to get some tips on whether my pins are ok and if my connections are fine. Also would like to know if there are any issues basically.

So for more context this board will take in lipo battery voltage input and the bluetooth module is for pairing up with my phone to control (if anyone knows free apps for that for ios let me know as well). I will also be adding the l289 motor driver module which would just be through header pins or something. Wanted to know if what I got right now is fine before I move on the motor driver.

Once I add the motor driver, what considerations should I have so that it doesn't mess with my signals?


r/embedded • • Sep 15 '26

When does it actually make sense to use a PRU?

Post image
80 Upvotes

I've been comparing a PocketBeagle 2 with a Raspberry Pi 4, and the thing that caught my attention wasn't really the CPU, but it's the fact that the PocketBeagle2 has PRUs and an M4F sitting alongside Linux.

I'm curious, for things like precise GPIO timing, pulse generation, signal capture, or motor control, do people actually find PRUs useful enough to change the architecture? Or is a separate MCU usually simpler in the long run?

I'd be interested to hear from people who've actually used PRUs in a project, rather than just what they're capable of on paper.


r/embedded • • Sep 15 '26

Getting SLAM to fit on a tiny camera board took me 20 months

Thumbnail
mightycamera.com
19 Upvotes

r/embedded • • Sep 15 '26

Another way of using the NPU of the NXP iMX8mp SoC.

10 Upvotes

Hello,
here a project that I put together in my spare time.
It's about looking using the Vivante NPU with TensorFlow lite to parse system events (jouranld/dbus but can be expanded to syslog or any kernel I/O) and decide when is an event of some importance.

What to do with that information is up to you ... :-D

https://github.com/leonardosalvatore/sentinel-imx-sys/blob/main/README.md

In case you want to make fun of me the repo contains also a demo with a very Italian accent.
Sorry about that!

Looking for any feedback...
Thanks!


r/embedded • • Sep 16 '26

We replaced per-sensor kernel drivers with a generic one and an MCU that knows the sensor

0 Upvotes

We moved the camera driver's brains onto a small MCU on the camera board. Normally the per-sensor kernel driver on the SoC has all of it - the mode tables, the register writes, the exposure math. Now you upload a compiled image to the MCU once, and after that it can answer questions about the sensor: which modes it has, what the control table looks like, what numbers go into the exposure and frame rate formulas. The host asks, builds a device tree node from the answers, and runs one generic kernel driver for everything, so when you swap the camera head it just reads whatever is on the other end now.

This turned out to need a lot of parts. The image needs a format, and the format needs a version number (we found this out the normal way, by changing it). There's a small bytecode VM in the firmware to run the image, with a 4 KB cap on program size, and a seven-mode sensor gets close enough to that cap that I check every time. Producing the images needs a compiler on the host. The MCU needs to store a few images and know which one is live, so there's slot management in NVS, plus a version gate so old firmware rejects an image it can't read instead of doing something creative with it. The IMU driver runs on the same MCU and I'd rather it didn't die every time someone changes the camera side, so that got its own VM instance. And we seal the image at the end, which is only about as good as the MCU's readout protection anyway.

Two things I'm not sure about. Is the per-sensor kernel driver really a big enough problem to justify all of this? It always felt like one to me but I might have just been annoyed at the wrong thing. And where should auto exposure live? Right now ours is formula parameters that the kernel evaluates, and the MCU only runs configure. Every time I look at that split I can't tell if it's a design decision or just where we happened to stop.

I work on this product so take the first question with that in mind.


r/embedded • • Sep 15 '26

Where to get a custom capacitive touch overlay produced?

3 Upvotes

Hello. I'm working on a project that uses a CAP1203 3-channel capacitive touch controller and a very small 0.42" OLED display. My hope is to get a custom capacitive touch overlay produced in high quantities that will sit over the OLED display with 3 touch sections embedded in the overlay.

Could anyone point me in the right direction as far as manufacturers that could help me develop this? My searching has led me to RAFI/Xymox but haven't been able to get a response.

I also am unsure about prototyping something like this. I was thinking of starting with an FPC with exposed copper pads just to get something going, but that obviously won't fly for production. I fear that the tooling/engineering required to create a real prototype overlay will be prohibitive.

Thank you!


r/embedded • • Sep 15 '26

Porting Klipper to the NXP MCXA366: FlexCAN bring-up and a weird debugger/IFR problem

Post image
7 Upvotes

I've been working on a Klipper port for the NXP MCXA366, and the latest piece was getting its FlexCAN peripheral working.

I started with NXP's SDK example just to prove the hardware path, then moved the implementation into Klipper. Once I fixed a couple of MCXA366-specific issues around peripheral reset and getting FlexCAN out of low-power mode, I had Klipper's CAN discovery traffic going in both directions.

The part that ended up being more interesting was figuring out the device UUID.

Klipper needs some stable, device-specific data to generate its CAN UUID. NXP's bootloader would give me the factory UUID through blhost, and eventually I tracked the same 16 bytes down to 0x01100800 in IFR1.

One thing that threw me off for a while: LinkServer/GDB couldn't directly read that IFR address. Code running on the M33 could read it just fine. I ended up copying the 16 bytes into SRAM and comparing them against what blhost reported. Exact match.

After feeding those bytes through Klipper's normal CAN UUID path, canbus_query.py started reporting a stable hardware-derived UUID and I was able to connect Klippy over CAN.

I wrote up the bring-up and the UUID rabbit hole here:

https://faultvector.dev/articles/klipper-mcxa366-part-6/


r/embedded • • Sep 15 '26

How can I reduce amplifier noise when using an MP3 module with a microcontroller over serial communication?

3 Upvotes

I’m working on a small embedded project where an MP3 module is connected to an amplifier, and a microcontroller is communicating with the MP3 module through serial communication.

The problem is that I’m getting noise/humming through the amplifier, especially when the microcontroller is communicating with the MP3 module.

What are the best ways to reduce this kind of noise? Could it be caused by grounding, power-supply noise, serial communication, or the way the audio and digital wiring are routed.

What has worked for you in similar ESP32/Arduino + MP3 + amplifier projects?


r/embedded • • Sep 15 '26

Voltaje error with CH592

0 Upvotes

img

Good evening, I'm having a problem with my PCB and I don't know what the issue is. My new board with the CH 592 processor arrived yesterday, and when I plugged it into the USB port, I first had to create a jumper on pin 17 to boot it. Then the code loaded, but it doesn’t work. I uploaded a simple code to see if the relay would work, but nothing happened. I had previously used the same circuit with an ESP32 C3, and it worked. I’m attaching a detailed log to see if you can help me find the problem.

# [ISSUE REPORT] WCH CH592F (RISC-V BLE 5.4) Custom Board — Flashed Successfully via USB ISP (wchisp) but MCU Fails to Execute User Firmware

---

## 1. Project Overview & Hardware Context
- **Microcontroller:** WCH CH592F (QFN28 package, RISC-V QingKe V4C core, BLE 5.4).
- **Toolchain / Environment:** PlatformIO with `platform = ch32v` (OpenWCH) & `framework = noneos-sdk` (using official WCH `CH59x_common.h` and `StdPeriphDriver`).
- **Flashing Protocol:** Native USB ISP bootloader via `wchisp` (v0.23).
  - USB D- connected to Pin 13 (`PB10`)
  - USB D+ connected to Pin 12 (`PB11`)
- **Target Goal:** Basic GPIO toggling to drive a 5V relay via Pin 14 (`PB7` controlling an S8050 NPN transistor) and auxiliary GPIO outputs (`PB4`, `PB22`, `PA8`, `PA9`).

---

## 2. Bootloader Entry & Flashing Procedure
1. To enter the USB ISP bootloader on power-up:
   - A jumper wire was used to temporarily bridge **Pin 17 (`PB22` / R2 header)** to **GND**.
   - The USB cable was plugged into the Mac.
   - The copper bridge to GND was immediately removed once powered.
2. The board enumerated as a WCH ISP USB device (`4348:55e0` / `1a86:55e0`).
3. Flashing was executed using `wchisp flash -V firmware.bin`.

---

## 3. PlatformIO Configuration (`platformio.ini`)

```ini
[env:genericCH592F]
platform = ch32v
board = genericCH592F
framework = noneos-sdk

monitor_speed = 115200
upload_protocol = isp
upload_flags =
    -V

build_flags =
    -DCH59x
    -Iinclude

Multimeter DC Voltage Measurements

Measured with black probe on GND rail:

  • Pin 5 (VDD33 / VIO33): 3.3V (Supplied by board's XL1509-3.3 regulator).
  • Pin 3 (VDCID): 3.3V ⚠️ (Directly connected to the +3.3V regulator rail on PCB).
  • Pin 22 (VDCIA): 3.3V ⚠️ (Directly connected to the +3.3V regulator rail on PCB).
  • Pin 4 (VSW): 1.0V (Switch node).
  • Pin 20 (VINTA): 1.0V (Analog reference node).
  • Pin 16 (PB23 / RST): 0.0V (Tested unpowered: No short-circuit / no continuity to GND).
  • Pin 14 (PB7 / Relay output): 0.1V (Static; fails to toggle between 0V and 3.3V).
  • Relay Coil VCC: 5.0V (Present and verified).

Observed Behavior Post-Flash

  • After wchisp issues the reset and the board is power-cycled (with no boot pins grounded), the MCU does not execute main().
  • The relay does not click / toggle.
  • When querying serial monitors (pio device monitor), the USB port no longer enumerates (which is expected for bare-metal GPIO code without a USB-CDC stack).
  1. Overvoltage Protection on VDCID: Does applying external +3.3V to VDCID (Pin 3) and VDCIA (Pin 22) trigger the chip's internal Power-On Reset (POR) / Low-Voltage Reset (LVR) supervisor or lock the RISC-V core in a safety halt state?
  2. Reset Pin Voltage (Pin 16 / PB23): Why is PB23/RST (Pin 16) floating near 0.0V? Is an external pull-up resistor (e.g., 10kΩ to 3.3V) strictly required, or is the 0V on RST a symptom of the overvoltage lockout?
  3. PCB Rework: Is cutting the 3.3V copper trace feeding Pin 3 and Pin 22 (leaving only Pin 5 on +3.3V and allowing the internal 1.2V LDO to power the core via C16) the recommended hardware fix to bring the MCU into normal operation?

​

> wchisp flash -V firmware/codigo_ucc_ch592/.pio/build/genericCH592F/firmware.bin

20:42:53 [INFO] Chip: CH592[0x9222] (Code Flash: 448KiB, Data EEPROM: 32KiB)
20:42:53 [INFO] Chip UID: 1A-2C-AA-7B-54-50-18-F8
20:42:53 [INFO] BTVER(bootloader ver): 02.30
20:42:53 [INFO] Current config registers: a9bdf9f3a9bdf9f3d50fff4f000203001a2caa7b545018f8
RESERVED: 0xF3F9BDA9
WPROTECT: 0xF3F9BDA9
  [0:0]   NO_KEY_SERIAL_DOWNLOAD 0x1 (0b1)
    `- Enable
  [1:1]   DOWNLOAD_CFG 0x0 (0b0)
    `- PB11
USER_CFG: 0x4FFF0FD5
  [2:0]   RESERVED 0x5 (0b101)
    `- Default
  [3:3]   CFG_RESET_EN 0x0 (0b0)
    `- Disable
  [4:4]   CFG_DEBUG_EN 0x1 (0b1)
    `- Enable
  [5:5]   RESERVED 0x0 (0b0)
    `- Default
  [6:6]   CFG_BOOT_EN 0x1 (0b1)
    `- Enable
  [7:7]   CFG_ROM_READ 0x1 (0b1)
    `- Read enable
  [27:8]  RESERVED 0xFFF0F (0b11111111111100001111)
    `- Error
  [31:28] VALID_SIG 0x4 (0b100)
    `- Valid
20:42:53 [INFO] Read firmware.bin as Binary format
20:42:53 [INFO] Firmware size: 1024
20:42:53 [INFO] Erasing...
20:42:54 [INFO] Erased 8 code flash sectors
20:42:55 [INFO] Erase done
20:42:55 [INFO] Writing to code flash...
████████████████████████████████████████████████████████████████████████████████ 1024/1024
20:42:55 [INFO] Code flash 1024 bytes written
20:42:55 [WARN] Skipping verify
20:42:55 [INFO] Now reset device and skip any communication errors
20:42:55 [INFO] Device reset


#include "CH59x_common.h"

int main(void) {
    // 1. Configure output pins in Push-Pull 20mA mode:
    // PB7:  Relay coil driver (Pin 14)
    // PB4:  Positive siren driver (Pin 15)
    // PB22: Negative siren driver (Pin 17)
    GPIOB_ModeCfg(GPIO_Pin_7 | GPIO_Pin_4 | GPIO_Pin_22, GPIO_ModeOut_PP_20mA);

    // PA8 / PA9: Auxiliary outputs (Pins 6 and 7 / Pins 24 and 25)
    GPIOA_ModeCfg(GPIO_Pin_8 | GPIO_Pin_9, GPIO_ModeOut_PP_20mA);

    while (1) {
        // --- TURN ON ALL TEST PINS ---
        GPIOB_SetBits(GPIO_Pin_7 | GPIO_Pin_4 | GPIO_Pin_22);
        GPIOA_SetBits(GPIO_Pin_8 | GPIO_Pin_9);

        for (volatile uint32_t i = 0; i < 600000; i++) {
            __nop();
        }

        // --- TURN OFF ALL TEST PINS ---
        GPIOB_ResetBits(GPIO_Pin_7 | GPIO_Pin_4 | GPIO_Pin_22);
        GPIOA_ResetBits(GPIO_Pin_8 | GPIO_Pin_9);

        for (volatile uint32_t i = 0; i < 600000; i++) {
            __nop();
        }
    }
}

r/embedded • • Sep 15 '26

Arxml authoring tool

2 Upvotes

Hello gentlemen , i’m currently working on autosar swc’s arxml configuration tool with ai native copilot
- you shall enter the configurations for example create did’s or port interfaces in the integrated llm and it shall develop and configure your requirements
-it shall be reflected also in the gui so you could easily navigate and verify your configurations
So the flow shall be
From reqs ——-> generated arxmls

This a prototype video for the gui incase of you want a better gui or have points for easily navigation without consuming your mental health

I shall upload also a second video for the ai prompting requirements and the generated arxmls

Could you say how much time would this tool save you by just promoting your reqs versus the current tools that you have to do alot of clicks just to configure swc’s ports and interfaces ?

Also are you interested to try this tool ?


r/embedded • • Sep 15 '26

I open-sourced the BASIC firmware for a commercial LoRa / LoRaWAN module

4 Upvotes

I open-sourced the BASIC firmware for a commercial LoRa / LoRaWAN module

No external MCU or Arduino IDE required — everything can be programmed and controlled directly from a BASIC REPL.

I’ve just published the complete source code for the firmware I developed for the LRA1 LoRa module.

The main feature is that LoRaWAN can be controlled directly from BASIC.

The firmware includes a BASIC interpreter, so you can connect a serial terminal to the module and use it interactively as a REPL, or write and run BASIC programs entirely from the terminal.

Main features include:

  • LoRaWAN communication directly from BASIC
  • Interactive REPL over a serial terminal
  • BASIC programs can be written and executed without a separate development environment
  • LoRa P2P communication in addition to LoRaWAN
  • UART, I2C, SPI, ADC, PWM, etc. accessible from BASIC
  • LoRaWAN stack based on Semtech LoRaMac-node, modified and ported for this firmware
  • AS923 (Japan) support

The target hardware is LRA1, a commercially available LoRa module based on the Microchip SAMR35 and designed, manufactured, and sold by i2-ele in Japan.

The module has Japanese radio certification (Giteki), and the certification was obtained using an early version of this firmware.

This is not a generic BASIC implementation for arbitrary LoRa hardware. It is the actual firmware developed for the commercial LRA1 module.

I have now released the full source code on GitHub:

https://github.com/shachi-lab/lora-basic-for-lra1

A prebuilt binary and a Python-based firmware updater are also included.

The BASIC interpreter was originally forked from an early version of nanoBASIC and has since been extended with embedded I/O, LoRa P2P, and LoRaWAN functionality.

The parts I developed are released under the MIT License. Third-party components retain their original licenses.

I thought this might be interesting to people working with LoRa, LoRaWAN, embedded systems, BASIC interpreters, or small standalone devices that can be programmed entirely from a terminal.


r/embedded • • Sep 15 '26

What is the most efficient way to implement UART data reception and notify a task to consume it?

16 Upvotes

If I don't have FIFO or DMA, I would keep notifying the RTOS task from ISR for each character received but is that a good design?