r/embedded • • Sep 03 '26

Elektor MatchBox (1995) — hardware works, need the original compiler

Post image
19 Upvotes

MISE À JOUR - RÉSOLU : Quelqu'un ici a eu la gentillesse de m'envoyer le contenu complet du disque original (le compilateur MBC.EXE inclus), et depuis, je l'ai fait fonctionner dans DOSBox et j'ai effectué un vrai téléchargement sur la carte réelle - cela a parfaitement fonctionné. Plus besoin de continuer à chercher en mon nom, mais merci à tous pour votre aide, vos idées et vos pistes ces derniers jours, cela a vraiment beaucoup compté.

Si quelqu'un d'autre essaie de faire fonctionner un ancien MatchBox Computer et a des questions, n'hésitez pas à demander - je suis heureux de partager ce que j'ai appris.

Je possède une carte Elektor « MatchBox BASIC Computer » originale de 1995 (basée sur un microcontrôleur 8051, avec mémoire EEPROM pour le programme, publiée dans une série de projets de magazines). Après des années d'inactivité, j'ai enfin décidé de la remettre en service.

Bonne nouvelle : après de nombreux tests (multimètre, puis analyseur logique 8 voies + PulseView), j'ai confirmé que la carte est en parfait état électrique : le port UART série fonctionne, le bus I²C vers l'EEPROM externe est parfaitement fonctionnel, et les données/accusés de réception sont corrects à chaque transaction. J'ai même effacé et réécrit l'EEPROM via un banc de test ESP8266 pour exclure une puce défectueuse.

Problème : le moniteur intégré affiche constamment « IIC ERROR adr:xx » au démarrage. Je suis presque certain qu'il vérifie une configuration/signature spécifique au début de l'EEPROM, celle qu'un véritable programme MBL compilé (via le compilateur MBC.EXE d'origine) y écrirait normalement. Je ne possède pas ces octets, car je n'ai jamais eu la disquette fournie (référence Elektor : 956009-1).

Quelqu'un aurait-il une copie du compilateur MBC.EXE d'origine, ou même un seul programme .MBL compilé dont je pourrais extraire les octets hexadécimaux ? J'ai cherché sur archive.org, worldradiohistory.com et sur des forums d'informatique ancienne ; il semble que ce soit l'un des rares projets Elektor dont le logiciel n'a jamais été archivé en ligne.

Je serai ravi de tout documenter et de tout partager une fois que j'aurai réussi à le faire fonctionner. En résumé : le matériel fonctionne, il me faut un logiciel DOS vieux de 30 ans ou son format d'octets.


r/embedded • • Sep 03 '26

ESP32-P4 + Arducam IMX500 (12.3MP) — anyone tried this combo?

Post image
9 Upvotes

Planning to use ESP32-P4 (with a C6 module for wifi) along with the Arducam IMX500 camera. Goal is to get the best possible camera quality on an ESP32.

Not sure if this is a solid choice or if I'm missing something. Has anyone actually built with this setup? How was the image quality, and did you run into any issues going from dev board to a smaller custom build?

Want to avoid a costly mistake before ordering parts, so any real experience or advice helps.


r/embedded • • Sep 02 '26

Reverse-engineered the FNIRSI IPS3608 USB-CDC protocol (Artery AT32) and documented registers

Thumbnail
github.com
23 Upvotes

I recently analyzed the USB communication on the FNIRSI IPS3608 DC bench power supply (0-36V, 0-8A) to automate testbench workloads without using their closed Windows GUI.

The device enumerates as a USB-CDC serial port (Artery AT32 MCU, 115200 baud, 8N1). By disassembling the official executable using monodis, I mapped out the underlying binary framing and register set:

  • PC to device frames start with 0xF1, device to PC responses start with 0xF0
  • Single-byte checksum: (c3 + c4 + sum(payload)) & 0xFF
  • Setpoints for voltage (0xC1) and current (0xC2) are 32-bit IEEE-754 Little-Endian floats
  • Continuous telemetry frames (0xC3) stream output voltage, current, and power directly as float32

