Altering your code's startup address

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Greetings!

    (I'm using the Broadcom EVK, BCM 943341).

    I want to load my app at a different address in flash than the customary: 0x0800C000.  (This is Sector 3 in my Internal Flash, I would like to load the app into Sector 13 instead and boot it from there).

    Is there a make global that I can set that will cause this?

    Cheers, Robert

vik86

0 Likes
1 Solution
SeyhanA_31
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

Hi,


You may change the linker definitions in /WICED/platform/MCU/STM32F4xx/GCC/STM32F417/memory_with_bootloader.ld. Make sure the application fits on the location reserved.

If you going to alter how the application is mapped that do not align with defined flash sectors by PLATFORM_APP_START_SECTOR and PLATFORM_APP_END_SECTOR, they may need to updated as well in ...//WICED/platform/MCU/STM32F4xx/WAF/waf_platform.c


Seyhan

View solution in original post

3 Replies
SeyhanA_31
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

Hi,


You may change the linker definitions in /WICED/platform/MCU/STM32F4xx/GCC/STM32F417/memory_with_bootloader.ld. Make sure the application fits on the location reserved.

If you going to alter how the application is mapped that do not align with defined flash sectors by PLATFORM_APP_START_SECTOR and PLATFORM_APP_END_SECTOR, they may need to updated as well in ...//WICED/platform/MCU/STM32F4xx/WAF/waf_platform.c


Seyhan

Anonymous
Not applicable

Seyhan:

   That worked like a champ! Thanks!

   BTW, what 4-byte (address) value would I change to alter the "startup address" for the application.  That is, what location (what variable in the DCT structure) in the DCT would I alter so that upon the next REBOOT, it would start the app at this new location?

Cheers, Robert

0 Likes

Hi,

I am confused with your question but here is some info regarding application start and DCT.

The "PROVIDE( app_code_start_addr_loc = ORIGIN( APP_CODE ));" in .../WICED/platform/MCU/STM32F4xx/GCC/STM32F417/memory_with_bootloader.ld defines the OS (ThreadX or FreeRTOS) start location. The same definitions are exist for bootloader only built as well.

User applications are started with a specific thread started on OS where the "application_start(...)" is called.

The DCT is just a data storage where WiFi and other specific data structures are stored. There are two DCTs. Updated DCT could be altered by the factory default DCT values as well. You may take a look at Switching from WiFi Client To AP Mode for switching from AP to client mode by updating the DCT with factory default.

Hope it helps.

Seyhan

0 Likes