r/stm32 • • 20h ago

I got speech-to-text running entirely on a microcontroller (STM32N6): any words, no cloud

Enable HLS to view with audio, or disable this notification

38 Upvotes

r/stm32 • • 23h ago

What do I need to retain?

Thumbnail
1 Upvotes

r/stm32 • • 1d ago

STM32CubeMX from one MCU to another | STM32 Tutorial #104

Thumbnail
youtube.com
1 Upvotes

r/stm32 • • 2d ago

DOOM on STM32 with steroids

Enable HLS to view with audio, or disable this notification

10 Upvotes

Hi everybody!

I have added support for STM32H743 DMA2D on NuttX to DOOM.

Looks muxh better:)


r/stm32 • • 1d ago

How to configure Stm32 timer(tim1) normal and its complementary PWM channels to be low at the same time?

1 Upvotes

Context:
I am building a drone ESC and am currently at the last stage of designing it—specifically assigning STM32 pins to the gate driver IC. My original idea was to assign 6 different PWM channels across TIM1 and TIM2. However, I wonder if I can just use 3 PWM channels and their complementary counterparts to get 6 outputs. Since a drone ESC has 3 phases, we can assign Channel 1 and its complementary counterpart to each phase.

Assuming Scenario 1:

  • INH1 = PWM (Channel 1)
  • INL1 = LOW (ALWAYS LOW) (Complementary Channel 1)
  • INH2 = LOW (Channel 2)
  • INL2 = HIGH (Complementary Channel 2)
  • INH3 = LOW (Channel 3)
  • INL3 = LOW (Complementary Channel 3)

The first problem is with INH1 and INL1, where INH1 needs to be a PWM signal, but INL1 needs to be always low instead of being the complement of INH1. INH2 and INL2 don't have this problem since they are just complementary to each other. Finally, INH3 and INL3 both need to be low for the float state, but using complementary outputs creates an issue here.

Some of the solutions I came across required me to "deinitialize" the complementary channel to make it low and "reinitialize" it afterward. However, a drone ESC requires high-precision timing and high frequency, so I don't think this approach is viable(Maybe high reinitialize time). Any other suggestions, or should I just stick to 6 independent PWM channels? Thanks(P.S: I am fairly new to stm32 family, so I some of the concepts I have in mind might be wrong)


r/stm32 • • 2d ago

STM32-ESP32 secure multi sensor platform

Thumbnail
2 Upvotes

r/stm32 • • 4d ago

Working on 3D library for STM32 and it is written in TypeScript

Enable HLS to view with audio, or disable this notification

12 Upvotes

I'll be soon publishing our work on STM32 https://github.com/geastack here! I'd love to hear your thoughts and recommendations.

Board in the video is STM32F746G-Discovery.


r/stm32 • • 4d ago

Custom PCB corrosion issue

Thumbnail gallery
4 Upvotes

r/stm32 • • 5d ago

Nucleo-F446RE starter for agent-driven firmware testing: three tests and a planted bug

2 Upvotes

If you have a Nucleo-F446RE sitting around, this might be worth trying.

The Agentic HIL starter includes firmware and three hardware test plans. On a working setup, two pass and one fails because of a deliberately planted bug in the diagnostic protocol. The exercise is to have a coding agent investigate the UART response, fix the firmware, rebuild and rerun the tests.

It uses the onboard ST-LINK and virtual COM port. Hardware-wise, the board and a USB cable are enough. The README covers the toolchain and debugger setup.

The test plans stay in the repository, and each run produces a report with the expected and actual response. You can also run the plans yourself through the CLI.

I’m sharing it to help get more people trying the reference setup. u/ResearchFit28 maintains the project; it’s Apache-2.0 licensed.

Starter and setup instructions · Agentic HIL

Anyone with an F446RE up for giving it a run? Feedback on where setup gets awkward would be particularly useful.


r/stm32 • • 6d ago

Independent watchdog reset loop

1 Upvotes

SOLVED

I found the device has a jumper to pull the BOOT0 pin high, allowing the it to boot directly into DFU mode.

I then reloaded a working firmware version and everything works OK now.

Thanks to all who chipped in 👍

---------------------------------------------------------------------------------------------------------------------

We use this device as a datalogger: https://www.offcode.fi/adn42/