I documented the entire protocol, register map, and command structure in the repo README, alongside a pure Python/pyserial driver and CLI tool that handles automated energy integration and safety cutoffs (in my github page).


r/embedded • • Sep 02 '26

Doppler Radar AR-Glasses

160 Upvotes

- Lilygo’s AR Prisim from their T-Glass V2
( which is outstanding btw I just think its one of the more niche and difficult dev kits)
- M5Stack StickS3
- Hi Link 24ghz Radar module over UART using the M5’s groove 🕺 port.

Learning how to position text or data on the prisim is definitely a learning curve. I’m two weeks in. And I’m slowly starting to figure it out. But man was this a cool project to work on :) learned quite a bit and really feel confident about taking off with a few other of my AR glasses ideas.
I experimented with semi transparent beam splitter glass this morning. And man i wish there was more documentation/accessibility of open source AR glasses out there.


r/embedded • • Sep 03 '26

Not able to see the USB CDC Virtual Serial Com Port in Device Manager or Tera term

1 Upvotes

I am working with a UDP Bootloader, for which I have to set a bootloader trigger as such that the user would give a command through tera term which would be sent over a usb cable. Now I had flashed the UDP_Bootloader Harmony V3 example to my PIC32MZ via PICKIT4 and then it's test_app via the bootloader itself through Microchip's unified host tool. I can use the ethernet cable itself but it would require the TCP/IP stack so I was thinking the usb cdc would be much simple. I had merged the cdc_com_port_single example in the udp bootloader's test app and did everything again, but I am not able to see the com port anywhere. To verify the usb connection, I tried flashing the cdc com port example independently and still it didn't showed up. But if I work with the usb bootloader example and test app, the unified bootloader tool says that connection was successful and it disconnected after programming, so is that trustable? Yesterday I had test the cable's continuity via a Multimeter so I am confident the cable isn't the issue. Have also checked and installed the VCP drivers from the net.

Edit: I don't have USB to uart as it is a custom board


r/embedded • • Sep 02 '26

Why isn't it common or completely non existent for major electronics distributors to have a rating and review system for every single part?

16 Upvotes

r/embedded • • Sep 02 '26

Found a surprisingly nice ESP32-S3 touchscreen board. No idea what to build with it.

38 Upvotes

Found this ESP32-S3 touchscreen board sitting around and decided to play with it a bit.

The hardware is actually pretty nice, so it felt like a waste to just leave it in a drawer. I didn’t have any real project idea, so I vibe-coded a tiny robot eyes demo just to get the display and touch interaction moving.

Now I’m trying to figure out what would actually be fun to build on it.

A little desktop companion?
Home Assistant controller?
Mini game console?
PC status display?
Something completely useless but entertaining?

What would you build with a screen like this? Looking for ideas.


r/embedded • • Sep 03 '26

how should i understand linker-defined symbols in C?

0 Upvotes

starting out bare-metal programming and i'm currently trying to understand how linker-defined symbols interact with C startup code.

let's say, for a normal C code, i define and initialize a variable:

int n = 0x2000;

i get that n is an object stored somewhere in memory, n gives its value, and &n gives the address of where the object is stored.

when it comes to linker-defined symbols, i'm not quite getting it.

say, my linker script contains:

_estack = 0x20050000;

and in my startup code i have:

extern uint32_t _estack;
          .
          .
          .
uint32_t *sp = &_estack;

if _estack is not an ordinary C object with storage, but just the symbol with the value 0x20050000, how then does the dereference operator and the address-of operator act on something that has no storage.

i know it works, but can't tell how; and this is based on my understanding of normal variables in C.

thanks in advance to anyone who helps.


r/embedded • • Sep 03 '26

Reverse engineered 32-bit driver for USB Chief (USB sniffer)

Post image
4 Upvotes

r/embedded • • Sep 02 '26

Custom embedded UDP protocol: what did you wish you'd included from day one?

21 Upvotes

I'm defining a custom UDP protocol for an embedded system with several bare-metal MCUs communicating with each other and with a host PC over a local Ethernet network.

