• Resolved

[FAQ] TMS320F28388D: [FAQ] Flash - How to modify an application from RAM configuration to Flash configuration?

Mastermind 33785 points

Replies: 1

Views: 72

Part Number: TMS320F28388D

Could you list the procedure involved in modifying an application from RAM based configuration to Flash based configuration in simple steps?

  • Below is applicable to TMS320F2838x, TMS320F2837x, TMS320F2807x, TMS320F28004x.

    All the C2000Ware example projects are provided with both RAM and Flash build configurations. To change the build configuration from RAM to Flash, users can import the project in to CCS and right click on the project and select 'Build Configurations' -> 'Set Active' -> 'Flash'.

    By selecting this Flash configuration, users can notice that:

    1. _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.

    2. 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 C2000Ware for reference (Ex: XXX_FLASH_lnk_cpu1.cmd at C2000Ware_x_xx_xx_xx\device_support\XXX\common\cmd). Flash based linker command files will have codestart mapped to Flash entry point address.

    3. All the initialized sections are mapped to Flash memory in the Flash based linker command file.

    4. All the functions that need to execute from RAM (for initialization or 0-wait performance purpose) are assigned to .TI.ramfunc section in the code.

    Ex: Flash_initModule() is assigned to .TI.ramfunc section. This Flash initialization routine (configures Flash wait-states, prefetch/cache mode, power etc.) must be executed from RAM.

    5. .TI.ramfunc section is mapped to a Flash address for “Load” and a RAM address for “RUN” in the Flash based linker command file.

    6. All the sections mapped to Flash are aligned on a 128-bit boundary using ALIGN() directive in the Flash based linker command file.

    7. memcpy() function is called in the application to copy the .TI.ramfunc content from Flash to RAM. memcopy() is called before executing any code that is assigned to .TI.ramfunc section.

    8. 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.