Tool/software: TI C/C++ Compiler
Hello,
I am developing a sample application for the CC2640R2 that is intended to be upgraded over the air via a BLE connection.
The design has the following constraints.
- An Image header must start at the beginning of the image. This must be page aligned
- The entry section must follow immediately after the image header and must be tacked to a known address in flash
- The last filled address must be exported via the linker command file to a variable. This variable is then used to fill a header structure in a .c file that is sent OTA
- Flash should be filled sequentially from lower addresses to high address while minimizing the number of gaps in placement.
My question is how to reliably know the last filled address of within the image. Ideally I would like to split sections for optimal placement, and use groups to ensure that required sections are placed in order. However in some images that have .snvSectors the flashEndAddr is not really placed at .cinit. However .cinit cannot be split.
Below are the relevant snippets of the linker file:
MEMORY
{
/* EDITOR'S NOTE:
* the FLASH and SRAM lengths can be changed by defining
* ICALL_STACK0_START or ICALL_RAM0_START in
* Properties->ARM Linker->Advanced Options->Command File Preprocessing.
*/
FLASH (RX) : origin = FLASH_START, length = ((FLASH_END - FLASH_START) + 1)
ENTRY (RX) : origin = ENTRY_START, length = ENTRY_SIZE
FLASH_IMG_HDR (RX) : origin = OAD_HDR_START, length = OAD_HDR_SIZE
SRAM (RWX) : origin = RAM_START, length = ICALL_RAM0_START - RAM_START
}
// ... Some parts have been redacted for readability/simplicity of example
SECTIONS
{
GROUP > FLASH_IMG_HDR
{
.image_header align PAGE_SIZE
}
GROUP > ENTRY
{
.resetVecs
.intvecs
EntrySection LOAD_START(prgEntryAddr)
}
GROUP >> FLASH
{
.text
.const
.constdata
.rodata
.emb_text
.pinit
}
.cinit : > FLASH LOAD_END(flashEndAddr)
.snvSectors : > FLASH (HIGH)
}