cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 MDMA Transfer Error Address when using FreeRTOS

GBohlin
Associate II

Hi all,

I'm using the MDMA to communicate with an external flash over QUADSPI.

I have an implementation which works great without FreeRTOS, but when I implement it using FreeRTOS I get Transfer Error Address. I have verified that the RAM address exists in AXI memory so it seems like there is something about FreeRTOS that is not allowing the MDMA to read the memory?

// Write operation
MDMA_Channel0->CDAR = &QUADSPI->DR;
MDMA_Channel0->CSAR = pData;
 
// Read operation
MDMA_Channel0->CDAR = pData;
MDMA_Channel0->CSAR = &QUADSPI->DR;

I've seen the issue with both read and write operations. For both read and write the MDMA_CESR_TED = 0, meaning that the error is related to a read access.

This is the flow of the program:

  1. [FreeRTOS task] Perform write operation, set volatile flag indicating flash operations are busy
  2. [MDMA transfer complete interrupt] Disable MDMA
  3. [SPI transfer complete interrupt] Start polling flash status with QUADSPI
  4. [Polling match interrupt] set flag indicating flash operations are ready
  5. [FreeRTOS task] Perform read operation, set volatile flag indicating flash operations are busy
  6. [MDMA Transfer Error Interrupt]

These are the MDMA registers when I enable the MDMA at step 5:

0693W00000LwRkuQAF.pngThese are the MDMA registers when I get the error interrupt at step 6:

0693W00000LwRlYQAV.pngThese are the QUADSPI registers when I enable the MDMA at step 5:

0693W00000LwRmqQAF.pngThese are the QUADSPI registers when I get the error interrupt at step 6:

0693W00000LwRnKQAV.pngI have tried adding various delays in case it is a timing issue but to no avail. I don't understand why I get the error.

Edit: Changed places of screenshots to easier compare them

1 ACCEPTED SOLUTION

Accepted Solutions
GBohlin
Associate II

The issue that caused the error was

MDMA_CxTBR_SBUS

Changing that from 1 to 0, and it no longer crashed. The other issue I faced which is why I though this was RTOS related was that the FreeRTOS variables shared the same memory in RAM as my local variables.

View solution in original post

1 REPLY 1
GBohlin
Associate II

The issue that caused the error was

MDMA_CxTBR_SBUS

Changing that from 1 to 0, and it no longer crashed. The other issue I faced which is why I though this was RTOS related was that the FreeRTOS variables shared the same memory in RAM as my local variables.