r/stm32

▲ 3 r/stm32+1 crossposts

Should I use HAL or Zephyr for STM32N6 based drone

I want to use stm32N6 as it has csi for a camera and a npu for computer vision and it would be cool to test out its CV capabilities on a drone. Since its based on a new architecture a lot of vendor support is broken/buggy and I am wondering if I should use zephyr instead of hal, right now I just have motor control working, I plan to implement CSI camera next (imx219), then NPU, after that will be standard flight control additions like imu and wireless module ect. but the main complexity will be CSI and NPU. I heard Zephyr has better N6 support but its NPU is undercooked so I may have to do a hybrid approach for the NPU specifically.

reddit.com
u/GiraffeObjective3805 — 2 days ago
▲ 169 r/stm32+2 crossposts

STM32C011F4P6 + 13 LEDs — a minimal setup

I tried to build it with a minimal setup.

Hardware
STM32C011F4P6
4 resistors
13 LEDs

Programming setup
7-year-old, barely surviving MacBook Air
AuduinoIDE
ST-LINK V3-MINIE

Coding
ChatGPT

u/Excellent_Tart_1974 — 3 days ago
▲ 1 r/stm32

Senior old people kinda lost and don’t know where to start

Hi internet people!

I'm an old dude who used to be an electronics engineer 30 years ago. I only know about analog electronics, but now I decided to finally figure out microcontrollers. I have plenty of time for this task. Well at least until I'm alive. In order to learn things I came up with a task for myself. An electronic device project. I always learn stuff that way.

But I'm kinda lost because of huge range of options.

So here it is. I am a moonshiner (and an alcoholic of course) so I couldn't think of anything better than to make a thermal controller for my distillation setup. So I am asking this community for help - please tell me where to start?

This device must compare the temperature from two temperature sensors. And based on their readings clicks 8 relays open/closed. In addition, it must have LCD with temperature readings and some kind of settings menu to well... set some settings. Also 4-5 buttons for setting temperature threshold values based on which the contacts are closed or opened. All of this must be recorded in some memory and stored there even after a power outage. I don't need networking features or anything else. That kind of device. Sounds simple but like everything in the world I know it's not.

Here are specific questions:

- There are lots of STM32 MCUs. Which one is suitable for this task?

- Or maybe I should use something else?

- Can you recommend me good dev boards. I know only about official Nucleo ones?

- Is it really necessary to know C++ or Rust for coding that type of device firmware?

Thanks everybody!

reddit.com
u/CorrodedChocolate — 3 days ago
▲ 179 r/stm32+2 crossposts

Is this finally a real 3-axis FOC gimbal? IMU stabilization is working

A few days ago, these three BLDC motors were still oscillating all over the desk.

Now the encoder feedback, position PID, hard-stop detection, and IMU stabilization are finally working together.

This is my first pass at a stabilization mode inspired by the default behavior of a DJI Pocket 4.

Still a mess of jumper wires, but it finally feels more like a gimbal than a motor-control experiment Next I want to try FPV-style following.

If this were your build, what would you test next before putting a real payload on it?

u/WuBuilt — 6 days ago
▲ 202 r/stm32+12 crossposts

Wait..what !? 12 AI applications running entirely on a $5 ESP32. No cloud, no internet. Universal installer + Open source Github + Huggingface available. Test it yourself.

For years, edge AI has promised intelligence everywhere. In practice, most "edge AI" still means sending data to the cloud, relying on large Linux systems, or requiring expensive accelerator hardware.

SuperESP changes that.

Built on Atome LM v2, SuperESP transforms a standard ESP32 into a tiny AI appliance capable of running twelve practical applications entirely offline.

No GPUs.

No subscriptions.

No datacenter.

Just a microcontroller that costs less than a cup of coffee.

Every claim is verifiable and tied to a script.

What SuperESP Actually Is

SuperESP is not another chatbot squeezed onto a microcontroller.

It is a collection of specialized ternary AI models designed to classify events, patterns, behaviors, and anomalies directly on the device.

The current release includes:

Agriculture monitoring

Voice commands

Motion recognition

Gesture detection

Sound event classification

Machine anomaly detection

Air quality analysis

Energy monitoring

Occupancy estimation

Wearable activity tracking

Water leak detection

Predictive maintenance

It comes also with :

+ ESP32 OS

+ Universal Installer

Check out everything :

https://github.com/TilelliLab/atome-lm

u/themoroccanship — 7 days ago
▲ 2 r/stm32

Bricked my Nucleo-L476RG onboard ST-LINK while messing with bare-metal? (Unable to get core ID) - Looking for insight or closure.

Hey everyone,

I'm posting this out of pure frustration after spending an entire day trying to wrap my head around a hardware/debug lockout on my Nucleo-L476RG board while learning bare-metal STM32 development. I'm hoping someone can explain what actually happened under the hood, because I feel like I'm losing my mind.

Here is the timeline of what went down:

I was experimenting with pure bare-metal code (no HAL). At one point, my code included a low-power instruction (wfi - Wait For Interrupt) or initialized early on a routine that locked the core or stopped it from servicing the debug interface. Immediately after flashing that build, OpenOCD completely lost connection.

OpenOCD / CubeProgrammer throws "Error: Unable to get core ID" and "No STM32 target found", even when trying connect under reset. The board is not fully dead. The bootloader in system memory is completely fine, and I can still successfully flash the chip via UART (stm32flash with BOOT0 pulled high). So, the MCU itself runs code fine when booted via system memory, but the onboard ST-LINK debug interface/firmware bridge completely refuses to communicate with the target MCU over the SWD lines.