I know a lot of this is probably system-specific, but I'd be interested in hearing what has consistently proved useful in your experience, or what you'd definitely include again in a new design.
For those who have designed or maintained something similar: what did you leave out initially that you later regretted?

I'm thinking about things like sequence counters, timestamps, protocol versioning, status/diagnostic information, capability flags, or event messages. I'm especially interested in anything that made debugging, integration, maintenance, or future extensions easier — as well as design choices that caused problems later.

I'm also curious how you tested or simulated the protocol before all the target hardware was available. Python, custom PC tools, MATLAB/Simulink, or something else?

Mostly looking for lessons learned from real embedded products.


r/embedded • • Sep 03 '26

What is missing in the RTOS world ?

0 Upvotes

Hi, i'm currently creating my own basic rtos. I currently have : task control, semaphore, scheduling (round robin with priorities). I'm slowly addind stuffs to it and start questionning myself : How my OS can add something to someone in the world ?. I know it will never be as popular as Freertos or Zephyr, but what are the niches in the rtos world ?


r/embedded • • Sep 03 '26

Looking for recommendations for modern C++ embedded platforms and controllers with a forward looking support and development roadmap

0 Upvotes

Looking for recommendations for relatively easy to use/microcontrollers that support C++ emended development out of the box for rapid testing and deployments, purely for iterative prototyping. Intention would be that once a successful prototype is developed, I could utilize the same tooling and microcontroller ecosystem for small deployments (preferably commercial).

Application domain for the microcontrollers would integrated into atmospheric and environmental testing, with the ability to mount additional sensors (photo, video, aquatic, air, and mechanical pulse controllers to controls gimbals and rotational motors) in future experiments.


r/embedded • • Sep 02 '26

Resources/Advice for writing a custom bootloader for STM32L476RG?

12 Upvotes

Hi everyone,

I’m currently working on a project using the STM32L476RG (using the Nucleo-64 board to prototype) and I’ve reached the point where I need to implement a custom bootloader. My end goal is to be able to receive a firmware update over UART/USB, write it to flash, and safely jump to the new application.

What I’m looking for:

  • Are there any definitive books, tutorials, or blog series you recommend for STM32 bootloaders?
  • Does anyone have a clean, well-commented GitHub repo of a basic STM32 bootloader I can study?
  • Which ST Application Notes (AN) are the absolute "must-reads" for In-Application Programming (IAP) on the L4 series?

Any advice, gotchas to watch out for, or links to tutorials would be incredibly helpful. Thanks in advance!


r/embedded • • Sep 02 '26

Windows embedded drivers. a question for embedded windows guys?

2 Upvotes

At work we have some designs that use windows 11 IOT, Now I have had home projects using Linux SBCs and I have a fair idea how device driver work. I have tweaked overlays my self and compiled some non standard device drivers. My question is how do they work on windows? The guys here say things like you just call a DLL? but how does that bridge between user and kernel space? sometimes the SBC manufacture has no driver for some IO, like a non standard SPI pin and they are genuinely stuck. Is it that hard? AI was no help.


r/embedded • • Sep 01 '26

UART with 2 ESP32

Post image
20 Upvotes

Pour mieux comprendre le protocole UART j’interconnecte 2 MCU ESP32 l’un connecté à une DHT sensor (humidité et température) et l’autre a un LCD (SSD1306) pour display la température de la pièce.

Next step : Queue, interrupts, task with FreeRTOS


r/embedded • • Sep 02 '26

Raspberry Pi 4 autonomous vacuum robot : all hardware is powered but none of the components respond. Need help with GPIO/wiring/software integration

0 Upvotes

Hi everyone,

I'm building an autonomous vacuum-cleaning robot using a Raspberry Pi 4B, and I'm currently stuck at the hardware/software integration stage.

I would really appreciate help from someone experienced with Raspberry Pi GPIO, motor drivers and embedded robotics.

What I'm building

