Skip to main content
EDrou
Visitor II
May 3, 2023
Question

Interrupt triggered DMA transfer (full duplex) over SPI fails (STM32U585)

When doing triggered (EXTI2 line) DMA transfer with SPI in circular mode I often don't get the expected result.

If I do the DMA transfer (non-circular) from the EXTI2 interrupt everything is fine.

Code transmit 10 bytes, receives 10 bytes each transfer.

Calling HAL_SPI_TransmitReceive_DMA(), HAL_SPI_TxRxCpltCallback() when testing result in both cases.

DMA/SPI setup in CubeMX.

Any ideas?

This topic has been closed for replies.

1 reply

waclawek.jan
Super User
May 3, 2023

> I often don't get the expected result.

What is the expected result and what do you get?

Read out and check GPDMA and SPI registers content. I am not familiar with GPDMA so can't give any particular advice, but generally, the mcu components do not work out of C source and/or any libraries such as Cube/HAL, they work out of their register settings.

JW