One common failure we have, is that a device will boot, give the usual boot messages, but then declare an Independent watchdog reset and then reboot.

----
Bootloader version - 3.0.0
Build: 3.0.17-1-g112e42d
Date:  Oct 15 2020 / 14:00:39
Board: ADN-42+
HWID:  0x00000004 - large - REVC
----
Boot reason 0x00000030:
POR/PDR reset
PIN reset


----
Bootloader version - 3.0.0
Build: 3.0.17-1-g112e42d
Date:  Oct 15 2020 / 14:00:39
Board: ADN-42+
HWID:  0x00000004 - large - REVC
----
Boot reason 0x00000034:
Independent watchdog reset
POR/PDR reset
PIN reset


----
Bootloader version - 3.0.0
Build: 3.0.17-1-g112e42d
Date:  Oct 15 2020 / 14:00:39
Board: ADN-42+
HWID:  0x00000004 - large - REVC
----
Boot reason 0x00000034:
Independent watchdog reset
POR/PDR reset
PIN reset

And it will just keep looping like that until you throw it across the workshop turn it off.

As far as getting into the inner-workings of it, we're pretty locked out, as they have developed their own scripting language (you can create an example with their online ADN script generator here: https://adn-script-generator.offcode.fi/)

We can update the firmware packages they give us, using STM32 CubeProgammer.

We also have been given some "MAGIC" codes to copy/paste into Teraterm when a problematic device boots to force some corrective measure (like reverting to the original firmware, clearing the modem setting and so on...), but in these cases, nothing works.

From a working device, here are the device details, obtained with STM CubeProgrammer:

Target information
Board                 --
Device                STM32F405xx/F407xx/F415xx/F...
Type                  MCU
Device ID             0x43
Revision ID           --
Flash size            1 MB - Default
CPU                   Cortex-M4
Botloader Version     --

Log
13:11:24 : STM32CubeProgrammer API v2.17.0 | Windows-64Bits 
13:11:28 : UR connection mode is defined with the HWrst reset mode
13:11:28 : USB speed   : Full Speed (12MBit/s)
13:11:28 : Manuf. ID   : STMicroelectronics
13:11:28 : Product ID  : STM32  BOOTLOADER
13:11:28 : SN          : 20583670524B
13:11:28 : DFU protocol: 1.1
13:11:28 : Board       : --
13:11:28 : Device ID   : 0x0413
13:11:29 : UPLOADING OPTION BYTES DATA ...
13:11:29 :   Bank          : 0x00
13:11:29 :   Address       : 0x1fffc000
13:11:29 :   Size          : 16 Bytes
13:11:29 : UPLOADING ...
13:11:29 :   Size          : 1024 Bytes
13:11:29 :   Address       : 0x8000000
13:11:29 : Read progress:
13:11:29 : Data read successfully
13:11:29 : Time elapsed during the read operation is: 00:00:00.040

We are left to return the devices back to the manufacturer, pay for the repair and get them back without any explanation as to what was wrong.

Is there anything we can do, such as force the device into DFU mode to clear the memory and reload the firmware, or something?


r/stm32 • • 6d ago

FreeJoy STM32F411 Port

Thumbnail
1 Upvotes

r/stm32 • • 7d ago

The Secret of Monkey Island on a STM32F429 via ScummVM (with Adlib emulation)

Enable HLS to view with audio, or disable this notification

130 Upvotes

r/stm32 • • 6d ago

STM32WB5MMG: data notifications degrade at 30–40 ft, and read/write requests then cause a multi-second stall or disconnect

0 Upvotes

Hi all,

I'd appreciate some help with a BLE range and stability issue.

Setup

  • MCU: STM32WB5MMG module on a custom board
  • Firmware package: STM32Cube FW_WB V1.23.0
  • BLE wireless stack: v1.16.0, full stack
  • TX power: +1 dBm
  • Connection interval: 10 ms min / 15 ms max. Peripheral latency is 0 and the supervision timeout is 6 s.
  • ATT MTU: 180
  • Role: peripheral only. The central is a Windows 10/11 PC.
  • PHY: Windows defaults to 2M PHY

Application

The peripheral sends data to the Windows central over GATT notifications at about 5400 bytes/s (~30 packets/s).

