Skip to main content
Caveman
Associate II
April 22, 2022
Question

HAL_SPI_Receive_DMA() won't start a transfer in a CubeMX project that I cloned. No activity on SPI bus. HAL call returns success. .IOC and generated files all compare successfully. (only changed some GPIO, SPI is configured same) What could I be miss

  • April 22, 2022
  • 3 replies
  • 1297 views

I simply wanted to make an identical program but with a different GPIO pinout. The SPI busses are all on the same pins and configured the same. What could I have touched that would cause the SPI transfer to not start ? I had to switch to HAL_SPI_Receive_IT() as interim solution.

This topic has been closed for replies.

3 replies

Petr DAVID
ST Employee
April 26, 2022

Hello Caveman,

recently there have been reported some problems with order of peripheral initialization. Is it possible the problem is caused by this? More on this topic could be found here. Have you been able to solve the problem?

Caveman
CavemanAuthor
Associate II
February 16, 2023

Yes, see my post below. It is solved.

Caveman
CavemanAuthor
Associate II
April 26, 2022

Thanks Petr, I have CubeMX version 6.1.0 and my inits are in the correct order.

I noticed in some of the other answers, they also have System_clock_config() after MX_DMA_Init(); so I changed my program to match that order. No effect. Besides, the working program that I cloned from has System_clock_config() placed higher.

Thus, the order of inits is correct in my program and the SPI bus still will not start.

Caveman
CavemanAuthor
Associate II
February 16, 2023

I just found the real answer myself. In the derived program, some application-level changes were made resulting in the .BSS section stacking up differently. This resulted in the SPI receive buffers being located in DTCM RAM which is not on any bus. The solution is to place the buffers in AXI RAM which DMA can reach through a bus.