Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX Azure FileX RAM Simulator Memory Corruption With Default Settings

Associate III

I generated an Azure RTOS project with the FileX option with RAM disk simulator enabled.  This was on a Nucleo-H723 board.  I used STM32CubeMX 6.9.2-RC4. It was X-CUBE-AZRTOS-H7 v 3.2.0.

The problem is the 'SRAM Disk Driver' option for the 'SRAM Disk Address' defaults a fixed address of D1_AXISRAM_BASE. The default linker places variables starting at D1_AXISRAM_BASE as well. The FileX SRAM simulator sets its buffer to zero and erases a FileX related variable. It likely corrupts other variables as well but that was the error detected by trying to run the generated code.

The LevelX NOR Simulator Driver also uses a fixed address of D1_AXISRAM_BASE and would cause similar corruption as well as not coexisting with the RAM disk.  I have not tried but I suspect the LevelX NAND Simulator Driver would suffer the same issues.

I hope ST understands how frustrating it is to have to debug the generated code when there are such basic issues. Especially as we are just trying to learn how to use the provided software and tools.

A better solution would be generate code that uses statically allocated buffers or buffers allocated from the FileX heap. It is possible to add code in a user section to override the generated address and use a static buffer. But the user would have to know the problem existed to start with.

This post identified the error which helped me find the root cause.