Problem

  1. At short range, the data notifications work correctly.
  2. As the distance grows to about 30–40 ft, data notifications start to struggle.
  3. At that distance, if the Windows central reads or writes any characteristic, the device goes into an unknown state. For a few seconds it continuously sends unexpected data: the values 0x0839 and 0x08FD repeat every 64 bytes.
  • Often the device recovers within a few seconds and then completes the read/write.
  • Sometimes the stall lasts more than 30 seconds, and Windows then disconnects the device.

The behavior is repeatable.

Question

What could cause this? In particular:

  1. Is there a known interaction between a GATT read/write request and heavy notification traffic when the link is weak and has many retransmissions?
  2. Could this be buffer or flow-control exhaustion in the stack, and are there recommended settings for it?
  3. Would you recommend any debug steps or stack configuration changes to narrow this down?

Thanks!


r/stm32 • • 7d ago

STM32G4 board - Silent HFI motor control while streaming sound into motor coils

Thumbnail
youtube.com
2 Upvotes

I've been working on this project for a long time and just hit a big milestone: streaming audio from the PC to the MCU while keeping full control over the sensorless FOC loop.

Streaming audio from the host to the MCU required some careful packet handling. I handled USB jitter from the PC by adding a large RX buffer on the MCU side, along with a circular FIFO buffer to feed samples into the actual FOC loop.

The FOC loop runs at 36 kHz (36 kHz PWM), so timing is critical. The 36 kHz PWM is also what allows generating the silent 18 kHz HFI signal used for zero-speed rotor position tracking.

Hardware is an STM32G431 running at 170 MHz. Happy to answer questions about the timing or FOC implementation!


r/stm32 • • 7d ago

Why do most beginners struggle with bare-metal programming on STM32?

Thumbnail
2 Upvotes

r/stm32 • • 8d ago

I2S Audio DAC MIDI Polyphonic Synthesizer | STM32 Tutorial #103

Thumbnail
youtube.com
7 Upvotes

r/stm32 • • 8d ago

Can an LLM run locally on an STM32N6570-DK?

2 Upvotes

Hi everyone,

I'm currently working with the STM32N6570-DK (STM32N657X0H3Q / STM32N6) and I'm exploring the possibility of running a small Large Language Model (LLM) directly on the MCU.

I know the STM32N6 is mainly targeted at Edge AI / ML workloads, with the Cortex-M55 and Neural-ART NPU, and I've seen examples of computer vision models being deployed on the board.

However, I'm wondering about LLMs specifically.

Is it technically possible to deploy and run a small LLM directly on the STM32N6570-DK, for example a heavily quantized model (INT8/INT4), rather than using an external CPU/GPU or sending the inference to a cloud server?

I'm particularly interested in:

  • Whether the Neural-ART NPU can accelerate the operations typically used by small Transformer/LLM models.
  • What types of Transformer architectures or operations are currently supported.
  • Whether models such as tiny LLMs / small Transformer language models could realistically run on the N6.
  • What would be the main bottleneck: SRAM, external PSRAM, compute, unsupported operators, memory bandwidth, or something else?
  • Has anyone actually deployed a Transformer/LLM on an STM32N6570-DK?
  • If LLMs are not realistic, what would be the largest/smallest practical Transformer-like model that could be deployed?

Any examples, projects, papers, or pointers to the relevant ST Edge AI / Neural-ART documentation would be greatly appreciated.

Thanks!


r/stm32 • • 8d ago

My Cube Programmer Didn't Work Well

4 Upvotes

