cancel
Showing results for 
Search instead for 
Did you mean: 

The issue with STM32H745 SPI with DMA communication with two boards.

HPate.10
Associate III

Hello Support Team,

Please find the below issue description along with the attached code.

Please suggest how we can fix this issue.

I have developed the SPI with DMA code for STM32H745-DISC (Discovery board). I have flashed master code on the first board and salve code on the second board.

Both the board are not able to communicate over SPI with each other.

I have debugged well and found that callback doesn't also register and is not executed.

For transmitting and receiving the data from one STM32H745-DISC board to another STM32H745-DISC board.I have used HAL_SPI_TransmitReceive_DMA() API and written our own callback API (void HAL_SPI_TxRxCpltCallback(SPI_HandleTypeDef *hspi)).

For the same code, It is working fine with STM32F746-DISC boards.

Environment Scenario Details.

i) STM32Cube IDE : Version - 1.9.0

ii)OS : Windows 10 Pro - 64 bit

iii) STM32 Board : STM32H745 Discovery Kit

I have gone through a few support tickets and came to know that SPI + DMA is not working STM32H745-DISC (Discovery board). If this is not true please help us out for fixing this issue or let us know if it HAL layer issue. It would be great if you share the working SPI + DMA example for STM32H745-DISC (Discovery board).

Thanks In Advance.

2 REPLIES 2
Imen.D
ST Employee

Hello @HPate.10​ and welcome to the Community 🙂

I advise you to follow this FAQ : DMA is not working on STM32H7 devices.

You can get inspired from the available SPI examples in the STM32CubeH7 MCU package:

\STM32Cube_FW_H7_V1.10.0\Projects\NUCLEO-H745ZI-Q\Examples\SPI\SPI_FullDuplex_ComDMA

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
HPate.10
Associate III

Hello Imen DAHMEN,

Thank you for your quick reply and given a helpful link for us.

I have tried all SPI example projects using STM32H745 Discovery boards.

From this path: STM32CubeH7/Projects/NUCLEO-H745ZI-Q/Examples/SPI

But still, the boards are not able to communicate over SPI with each other.

I am facing an issue with transfer_callback. Previously I was unable to register the callback.

Currently, I am able to register the callback when I am running the Master(STM32H745 Master board) side separately.

I have used the same code as per the given above link. When I am connecting two boards as Master and Slave respectively that time transfer_callback not happening anyway.

Give me a better example link or solution for the above it's very helpful for me.

Query :

  1. Could you tell me what are configuration is mandatory on the SPI side as well as the DMA side?
  2. I want to know about how to enable I-Chache and D-Chache memory and also which macro I should enable for CPU-Cache usage.(or If any STM32CubeMX configuration is required please mention it)

If you can assist a technical guy on live chat that is better for me.

Thanks In Advance.