cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H5: recent example of SPI slave with DMA for both RX/TX please

Ping1
Associate II

Dear all

I am relatively new to STM32, using STM32H563 as an SPI slave to receive data and send some feedback data as same time, The SPI master is a Tiva MCU form Ti,  as data is relatively long, I need to use DMA, I tried to find an example for it, but there is none with DMA, could some one please provide some starting point for me? 

Thanks in advance.

Ping

 

12 REPLIES 12

Hi, thanks for reply

I understand the example is running once - a specified number of bytes only ( or a data packet). I tried to do modified it to do it continuously, i.e. master sends a data packet, slave receives and reply with something, and then wait for next data packet. however, after it receives a packet, it hangs with some errors and not be able to receive more.

Any suggestions?

Regards!

Ping 

If you want some help debugging the code you've modified, post the code so that it can be seen by others. "some errors" is not a helpful description if you are looking for help.

If you feel a post has answered your question, please click "Accept as Solution".
Ping1
Associate II

Hi, RDK

Thanks for response, after calling HAL_StatusTypeDef status = HAL_SPI_TransmitReceive_DMA() first time, slave receives data from master, however, when calling it again for transmit and further receive, status returns HAL_BUSY, that means it failed to send any response back to master, right? 

Please advise.

Ping