SPRUIG8J January 2018 – March 2024
You can avoid some of this maintenance burden by using the LOAD_START(), RUN_START(), and SIZE() operators that are already part of the linker command file syntax. For example, instead of building the application to generate a .map file, the linker command file can be annotated:
SECTIONS
{
.flashcode: { app_tasks.c.obj(.text) }
load = FLASH, run = PMEM,
LOAD_START(_flash_code_ld_start),
RUN_START(_flash_code_rn_start),
SIZE(_flash_code_size)
...
}
In this example, the LOAD_START(), RUN_START(), and SIZE() operators instruct the linker to create three symbols:
Symbol | Description |
---|---|
_flash_code_ld_start | Load address of .flashcode section |
_flash_code_rn_start | Run address of .flashcode section |
_flash_code_size | Size of .flashcode section |
These symbols can then be referenced from the copy table. The actual data in the copy table will be updated automatically each time the application is linked. This approach removes step 1 of the process described in Section 12.8.1.
While maintenance of the copy table is reduced markedly, you must still carry the burden of keeping the copy table contents in sync with the symbols that are defined in the linker command file. Ideally, the linker would generate the boot copy table automatically. This would avoid having to build the application twice and free you from having to explicitly manage the contents of the boot copy table.
For more information on the LOAD_START(), RUN_START(), and SIZE() operators, see Section 12.5.9.7.