cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743 SPI DMA NOT WORKING, CACHE DISABLED

DCajigal
Associate III

Hi everyone,

I have to port one proyect from a STM32F4 to a STM32H743. In this project it is important to use the SPI through DMA, so after reading a bit about the DMA-Cache issue in this microcontroller i decided to disable the D-Cache in order to make this change fast, but the DMA is not working.

When i use the function HAL_SPI_TransmitReceive_DMA(spiHandler, tx_block, block, size); Ir returns HAL_OK and the handler goes to Busy state, but nothing happens.

After searching, i found this topic :

https://community.st.com/s/article/FAQ-DMA-is-not-working-on-STM32H7-devices

So i tried to change my linker script according to that, placing the ".data" ".bss" and " ._user_heap_stack" to ">RAM_D1 AT> FLASH" (before it was ">RAM_D1"), removing the initial "_estack" definition and adding "_estack = .;" inside " ._user_heap_stack". But when i do this is like if the program was always attending interruptions and cannot run the application:

0693W00000GZtZeQAL.png 

Any help would be really appreciated!

3 REPLIES 3
TDK
Guru

If TIM1 is constantly firing and preventing your code from progressing, I would look into that. Show the code you're using. Perhaps your interrupt rate is too high.

Adding "> FLASH" isn't changing where the data is ultimately stored if it was already in RAM_D1 to begin with. Include your linker script.

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

I cant upload the whole code but segments of it. I attach the linker script. What bothers me is that if i remove the changes added to the linker script the code runs fine, in spite of not working the DMA. Besides, with the previous microcontroller it worked well. But now it seems to only execute the interrupt handlers:

0693W00000HnztwQAB.png

I have seen that it i uncomment one section of my code, it runs. I dont see anything extrange in that code:

0693W00000Ho0qjQAB.png0693W00000Ho0r8QAB.pngHowever, in spite of this, the DMA is not working. I call the function "status = HAL_SPI_TransmitReceive_DMA(spiHandler, tx_block, block, size);" but the DMA_Stream_IRQHandler is never called.