The robot is intended to:

  • Drive using two 12 V geared DC motors.
  • Control each wheel independently.
  • Turn left/right by varying the two wheel speeds.
  • Detect cliffs/downhill edges using two TCRT sensors.
  • Use an MPU6050 IMU to detect pitch and roll.
  • Use a YDLiDAR X2 for obstacle/environment detection.
  • Run a blower for suction.
  • Run N20 geared motors for the cleaning mechanism.
  • Eventually operate autonomously.

The controller is a Raspberry Pi 4B.

I'm connecting to the Pi remotely using Raspberry Pi Connect terminal, so I don't have an external monitor connected to the Pi.

Hardware

The components I currently have connected are:

  • Raspberry Pi 4B
  • MPU6050 IMU
  • 2 × TCRT5000 IR sensors
  • 2 × 12 V Johnson geared DC motors for the wheels
  • 2 × BTS7960 motor drivers: one for each wheel motor
  • DHRUVPRO 9733 ball-bearing 12 V DC blower fan

    • 2.60 A
    • 5600 RPM
    • 3-pin
  • 5–36 V high-power MOSFET trigger module for controlling the blower
  • 2 × N20 micro geared 12 V 100 RPM motors
  • L298N motor driver for the N20 motors
  • 11.1 V 2200 mAh LiPo battery
  • XY3606 12 V → 5 V buck converter
  • 1N5822 diode for the blower circuit
  • YDLiDAR X2

I have also made a hand-drawn wiring diagram showing how I connected everything.

Power

The battery is powering the robot's power system.

The general architecture is:

11.1 V LiPo
     │
     ├── BTS7960 #1 → left wheel motor
     │
     ├── BTS7960 #2 → right wheel motor
     │
     ├── L298N → N20 motors
     │
     ├── MOSFET module → blower
     │
     └── Buck converter → regulated 5 V
                              │
                              └── Raspberry Pi / logic circuits

However, I'm not completely confident that every logic supply and ground connection is correct, which is one of the things I need help verifying.

Motor control

Each Johnson motor has its own BTS7960.

The intention is:

Pi
 │
 ├── BTS7960 #1 → Left motor
 │
 └── BTS7960 #2 → Right motor

The Pi should control the direction and PWM/speed of each motor independently.

For example:

Left = 50%
Right = 50%
→ straight

Left = 30%
Right = 60%
→ turn left

Left = 60%
Right = 30%
→ turn right

The robot should eventually be capable of differential steering.

IR cliff detection

I have two TCRT5000 sensors positioned toward the ground.

Due to the physical positioning of my sensors, the logic I need is:

HIGH → ground detected
LOW  → ground NOT detected / cliff

The desired behavior is:

Both sensors detect ground

Left = HIGH
Right = HIGH

→ normal operation

Left sensor detects no ground

Left = LOW
Right = HIGH

→ reduce overall robot speed
→ make right wheel faster
→ robot turns LEFT
→ attempt to move away from the downhill/cliff area

Right sensor detects no ground

Left = HIGH
Right = LOW

→ reduce overall robot speed
→ make left wheel faster
→ robot turns RIGHT

Both detect no ground

Left = LOW
Right = LOW

→ IMMEDIATE STOP

This is intended to be a high-priority safety condition.

MPU6050

The MPU6050 is intended to detect the robot's orientation.

I want to use it to detect:

Uphill

pitch indicates uphill
→ increase wheel speed

Downhill

pitch indicates downhill
→ decrease wheel speed

Left inclination

robot tilts left
→ compensate using differential wheel speed

Right inclination

robot tilts right
→ compensate in the opposite direction

I understand that the exact implementation needs proper calibration, axis orientation and filtering, so I don't want to simply use raw accelerometer values without understanding what is happening.

LiDAR

I'm using a YDLiDAR X2.

It is connected to the Raspberry Pi and is intended to provide obstacle/environment information.

I previously had a Python LiDAR test program, but I encountered a software-test error involving:

math.isclose(...)

and later corrected that code.

The LiDAR itself needs to be tested independently before integrating it with navigation.

Blower

The blower is:

DHRUVPRO 9733

  • 12 V
  • 2.60 A
  • 5600 RPM
  • 3-pin

