Nucleo-H753ZI SBSFU - How to move application RAM location in memory?
Hello,
I installed a SBSFU for a custom application on a Nucleo-H753ZI board. Everything works fine, however with the current settings of the SBSFU, my application is lacking RAM to handle the large inputs I want it to handle.
I used the memory mapping of the UserApp example application. After further investigation, I observed that the application RAM was located in the DTCMRAM area (0x20000000 / 128KB). Unfortunately, this area seems to be too small to host my application which RAM used to be in the RAM_D1 area of the board (0x24000000 / 512KB).
Therefore, I would like to know how I could move the application RAM area from the DTCMRAM area to the RAM_D1 area.
I tried the following:
- Modify the RAM section of the mapping_sbsfu.ld file as follows:
/* RAM section */
/* SE RAM1 region protected by firewall */
/* SE stack is placed 1st in RAM, stack overflow does not write on other RAM area */
__ICFEDIT_SE_region_RAM_start__ = 0x24000000;
__ICFEDIT_SE_region_RAM_stack_top__ = 0x24000400;
__ICFEDIT_SE_region_RAM_end__ = 0x24000FFF;
/* Secure memory activation code area - execution in RAM */
__ICFEDIT_SB_HDP_Code_region_RAM_start__ = __ICFEDIT_SE_region_RAM_end__ + 1;
__ICFEDIT_SB_HDP_Code_region_RAM_end__ = __ICFEDIT_SB_HDP_Code_region_RAM_start__ + 0xFF;
/* SBSFU RAM1 region */
__ICFEDIT_SB_region_RAM_start__ = __ICFEDIT_SB_HDP_Code_region_RAM_end__ + 1;
__ICFEDIT_SB_region_RAM_end__ = 0x2407FFFF;- Then I modified the following variables in the linker file of my application:
/* Highest address of the user mode stack */
_estack = 0x24080000; /* end of "RAM_D1" Ram type memory */
APPLI_region_RAM_start = __ICFEDIT_SE_region_RAM_end__ + 1;
APPLI_region_RAM_length = 0x24080000 - APPLI_region_RAM_start;- The same modifications have been made in the SECore and SBSFU linker files where necessary.
The result:
- The custom application has now enough RAM to successfully run on large inputs.
- With these modifications, the SBSFU is still compiling. When flashing it on the board, the securities are correctly set up (RDP level 1, PCROP) but the SBSFU program (which should prompt the download of a .sfb file) is not running.
Is there something I am missing to successfully achieve the displacement of the application RAM? Or am I on the wrong tracks? In particular, is there other variables I should modify to indicate that the SE RAM, SB HDP, SB RAM and APPLI RAM regions are now in the 0x24000000 memory area?
Thank you in advance for any answer or advice,
Etienne