Did some chatting with gemini, tried some things to get it back. 1: Flashing a clean binary / wiping flash via UART. 2: Connect under reset and Hot Plug modes in STM32CubeProgrammer. 3: Hard-resetting the board manually while plugging in USB to catch the core during boot. 4: Checking the physical jumpers (CN2 jumpers are intact, JP5 is on U5V).

Nothing brings the SWD channel back to life. The onboard ST-LINK detects via USB on the PC, but it throws a brick wall the second it tries to talk to the main STM32 chip.

Since I'm sick of jumping through hoops with a broken onboard debugger, I've sort of decided to order an independent external ST-LINK V2 clone for a few bucks, pull the CN2 jumpers on the Nucleo, and hook up SWCLK/SWDIO directly to bypass the onboard.

  1. How on earth can a standard bare-metal program permanently break the debug circuitry of a Nucleo board if I didn't explicitly remap PA13/PA14 (SWDIO/SWCLK)? Did I trigger a hardware latch-up or ESD/voltage spike?
  2. Has anyone else experienced an onboard ST-LINK effectively "commiting suicide" while keeping the main MCU functional via UART?

Any insights are appreciated. I'm ready to move on to an external programmer, but I'd love to know what actually went wrong technically.

reddit.com
u/jumpz_btw — 6 days ago
▲ 0 r/stm32

Hey I need help urgent

So I created a project using cubemx and made it for uvision5 but then I wanted to see if I can make one for stm IDE using the same ioc file but it just doesn’t work it won’t let me use it to create a new project like it will create the new project but I just can’t open it
And even using uVision I can’t simulate it like I try to blink LED to simulate it but that doesn’t work at all
Help me it’s for a project

reddit.com
u/Aggravating-Pay-6658 — 6 days ago
▲ 2 r/stm32

Not able to find user manual for stm32 bluepill

Wanted to start working with stm32 bluepill but could only find the reference manual

Please share the user manual if you guys have it

reddit.com
u/microscammer — 10 days ago
▲ 6 r/stm32+1 crossposts

NOR FLASH SPI1 communication issue with STM32F446RET6 - JEDEC ID reads incorrectly

I am learning STM32 using the F446RET6 board. I'm facing an issue while connecting a W25Q64 NOR FLASH memory via SPI1 to the board. The JEDEC ID should be 20 70 17, but the STM32 consistently receives incorrect data: 3F FF FF.

The connections are VCC to 3.3V, GND to GND, SCLK to PA5 (SPI1_SCK), D0/DO to PA6 (SPI1_MISO), D1/DI to PA7 (SPI1_MOSI), and CS to PC7 as a GPIO output.

SPI1 is configured as Master, Full Duplex, 8-bit, CPOL Low, CPHA 1st Edge, MSB First, Software NSS, with a prescaler of 32. CS is manually controlled using PC7.

The HAL SPI transaction completes successfully, but the returned JEDEC ID is incorrect. The same W25Q64 module works perfectly with an ESP8266, where I get the expected 20 70 17, so the flash itself appears to be working.

I also tested PA5, PA6, PA7 and PB6 separately as GPIO outputs using a multimeter. All of them can correctly output both HIGH (~3.3V) and LOW (~0V). PC7 also switches correctly between ~3.3V and 0V when used as CS.

I initially used a breadboard for the SPI connections and noticed some inconsistent behavior, so I also tried connecting the SPI lines directly to different sections of the PCB, but the problem remained.

I have ordered an 8-channel logic analyzer to inspect CS, SCLK, MOSI and MISO. Before it arrives, I would like to know if there is anything obvious I am missing in the STM32 SPI configuration, wiring, or HAL implementation, and whether this could indicate a problem with SPI1 itself.

reddit.com
u/Alienguy051 — 9 days ago
▲ 136 r/stm32+2 crossposts

mini STM32N6 Camera

This is a small camera of STM32N6. I'm going to use the back magnetic suction method with the power bank to do some visual recognition projects with AI.

u/KienShen — 14 days ago
▲ 39 r/stm32+1 crossposts

UART not working despite labeled RX/TX/GND pads on Android 11 board

Reverse engineering an Android 11 OTT board. It has labeled LINUX_RX, LINUX_TX, GND UART pads, but connecting a 3.3V USB-TTL adapter (TX↔RX, GND↔GND) gives no boot logs at any common baud rate (115200, 9600, etc.).

Am I missing something, or could UART be disabled? Any tips?

u/mayankraj_287 — 13 days ago
▲ 5 r/stm32+1 crossposts

HELP, ST-Link can't detect my Blue Pill board.

https://preview.redd.it/brbh92iyzwhh1.png?width=1916&format=png&auto=webp&s=ed7ea14865f849e151191cc143fabcb56e42349c

First of all, complete beginner, first day of tinkering with it and following tutorials.
In desperate need of help, long story short I have tried to blink a led for a first on my Blue Pill board and succeeded on my first time. Any future attempts on changing the code on the cubeide has gone into errors such as target no device found (see image).
Since then I have tried so much stuff the internet search results has told me to.
For more information, in CubeProgrammer the serial number is 0 and pressing connect doesnt do anything, which makes me believe the st link is faulty, but in st-link utility the serial number shows fine.
The Chatgpt suggests that wiring can be the problem, but I'm positive the wires connect to the same labels on the board and the st link, also the same way it worked the first time, but still "no target found".
Don't know if I bricked my card / st link, or did something completely wrong
Any help would be appreciated, will provide more info if needed. Thank you.

reddit.com
u/ShalevX — 13 days ago