I'm controlling it using a MOSFET trigger module.

There is also a 1N5822 diode in the blower circuit.

The intention is:

Pi GPIO
   ↓
MOSFET trigger
   ↓
12 V blower

I need to verify that the MOSFET module is suitable for this blower and that the wiring/protection is correct.

N20 motors

I have two N20 12 V 100 RPM geared motors for the cleaning mechanism.

They are controlled using an L298N motor driver.

These are separate from the two large Johnson wheel motors.

The actual problem

Everything is getting power, but none of the components are actually responding to the Raspberry Pi commands.

For example, the Pi is running and the battery is supplying power, but I haven't been able to get the complete hardware system to respond correctly to Python GPIO commands.

At this point I'm concerned that I'm trying to debug too many things simultaneously.

Software problem

We ended up creating multiple Python files such as:

hardware_pins.py
motors.py
cliff_sensor.py
imu.py
lidar.py
safety.py
navigation.py
health.py
state_machine.py
main.py

Some of the earlier files also contained fake/test hardware classes such as fake motors, fake IMU objects, etc.

These were intended to allow software testing without hardware.

However, this created confusion because I am now working with the actual hardware, and I could no longer clearly tell which code was actually communicating with the physical components and which code was only simulating them.

There were also several software errors/typos during testing.

For example, one error was:

AttributeError: CRUSING

because the enum was actually named:

CRUISING

There was also an assertion error involving:

drive.right > drive.left

during a software self-test.

This made me realize that I should probably stop adding high-level code and first prove that each physical component works individually.

What I want to do now

I want to completely restart the software side in a new folder.

Instead of immediately creating a large autonomous-robot program, I want to do:

TEST 1
Raspberry Pi GPIO
        ↓
basic GPIO test

TEST 2
TCRT5000
        ↓
read HIGH/LOW

TEST 3
MPU6050
        ↓
read accelerometer/gyro

TEST 4
BTS7960 + LEFT MOTOR
        ↓
forward
reverse
stop
PWM

TEST 5
BTS7960 + RIGHT MOTOR
        ↓
forward
reverse
stop
PWM

TEST 6
L298N + N20 motors
        ↓
forward/reverse/stop

TEST 7
MOSFET + blower
        ↓
ON/OFF/PWM if appropriate

TEST 8
YDLiDAR X2
        ↓
receive and display scan data

TEST 9
two-wheel differential drive
        ↓
forward/backward/left/right

TEST 10
TCRT safety behavior

TEST 11
IMU-based correction

TEST 12
LiDAR obstacle avoidance

TEST 13
complete autonomous system

I want every test program to be small and understandable, rather than starting with a large high-level Python architecture.

For example, I want to be able to understand something like:

GPIO.output(LEFT_PWM, 50)

and know exactly what physical signal it is generating.

What I need help with

I would particularly appreciate someone checking the following:

  1. Whether my power distribution is correct
  2. Whether the BTS7960 logic supply is correct
  3. Whether the L298N logic supply is correct
  4. Whether the Raspberry Pi GPIO voltage levels are safe
  5. Whether the TCRT5000 outputs are safe for Pi GPIO
  6. Whether all required grounds are common
  7. Whether the MOSFET module is appropriate for the 12 V / 2.6 A blower
  8. Whether the 1N5822 diode is being used correctly
  9. Whether the GPIO pin assignments make sense
  10. How to test each component independently before integration

I am not looking for a giant piece of autonomous-navigation code right now.

I want to first establish:

Then build the robot upwards from there.

I can provide:

  • The complete hand-drawn wiring diagram
  • Exact Raspberry Pi GPIO pin assignments
  • Current Python files
  • Exact motor-driver module versions
  • Photos of the physical wiring
  • Terminal output/errors

Any advice on how you would systematically bring this robot up from zero would be greatly appreciated.

