2025-05-21 12:29 AM - edited 2025-05-21 12:31 AM
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?
2025-05-21 2:35 AM
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,
2025-05-21 2:54 AM - edited 2025-05-21 3:41 AM
Is there a solution for MDK?