2018-02-26 10:38 AM
I am porting our application from a STM32F779 to a STM32H753 device. Our application looks to run fin if we have the heap located on the DTCM_RAM (the whole 128k is reserved for heap allocation).
If the heap is moved to end of AXI-SRAM (last 128Kb) or SRAM1, our application performs wrong computation.
In all cases, data and bss section are on beginning of AXI-SRAM and stack on SRAM2.
Is there something special about DTCM_RAM that can explain this behavior?
-François
2018-05-16 11:26 AM
My experience (impression): D2 SRAM is not enabled on reset and startup in H7 MCU. As mentioned here in this thread, it has to be enabled during run time, via: __HAL_RCC_D2SRAM1_CLK_ENABLE(); etc.
But it means (results in): this SRAM cannot be used for any initialized data (no way to use as .data or .bss). The startup cannot load any data, even a .bss zero memory fill done in startup will fail. This memory becomes just access-able after enabling the clocks and the SRAM2 content will be random (uninitialized). So, you cannot define a region/section in linker script to load something before main() function is called. You can used for buffers but not for malloc: malloc would need some data structures initialized during startup, after reset released. So, I use SRAM2 only as uninitialized buffer regions during run-time, w/o to expect any pre-initialized data on it.