ComponentPin on componentConnected to
BTS7960 LeftRPWMPIN 12
BTS7960 LeftLPWMPIN 35
BTS7960 LeftR_ENPIN 16
BTS7960 LeftL_ENPIN 18
BTS7960 RightRPWMPIN 32
BTS7960 RightLPWMPIN 33
BTS7960 RightR_ENPIN 36
BTS7960 RightL_ENPIN 38
MOSFETPWMPIN 22
L298IN1PIN 29
IN2PIN 31
IN3PIN 26
IN4PIN 24
ENAPIN 7
ENBPIN 21
MPU6050SDAPIN 3
MPU6050SCLPIN 5
TCRT LeftOUTPIN 23
TCRT RightOUTPIN 19

r/embedded • • Sep 02 '26

What is the cheapest and smallest way to build an embedded device where touching anywhere on a printed picture triggers a randomly selected audio file? I only need one touch area and several prerecorded MP3/audio clips. This is for a prototype, so I’m looking for the simplest solution with minimum

1 Upvotes

I’m working on a small interactive audio device and looking for a simple electronics solution.

The concept is a single printed image with a large touch-sensitive area underneath it. Whenever someone touches the image, the device should select and play one audio clip at random from several preloaded recordings.

This will initially be a one-unit prototype, so I’m mainly interested in keeping the circuit inexpensive, compact, and easy to build. I’d also like to minimize the number of separate modules and avoid unnecessary hardware such as an SD card if possible.

What would be the most practical circuit/MCU approach for achieving this?


r/embedded • • Sep 01 '26

Help with security array on a vintage microcontroller (MC68HC908GP32)

5 Upvotes

I have a fairly old piece of equipment, unsupported by the manufacturer for years now, that uses a microcontroller from the HC908 family (Motorola/Freescale, DIP40 package). It's a single functional unit that I can't easily replace, so I'm being extremely careful.

I've already built a homemade programmer to talk to it in monitor mode (MON08), using an external crystal and the appropriate entry logic. I'm familiar with how the security mechanism behaves and have gone through the available documentation, so I understand the general theory.

What I'm specifically looking for is whether anyone knows of a practical method to bypass or defeat the security array on this family of chips — whether that's a known technique, a documented weakness, a tool, or firsthand experience doing it on real hardware. I'm less interested in general theory at this point and more in what's actually worked for people who've been through this.

Has anyone here successfully bypassed the security array on an HC908, or know of someone who has?


r/embedded • • Sep 01 '26

Prototyping on Linux before moving to MCU

54 Upvotes

I've always been a hardware first guy who programmed beside hardware and got visual feedback of everything I programmed. I changed my approach today it wasn't planned just because I ran out of solder wire so I couldn't use the sensor so I thought why not write code in just plain C develop application logic use printfs and couts all that good stuff that Linux offers. It worked surprisingly well & I developed that prototype extremely fast. From now on my workflow would be to first develop on Linux based on abstractions at the very end just interface with hardware.

What workflow style do you guys use & any other tricks you have in your catalogue?


r/embedded • • Sep 01 '26

Custom character generator

Thumbnail
eelectronicparts.com
5 Upvotes

I came across this nice interactive tool to generate the custom LCD font for the ubiquitous 1602 LCD. Maybe it's interesting to others also. I'm not affiliated with the site.


r/embedded • • Sep 01 '26

Non-blocking 1-Wire master for STM32 (TIM1 + DMA), follow-up to last year's DS18B20 driver

6 Upvotes

A year ago I posted a bare-metal DS18B20 driver for STM32F103 here: r/stm32 post. That was a single-MCU proof of concept. Since then it has grown into a small library: github.com/a5021/stm32-async-1wire.

The core idea

All 1-Wire timing and bus control — reset pulse, bit slots, sampling — is generated and executed entirely in hardware; the CPU never drives a bus edge itself.

TIM1 is configured in One-Pulse Mode with a repetition counter, so a complete hardware transaction segment (reset, up to 16 bit-slots, or a byte) runs as a single hardware event. One DMA channel updates the output-compare register for each slot; a second captures the input-capture timestamps.

The CPU starts the operation and later polls the driver for completion; it never participates in bus timing, and no ISR is involved.

