Skip to main content
ranran
Senior
January 22, 2019
Solved

InvalidateDCache with AXI-SRAM gives HardFault

  • January 22, 2019
  • 3 replies
  • 1422 views

Hello,

I have recently moved RAM from DTCM to AXI SRAM (so that I get more RAM).

It then failed in dma example.

After investigation I found out that the call to  SCB_InvalidateDCache results in HardFault_Handler.

I've changed it to use  

 SCB_InvalidateDCache_by_Addr((uint32_t *)aDST_Buffer, (BUFFER_SIZE));

and now it function OK, but I don't yet understand why SCB_InvalidateDCache fails with AXI SRAM.

I am using st32h743-eval

Thank you,

ranran

This topic has been closed for replies.
Best answer by Tesla DeLorean

>> I don't yet understand why SCB_InvalidateDCache fails with AXI SRAM.

Doing a blanket level invalidate, doesn't flush, you likely just end up losing the stack and any pending writes against memory.

CleanDCache is the flushing method.

Use the Invalidate method of regions which DMA (to memory) has changed the underlying memory.

3 replies

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
January 22, 2019

>> I don't yet understand why SCB_InvalidateDCache fails with AXI SRAM.

Doing a blanket level invalidate, doesn't flush, you likely just end up losing the stack and any pending writes against memory.

CleanDCache is the flushing method.

Use the Invalidate method of regions which DMA (to memory) has changed the underlying memory.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
ranran
ranranAuthor
Senior
January 22, 2019

Right, I did invalidate regions using SCB_InvalidateDCache_by_Addr (as I wrote in the original post above)

Yet, why does AXI-SRAM behaves different from DTCM in term of cache ?

Tesla DeLorean
Guru
January 22, 2019

The DTCM memory isn't connected to the cache

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..