Hello,
i'm writing an application with the following configuration:
The Flash API code in the boot ROM is accessed by the CPU.
2802x_FlashAPI_BootROMSymbols_v2.01.lib linked
SECTIONS { /* Allocate program areas: */ /* The Flash API functions can be grouped together as shown below. The defined symbols _Flash28_API_LoadStart, _Flash28_API_LoadEnd and _Flash28_API_RunStart are used to copy the API functions out of flash memory and into SARAM */ .cinit : > BOOT_IMAGE PAGE = 0 .pinit : > BOOT_IMAGE, PAGE = 0 .text : > BOOT_IMAGE PAGE = 0 codestart : > BEGIN PAGE = 0 ramfuncs : LOAD = BOOT_IMAGE, RUN = RAMM1, LOAD_START(_RamfuncsLoadStart), LOAD_END(_RamfuncsLoadEnd), RUN_START(_RamfuncsRunStart), PAGE = 0
MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart); MemCopy(&RamTimerfuncsLoadStart, &RamTimerfuncsLoadEnd, &RamTimerfuncsRunStart);
Flash Sector A --> user bootloader
Flash Sector B, C, D -> application code
the user bootloader has the following features:
- read and writes to Sectors B,C;D. Not A
- uart protocoll, interrupt driven
- base timer interrupt
- not using Flash API callback
Usually in bootloader I place everything in RAM.
#pragma CODE_SECTION(mainLoop, "ramfuncs");
and I repeat this code for every functions and ISR routines.
The first question is: do I really need to place everything in RAM if Flash_API reside in ROM?
Especially if I write to different sectors?
Maybe I only need ISR placed in RAM?
The second question is: CODE_SECTION will only place in RAM the named function or also the functions called in it's implementation?