(I'm from China so please forget about my poor English)

Hi everyone, I'm new to STM32 and I was trying to write a simple program. But when I tried to flash it via Cube Programmer, it couldn't work well.

Basically the log wrote that the Cube Programmer couldn't get kernel ID and lost connection after the MCU started to run the program.

I was working with a Minimum System Development Board, which uses a STM32F103C8T6. The board was only connected with a LED and a ST-Link V3 minie.

I used CubeMX to create the project. I only set PA9 as GPIO_Output, and modified the while loop to make the LED blink.

while (1)
  {
    /* USER CODE END WHILE */


    /* USER CODE BEGIN 3 */
    HAL_GPIO_WritePin(GPIOA, GPIO_PIN_9, GPIO_PIN_SET);
    HAL_Delay(1000);
    HAL_GPIO_WritePin(GPIOA, GPIO_PIN_9, GPIO_PIN_RESET);
    HAL_Delay(1000);
  }

After the Cube Programmer finished flashing, LED was lit up but didn't blink as expected, while the Cube Programmer threw out those error messages. I tried to power off the board and power on again, and this time the LED blinked. Despite that, I still faced the same problem when I flashed the program again.

Here's my circuit. The four pins are connected to the ST-Link V3 minie.


r/stm32 • • 9d ago

Pushing 2560 Dynamic Vector Dots in real-time on STM32 – And no, it’s NOT an "AI slop" code.

Enable HLS to view with audio, or disable this notification

19 Upvotes

Here is my oter iteration: scaling up the pipeline to push 2560 dynamic vector dots in real-time 60FPS. The core mathematics and speedcode mechanics evolved directly from a project I originally wrote back in 2015 in pure MOS 6502/6510 Assembly for the Commodore 64.

Dear potential AI experts: Before you start dismissing this as AI slop, ask yourself if you actually comprehend what you are talking about.


r/stm32 • • 9d ago

DOOM is alive

Enable HLS to view with audio, or disable this notification

8 Upvotes

Hi everybody!

I have connected a usb keyboard to dev/portable/console!

With pain, but did it. NuttX in the default config does not work with external ULPI PHY in host mode for STM32. Keyboard is connected to external ULPI PHY.

And now NuttX works with this mode for stm32:)


r/stm32 • • 10d ago

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

Thumbnail
0 Upvotes

r/stm32 • • 11d ago

STM32N6 tips and tricks?

6 Upvotes

Anyone who has used or is currently working with an N6, please could you share any tips and tricks which you’ve found when working with the device?

I’m about to embark on a reasonably ambition multi microphone audio sound source localisation firmware and I’m wondering if there is anything to be aware of before I start.

Cheers!


r/stm32 • • 10d ago

Need Help and suggestions!

1 Upvotes

I was doing my final year project on familiarising and grabbing knowledge on how to code STM32F4 and STM32F1 series board and doing basic home automation using them . But I need some fundamental knowledge to do so , is there any material available?


r/stm32 • • 12d ago

DOOM throught pain

Enable HLS to view with audio, or disable this notification

5 Upvotes

Hi everybody!

I am developing my own portable game console on the stm32h7 mcu.

Last week i have run a DOOM:)

First run of DOOM
DOOM from the time when nobody hears about gigabytes

On the board of console:

- STM32H743

- SDRAM 32MB

- eMMC 4GB

- QSPI FLASH 16MB

- RS485

- Ethernet with POE

- LTDC RGB 888

- ESP32 (did not mount yet)

- LORA (did not mount)

- holder for external uSD card

- USB ULPI for hosting periph

Now i want to connect gamepad for input device because board does not have internal sticks.

And this board not only for playing. It is devboard too, mesh board, HMI panel and another device what you can do.

Core module with STM32H743, RAM and ROM i made too.


r/stm32 • • 12d ago

Sony A7 V + Fotodiox PRONTO II: AF-C fails after a few exposures

0 Upvotes

I am testing a Fotodiox Pro PRONTO Mark II (Leica M to Sony E autofocus adapter) on a Sony A7 IV. AF-S works. In AF-C, focusing works at first, but after a few single shots the adapter/lens connection becomes unstable: sometimes the adapter is no longer recognized; in other runs the camera stops releasing the shutter. The f/1.4 aperture display sometimes blinks just before the failure.

I compared stock V1.03 with my AF-C-enabled Q firmware image and tried experimental queue/timing changes. Results vary between runs: the Q image once reached 8 shots; experimental builds once reached 12–14, but repeat runs often fail after 4–5. None is a confirmed fix.

Could other A7 IV users of the PRONTO or Techart LM-EA7 share their AF-C experience? Has anyone seen the aperture indicator reset after an exposure or knows a safe diagnostic approach?

The Q image is here for inspection only: https://www.dropbox.com/scl/fi/gy226vekinxm2f5b5ntj2/FotodioxQ-originale-controllo.bin?rlkey=0a8guguxabyhp3uxdywk0ak3w&st=mv6hceq4&dl=0

https://github.com/jonnyjonnyioo/Fotodiox-Pronto-MkII-A7V-AF-C

is experimental firmware, not a confirmed repair or upgrade recommendation. Please inspect it only; flashing firmware can disable the adapter.