DShot + DMA on STM32H743: multi-timer setup leads to stuck outputs and system boot crash

Hi all,

I’m debugging DShot on a custom STM32H743 PX4 board and I now observe a more serious system-level issue that looks like a boot failure / possible memory corruption.

Board info

  • MCU: STM32H743

  • Timer layout same as hkust-nxt-dual

  • HRT uses TIM8 CH1 (TIM2 not used by HRT/RC/tone)

  • 8 outputs enabled

  • TIM1/TIM2/TIM3 all assigned to DMA1

  • Other DMA users: SPI2 + TIM4 only

  • Pins verified working using STM32Cube HAL

DShot behavior

  • TIM1 works fine for PWM and DShot

  • TIM2/TIM3 show abnormal behavior (DShot stuck HIGH)

  • Still debugging DMA/DMAMUX mapping


:police_car_light: Critical issue (boot failure)

When all 8 outputs are configured as DShot:

Symptom A

After reboot:

  • red LED blinking

  • green LED blinks 3 times then off

  • USB not detected by PC

  • board appears completely dead

Only full flash erase + reflash recovers the board.

Symptom B

If SD card remains inserted and I only erase flash:

  • green LED turns solid on

  • still no USB connection

Board does not boot until both flash and SD state are cleared.


My suspicion

This looks like:

  • DMA stream/DMAMUX misconfiguration

  • or multiple timers sharing DMA causing memory corruption

  • possibly overwriting stack/flash/FS during DShot DMA transfers

Because:

  • happens only when many DShot channels enabled

  • persists across reboot

  • requires full erase to recover


Questions

  1. Has anyone seen DMA/DShot causing memory corruption or boot failure on STM32H7?

  2. Is it safe for multiple IO timers to share the same DMA controller/index for DShot?

  3. Is there a recommended way to verify final DMA stream + DMAMUX request mapping at runtime?

  4. Any known restrictions for using DShot on TIM2/TIM3 vs TIM1?

Any debugging suggestions appreciated.

Thanks!


TIM3 could work in PWM mode but TIM2 has no output in PWM mode

Hi all,

Quick update – I managed to find the root cause.

It turned out not to be a DMA / timer / DShot issue.

The problem was a typo in my board defconfig:

CONFIG_PREALLOC_TIMERS=50F

The extra F was accidental.
After correcting it to:

CONFIG_PREALLOC_TIMERS=50

Everything works normally:

  • DShot on all timers OK

  • no stuck outputs

  • no reboot/boot failure

  • no board “brick” behavior

Looks like this misconfiguration probably corrupted memory or broke timer allocation internally, which caused all the strange DMA/boot symptoms.

Sorry for the noise, and hopefully this helps someone in the future :slightly_smiling_face:

Thanks!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.