cancel
Showing results for 
Search instead for 
Did you mean: 

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

XiaoenLee
Associate III

   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?

16 REPLIES 16

Hello @XiaoenLee ,

 

You can use the previously shared linker file.
You’ll also need to tag the object files or libraries appropriately and modify the scatter file (linker script for MDK-ARM) to recognize and place them accordingly.

You can force the attribute in the cpp file of the library like so:

__attribute__((section("SecureFlashSection")))

 

If the library is precompiled, you can add the section in the linker file :

touchgfx_core_wchar16.o (.text, .data)  ;

 

If your linker doesn’t see that .o directly, you can use a Library Member Specification in ARM linker like this :

touchgfx_core_wchar16.lib(touchgfx_core_wchar16.o) (.text, .data)

 

Or use a wildcard for safety :

touchgfx_core_wchar16.lib(*) (.text, .data)

 

Regards,

This still seems not to work.As before, the program can be burned into stm32, but it cannot be executed normally. In dubug, the program will jump to an unknown address.

Hello @XiaoenLee ,

 

So now your program jumps to an unknown address? But this was also the case before?

In that case, then you should first fix that before trying to enable 2 flashes.
Are you able to make a simple program work?
Are you able to make other compiler work?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

Everything is normal if the program is run with only one flash area, but it is abnormal when the program is run with two flash areas that are not consecutive addresses.

I think the address of the flash area where the program needs to be run must be consecutive. We cannot use "The address for 0xc000000 flash" and "the address for 0x8000000 flash" together because the CPU cannot address to another area.

Hello @XiaoenLee ,

 

It seems that the maximum memory for the STM32H523cc is 256Kb of flash:
Perhaps the non-secure and secure actually use the same physical memory but the address is different based on if you set it as secure or not?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

I think so too. So I need to replace it with a larger non-flash memory chip.

Hello @XiaoenLee ,

 

I don't understand what you want to replace.

Perhaps you could use the STM32H523ce which only difference seem to be the memory size. Perhaps the change is easy to do or try to optimize your code to fit in 256Kb.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)