cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo-H753ZI SBSFU - How to move application RAM location in memory?

EBonv
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
Jocelyn RICARD
ST Employee

Hello Etienne,

I'm sorry I didn't see this post earlier.

As stated in other thread, there is no reason to change SBSFU RAM mapping.

Once jumping into the application, you can use whatever RAM mapping you need.

Best regards

Jocelyn

View solution in original post

4 REPLIES 4
Bubbles
ST Employee

Hello @EBonv​ ,

the protections are set by the SBSFU, meaning that the SBSFU is executed. Obviously as you wrote it crashes at some point. Is there at least some output on the VCP when you try running with SFU_VERBOSE_DEBUG_MODE? Also, in order for me to reproduce, are you using 1-image or 2-image example as starting point?

J,

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello @JHOUD​ , thank you for your answer.

There is no output to be seen on the VCP beyond the "Applying RDP-1 Level. You might need to unplug/plug the USB!" message. Power cycling the board or resetting it does not display any other message, even with the SFU_VERBOSE_DEBUG_MODE.

There is also the following that appears when I press the reset button if it can help:

@7:8000000 size:e sub:0 perm:5 exec:0
@6:24000000 size:b sub:0 perm:1 exec:1
@5:20000000 size:12 sub:0 perm:3 exec:1
@4:8020000 size:9 sub:0 perm:1 exec:1
@3:8000000 size:10 sub:0 perm:6 exec:0
@2:8000000 size:14 sub:0 perm:3 exec:1
@0:40000000 size:1c sub:0 perm:3 exec:1
@1:58024400 size:9 sub:0 perm:1 exec:1

I am using the 1-image example as starting point.

Etienne

Hello @JHOUD​ ,

do you have any update on my issue by any chance? I still could not resolve it on my side.

E.

Jocelyn RICARD
ST Employee

Hello Etienne,

I'm sorry I didn't see this post earlier.

As stated in other thread, there is no reason to change SBSFU RAM mapping.

Once jumping into the application, you can use whatever RAM mapping you need.

Best regards

Jocelyn