SPRUJH3 April 2025 TMS320F2800132 , TMS320F2800133 , TMS320F2800135 , TMS320F2800137 , TMS320F2800152-Q1 , TMS320F2800153-Q1 , TMS320F2800154-Q1 , TMS320F2800155 , TMS320F2800155-Q1 , TMS320F2800156-Q1 , TMS320F2800157 , TMS320F2800157-Q1 , TMS320F280021 , TMS320F280023 , TMS320F280023C , TMS320F280025 , TMS320F280025C , TMS320F280034 , TMS320F280036-Q1 , TMS320F280036C-Q1 , TMS320F280037 , TMS320F280037C , TMS320F280038-Q1 , TMS320F280038C-Q1 , TMS320F280039 , TMS320F280039C , TMS320F280040-Q1 , TMS320F280040C-Q1 , TMS320F280041 , TMS320F280041C , TMS320F280045 , TMS320F280048-Q1 , TMS320F280048C-Q1 , TMS320F280049 , TMS320F280049C , TMS320F28076 , TMS320F28374D , TMS320F28374S , TMS320F28375D , TMS320F28375S , TMS320F28376D , TMS320F28376S , TMS320F28377D , TMS320F28377S , TMS320F28378D , TMS320F28378S , TMS320F28379D , TMS320F28379S , TMS320F28384D , TMS320F28384S , TMS320F28386D , TMS320F28386S , TMS320F28388D , TMS320F28388S , TMS320F28P550SG , TMS320F28P550SJ , TMS320F28P559SG-Q1 , TMS320F28P559SJ-Q1 , TMS320F28P650DH , TMS320F28P650DK , TMS320F28P650SH , TMS320F28P650SK , TMS320F28P659DH-Q1 , TMS320F28P659DK-Q1 , TMS320F28P659SH-Q1
Question: How to modify the flash kernels to run from the flash instead of the RAM?
Answer: On multibank devices, users can implement a custom bootloader in the flash to directly load application code onto the other flash banks. On single-bank devices, a custom bootloader in the flash can perform firmware upgrades on individual sectors within the same flash bank, but the Flash API must execute from RAM.
Using a custom bootloader provides more flexibility to the user in the boot flow, allowing for different peripheral GPIOs to be used as opposed to only having access to a limited, predefined set of GPIO assignments in the boot ROM. Having a custom bootloader also effectively reduces the number of steps in the bootloading process as there's no need to load an intermediate flash kernel into the RAM to program the flash.
Moreover, having a flash-based bootloader can also act as a fail-safe if the firmware upgrade process fails. Booting to code that does not get upgraded (that is, the flash-based bootloader) minimizes the chance that the device tries to boot to corrupted code, since the bootloader can use multiple methods to verify the existing firmware (key value, checksum, and so forth.). The same can be achieved in a RAM-based flash kernel too, but it's not practical to load this in every time the device boots.
One way to implement a custom bootloader is to modify the existing flash kernel projects in C2000Ware to execute from the flash instead of the RAM. This requires modifications to the kernel's linker command file, which specifies where the application is loaded in memory, and adding a pre-defined symbol to be used by the compiler.
The following steps modify the F28P55x SCI flash kernel to execute from the flash, but the same flow can be applied to any C2000 device with an existing flash kernel project in C2000Ware.


With the generic flash linker command file, the kernel is loaded into flash bank 0 (entry point at 0x80000). If users want to place the kernel in a different flash bank, then modify the SECTIONS allocated to flash bank 0 in the linker command file to the intended flash bank.
Furthermore, in MEMORY portion of the linker command file, BEGIN must also be updated to the intended flash entry point location (codestart) as needed, including the flash bank origin and length specifications to account for the codestart allocation at the entry point.
Refer to [33] for more details on linker command file directives.


