All of the C2000Ware example projects
are provided with both RAM and Flash build configurations. To change the build
configuration from RAM to Flash, import the project in to the CCS IDE and right
click on the project and select 'Build Configurations' -> 'Set Active' ->
'Flash'. By selecting this, notice that:
- _FLASH symbol is defined in the "Predefined symbols" section under Project Build
settings. This is used to define and execute any Flash-build specific code.
- Flash-based linker command file is chosen for the application instead of a
RAM-based linker command file. Flash-based linker command files are provided in
the C2000Ware for reference (for example: XXX_FLASH_lnk_cpu1.cmd at
C2000Ware_x_xx_xx_xx\device_support\XXX\common\cmd). Flash-based linker command
files have codestart mapped to a Flash entry point address.
- All of the initialized sections are mapped to Flash memory in the Flash-based
linker command file.
- All of the functions that need to execute from RAM (for initialization or 0-wait
performance purpose) are assigned to the .TI.ramfunc section in the code. For
example, Flash_initModule() is assigned to .TI.ramfunc section.
- TI.ramfunc section is mapped to a Flash address for “Load” and a RAM address for
“RUN” in the Flash-based linker command file.
- All of the sections mapped to Flash are aligned on a 128-bit boundary using the
ALIGN() directive in the Flash-based linker command file.
- memcpy() function is called in the application to copy the .TI.ramfunc content
from Flash to RAM. The memcopy() is called before executing any code that is
assigned to .TI.ramfunc section.
- For EABI type executable: All uninitialized sections mapped to RAM are defined
as NOINIT sections (using the directive “type=NOINIT”) in the linker cmd
file.