Showing results for 
Search instead for 
Did you mean: 

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 missing ?

Associate II

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.

ST Employee

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?

Associate II

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.

Associate II

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.

Yes, see my post below. It is solved.