This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

The meaning and usage of FLASH_SIZE within the linker_section_placement_macros

Can you clarify how FLASH_SIZE, defined within the linker_section_placement_macros setting in the Segger Embedded Studio project file is used?  Specifically: should it reflect the total size of FLASH from FLASH_START all the way up to the end of FLASH (FLASH_PH_START + FLASH_PH_SIZE)?  Or should it reflect the area of FLASH above FLASH_SIZE where the linker is allowed to explicitly program--avoiding areas reserved for the bootloader settings, MBR parameter storage, bootloader, and any FLASH pages used for storage by the BLE application?

In the second case, if our application reserves 2 FLASH pages (0x2000) and the bootloader is stored at 0x78000, then we'd specify FLASH_SIZE of 0x76000 - FLASH_START.  This is what I'm guessing is how FLASH_SIZE should be set, but the value doesn't seem to affect the linker file generated by Segger's mkld program.  I can change the value of FLASH_SIZE in the linker_section_placement_macros in the *.emProject file, and, as expected, it affects the command line passed to 'mkld', but the resulting linker file (*.ld) file remains unchanged.

Does mkld use this value for validation changes in some way?

Puzzled by why the generated linker file from mkld remains unaffected by changes in this value.

Thanks - Tony Garland

Related