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

 

9 REPLIES 9
TDK
Super User

Here is an example of using an SPI slave for transmit and receive on the STM32H5 using DMA:

https://github.com/STMicroelectronics/STM32CubeH5/tree/e6985112c824fce355638ef4e7113b1bc671f999/Projects/NUCLEO-H503RB/Examples/SPI/SPI_FullDuplex_ComDMA_Slave

 

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

Hi, TDK

Thank you for your quick reply, tried to download the whole repository and still found some drivers are missing, they seems linked to other libraries. What is the recommended way to import this specific project only to CubeIDE and let it compile please?

Also, noticed it uses Link-list for DMA, which is new to me too, is it used for continuous TX/RX between Master and slave? will normal work? Sorry, i am asking too many questions.

Regards!

Ping  



Hello,


@Ping1 wrote:

Hi, TDK

Thank you for your quick reply, tried to download the whole repository and still found some drivers are missing, they seems linked to other libraries. What is the recommended way to import this specific project only to CubeIDE and let it compile please?


You need to git clone with recursive option. Please read this knowledge base: Downloading STM32Cube packages from GitHub correctly

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Ping1
Associate II

Thank you all for reply.

Now I have tried to copy the example to my project and found it only receives once and then ignore the rest of data packets coming, I am not sure the original example, is it designed doing once only, or continuously?

What is needed in order to let it run continuous ? any advice is appreciated.

Regards!

Ping

 

Use the Example Selector in STM32CubeMX to import this project into STM32CubeIDE. That's the easiest way to load an example.

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

@Ping1 wrote:

I am not sure the original example, is it designed doing once only, or continuously?


What the readme file of example is saying?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hi, 

I haven't found anything information on readme file regarding it run once or multiple, probably run once once after button press, hence, I am asking the question and also get some confirm from experts here, please kindly let me know if you know the answer.

Regards!

Ping

Ping1
Associate II

Hi, TDK

It is a good idea, however, I imported as example it although i don't have exact hardware board and therefore unable to try. I am not sure why the same example project is not available on STM32H563. 

Regards!

Ping

Hello @Ping1 


@Ping1 wrote:

Thank you all for reply.

Now I have tried to copy the example to my project and found it only receives once and then ignore the rest of data packets coming, I am not sure the original example, is it designed doing once only, or continuously?


What do you mean by once? Do you mean 1 byte? 

The example is designed to send and receive a specified number of bytes, and then verify that the transmitted and received data match.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om