Skip to main content
Associate II
May 21, 2025
Question

Can the Secure flash area of stm32h523cct6 be extended to the Non-secure flash area for code burning?

  • May 21, 2025
  • 1 reply
  • 1541 views

   Although I have expanded an external flash storage for pictures and fonts.Due to the fact that touchgfx generates a large amount of code, the stm32h523cct6 flash is insufficient.

   So can I use the address for 0xc000000 flash and address for 0x8000000 flash?I attempted to burn the program separately into these two flash areas. The burning was successful, but the program was not running normally. Do I need to modify or add other configurations? Or is this operation of mine illegal?

1 reply

GaetanGodart
Technical Moderator
May 21, 2025

Hello @XiaoenLee ,

 

The secure and non-secure flash are basically the same. If you don't care about attacks / competitors stealing your code, then you can safely use the non-secure flash.
To do so, you will have to modify the linker script.

For instance, this could be the old linker script :

MEMORY
{
 FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K
 RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
}

SECTIONS
{
 .text : { *(.text) } > FLASH
 .data : { *(.data) } > RAM
 .bss : { *(.bss) } > RAM
}

 And you can change it into this :

MEMORY
{
 SECURE_FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K
 NON_SECURE_FLASH (rx) : ORIGIN = 0x0C000000, LENGTH = 512K
 RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
}

SECTIONS
{
 .secure_text : { *(.secure_text) } > SECURE_FLASH
 .non_secure_text : { *(.non_secure_text) } > NON_SECURE_FLASH
 .data : { *(.data) } > RAM
 .bss : { *(.bss) } > RAM
}

 

The sections are a bit more complex but you get the idea.

 

Regards,

XiaoenLeeAuthor
Associate II
May 21, 2025

Is there a solution for MDK?