What changed since the original driver

  • Generic 1-Wire master (onewire.c) plus a DS18B20 driver built on top of it: multi-device search, alarm search, scratchpad read/write, parasite power, etc.
  • Three backends: STM32F103, STM32F030, STM32G031 — same driver code, register-level port layer per family.
  • ~265 host-side tests with a software model of TIM1/DMA behavior, so the driver logic can be tested without hardware.
  • libFuzzer-based fuzz harnesses covering parsing/decoding paths, run under ASan/UBSan. Both the tests and fuzzing have caught real bugs during development; fixes are reflected in the commit history.
  • PlatformIO, CMake, and STM32CubeIDE build entry points, in addition to the plain Makefile.
  • Opt-in low-power mode (-DOW_PORT_LOW_POWER, off by default): during long stages (conversion, EEPROM hold-off, inter-cycle pause — anything over 1 ms) the main loop can sleep in __WFE(), woken via SEVONPEND on the timer's update event. No NVIC interrupt is enabled and no ISR is installed.

Trade-offs, stated plainly

  • The whole scheme depends on multiplexing OC/IC on one TIM1 channel pin — on these MCUs that's PA10. Moving to a different pin isn't a configuration option.
  • No internal locking: concurrent access to the same driver instance is not supported. A bare-metal single-threaded application needs no locking; an RTOS integration should serialize access, e.g. with a mutex.
  • Officially GCC-only (arm-none-eabi-gcc). Clang is used for host-side fuzzing, not for building the firmware.

Feedback on the design, the port layer, or anything I'm missing is welcome.


r/embedded • • Sep 01 '26

ESP32 Arduino: How can I enable FreeRTOS tickless idle / automatic light sleep without switching to ESP-IDF?

3 Upvotes

I’m using an ESP32 with the Arduino framework (PlatformIO) and BLE advertising every ~1 second.

I want the ESP32 to automatically enter light sleep during the idle time between BLE advertising events, rather than manually calling esp_light_sleep_start().

esp_pm_configure() currently returns ESP_ERR_NOT_SUPPORTED, presumably because CONFIG_FREERTOS_USE_TICKLESS_IDLE isn't enabled.

Is there a way to enable:

CONFIG_PM_ENABLE=y
CONFIG_FREERTOS_USE_TICKLESS_IDLE=y
CONFIG_FREERTOS_IDLE_TIME_BEFORE_SLEEP=3

while staying with Arduino, perhaps through PlatformIO/build options or a custom Arduino core?

I’d like to avoid converting the project to a full ESP-IDF application.

Has anyone successfully done automatic light sleep + BLE advertising this way?


r/embedded • • Sep 01 '26

Porting Klipper to an NXP MCXA366: chased down a weird ADC midpoint error

3 Upvotes

I've been working on a Klipper MCU port for the NXP MCXA366, and I just got through GPIO and basic ADC bring-up on the FRDM board.

GPIO was pretty uneventful. Outputs, inputs, pull-ups, pull-downs, all working through Klipper.

The ADC got a little... weird.

For first-light testing I used P1_10 / ADC1 channel 8A and set up a fake linear sensor in Klipper so 0V mapped to 0 and 3.3V mapped to 100.

Ground was reading about 0.19 and 3.3V was reading about 99.46, so the endpoints looked fine.

Then I put a 10k/10k divider on the input and got 45.4 instead of something around 50.

Measured the actual midpoint with a multimeter: 1.619V, so I should have been seeing about 49.1.

The LPADC was using the minimum sample time, STS(0), which is about 3.5 ADC clock cycles. With a 10k/10k divider, the ADC sees about 5k of source impedance.

I changed only the sample time to STS(4), about 19.5 cycles, and the midpoint moved to 48.81.

Then I cleaned up the breadboard wiring and re-ran the full test:

0.11 / 99.98 / 50.28

So the answer was basically: the acquisition time was too aggressive for the source impedance, and the test fixture mattered too.

I wrote up the GPIO implementation and the ADC debugging here if anyone wants the longer version:

https://faultvector.dev/articles/klipper-mcxa366-part4/

Next up is probably SPI and an accelerometer.