For my current project I need the FreeRTOS+MPU to work on H7. I got it somehow to work when I use DTCMs. However, when I try to move the complete memory allocation to the AXI SRAMs the FreeRTOS is hanging in the systick handler (there is a for(; there and goes out with break instructions).
After some experiments it was found that the system works if I do the following:
ā¢Disable the DCACHE completly or
ā¢Set an MPU region for the freeRTOS heap memory as non-cacheable (TEX = 001b, c = 0b, b = 0b)
I dont understand how I can have a cache coehrency problem since I dont have any DMAs or other processes writing into the AXI ram. The project is very very simple. It is just one thread and in the run function I have a counter incrementing.
To map the FreeRTOS to H7 I follow the steps on the following thread:
I attach the Attolic project here. in the main.h there are two compile switches. The system works if the ENABLE_DCACHE is commented or both ENABLE_DCACHE and ENABLE_NON_CACHEABLE_FREERTOS_HEAP are enabled.
I am running out of ideas what to try. Any help would be great.
If I use the exactly same code but use a F7 instead, then I dont see the problem. Is there any difference in terms of cache configuration that we would need to do to the H7?
Do the two boards have the same core revision number? If the hardware
has an r0p1 revision of the Cortex-M core then you need to use the
special FreeRTOS version that accounts for the silicon errata.
Thanks for the reply. My H7 board has the r1p1 and F7 the r1p0, so I guess the H7 is even newer. But in any case I have taken the MPU M4 port version and merged the errata related changes. I have them in the xPortPendSVHandler. I also tried to place ādsbā and āisbā instruction every time a set of MPU registers are set but did not help. The code gets stuck in the function xTaskIncrementTick, within the for(; loop. Can that give any hint? My only thread is just counting variables up and then I call the vTaskDelay.
The problems seems to be related with tasks sleeping and waking them up. If I just exchange the vTaskDelay by a portYIELD, then the system does not stuck, but I need the vTaskDelay in my application
Actually iām trying to understand the whole cubeMX HAL/CMSIS FreeRTOS Stuff and try to separate the freeRTOS Stuff from cubeMX to use freertos 10 instead of 9. And this is the only thread where there is a working project with freertos10 on stm32h7.