8. Conclusions
- The scatter file instructs the Linker where to place code and data. It is comprised of Load Region descriptors and Execution Region descriptors. A Load Region instructs the linker where to place code and data and the initialization code for
loading the code and data. Before the code reaches int
main(void)
in arch_main.c
, the initialization code is executed. During initialization code and data will be copied, if necessary, from
the Load Regions to the Execution Regions.
- If the user uses the default SDK scatter file, then the SDK code knows which RAM blocks to retain, depending on the selected DA14585/586 extended sleep mode (without or with OTP copy).
- If the customer uses his own custom scatter file, then he has to define himself the retained RAM blocks.
- RAM 4 block is always retained, due to the fact that it contains the ROM data variables.
- We always advise you to check the map file (linker listing) of your application, when you need to check for resources consumed or you want to optimize your code.
- The map file that is generated by the Linker is useful to analyze the occupied resources. It is advised to enable the generation of this as indicated in Figure 11.
To enable the generation of the Linker MAP file in Keil MDK-ARM, please check the Memory map Box in:
Project->Options for Target ‘Your target Project name’->Listing Tab->Linker Listing