cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U5 sending Data via GPDMA on SPI3 does not work

LBöhm.1
Associate III

I want to send data on SPI3 via DMA in TIM2 ISR but something is wrong. The data sent is always 0.

Can someone please have a look what I miss here? This example is made for STM32U5 Nucleo board with CubeMx.

5 REPLIES 5
Mohamed Aymen HZAMI
ST Employee

Hello @Lukas Böhm​ and welcome to the community,

Can you please share your .IOC file to check all the project configuration?

Mohamed Aymen

Mohamed Aymen HZAMI
ST Employee

I've been looking for both shared files, what I noticed in the hal_msp.c file in the "HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)" function the "handle_GPDMA1_Channel1.Init.Mode" is DMA_NORMAL, try to change it to DMA_CIRCULAR

Mohamed Aymen

Thank you for having a look at it. I appreciate that! .IOC File is uploaded also. I will try your suggestion.

DMA_CIRCULAR does not exit in STM32U5 HAL driver, also CubeMx does not provide this option.

You can also refer to the STM32Cube_FW_U5 SPI example :

"STM32Cube\Repository\STM32Cube_FW_U5_V1.1.0\Projects\NUCLEO-U575ZI-Q\Examples\SPI"

You can follow both DMA and SPI configuration of the provided example

Mohamed Aymen