ChibiOS Version: r16867
Compiler: gcc version 13.3.1 20240614 (Arm GNU Toolchain 13.3.Rel1 (Build arm-13.24))
Platform and Board:
- MCU: STM32G431CB
- Custom board
Nature of the Problem:
When SPI using DMA2 channels on STM32G431, the DMA transfer gets stuck - the EN bit is set but the CNDTR register does not decrease and no
dma2 stream interrupts are fired. The same configuration works perfectly with DMA1 channels.
Interestingly, memory-to-memory transfers using dmaStartMemCopy with DMA2 work fine, but for SPI the transfer never completes while identical code using DMA1 works as expected.
Steps to reproduce:
1. Build and flash the attached minimal project
2. Observe that spiExchange transfers never complete (LED stops blinking)
3. Change SPI1 RX TX DMA to DMA1 in the code - transfers work correctly (LED blinks)
I've attached a minimal ChibiOS project that demonstrates this issue.
DMA2 not firing on STM32G431 Topic is solved
- Giovanni
- Site Admin
- Posts: 14565
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1112 times
- Been thanked: 937 times
- Contact:
Re: DMA2 not firing on STM32G431
Hi,
Update, probably found the problem, from the Reference Manual RM0440 rev 8 pag.420:
This is wrong, channels 1 to 6 of DMA2 are mapped on DMAMUX channels 8 to 13 (same positions of other G4 devices with 8 channels per DMA).
Will commit a fix later today.
Giovanni
Update, probably found the problem, from the Reference Manual RM0440 rev 8 pag.420:
Code: Select all
For category 2 devices:
•DMAMUX channels 0 to 5 are connected to DMA1 channels 1 to 6
•DMAMUX channels 6 to 11 are connected to DMA2 channels 1 to 6
This is wrong, channels 1 to 6 of DMA2 are mapped on DMAMUX channels 8 to 13 (same positions of other G4 devices with 8 channels per DMA).
Will commit a fix later today.
Giovanni
- Giovanni
- Site Admin
- Posts: 14565
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1112 times
- Been thanked: 937 times
- Contact:
Who is online
Users browsing this forum: No registered users and 5 guests