2022-05-18 11:48 PM
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.
2022-05-19 08:25 AM
Hello @Lukas Böhm and welcome to the community,
Can you please share your .IOC file to check all the project configuration?
Mohamed Aymen
2022-05-19 08:34 AM
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
2022-05-19 09:16 AM
Thank you for having a look at it. I appreciate that! .IOC File is uploaded also. I will try your suggestion.
2022-05-20 04:34 AM
DMA_CIRCULAR does not exit in STM32U5 HAL driver, also CubeMx does not provide this option.
2022-05-20 04:36 AM
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