Flash vs. RAM in Sample Applications

Several of the sample applications in the CMSIS-Pack have sequential writes and need to run from RAM. The ones that run from flash use the sections.ld linker script, as shown in Applications Running from Flash. To run from RAM, the use of the sections_ram.ld linker script is required, as seen in Applications Running from RAM.

Applications Running from Flash

The sample applications that run from flash automatically point to the sections.ld linker script. To see the pointer to the linker script, right-click on the Project folder or Alt + Enter > Properties > C/C++ Build > Settings > Cross Arm C Linker > General settings:

${workspace_loc:/${<project_name>}/RTE/Device/RSL15/sections.ld}

Alternatively, you can copy the sections.ld file from the configuration folder in the CMSIS-Pack to the project, as in this example:

${cmsis_pack_root}/ONSemiconductor/RSL15/<version>/firmware/configuration/GCC/sections.ld

Applications Running from RAM

The sample applications that run from RAM point by default to the sections_ram.ld linker script. To see the pointer to the linker script, right-click on the Project folder or Alt + Enter > Properties > C/C++ Build > Settings > Cross Arm C Linker > General settings:

${workspace_loc:/${<project_name>}/RTE/Device/RSL15/sections_ram.ld}

Alternatively, you can copy the sections_ram.ld file from the configuration folder in the CMSIS-Pack to the project, as in this example:

${cmsis_pack_root}/ONSemiconductor/RSL15/<version>/firmware/configuration/GCC/sections_ram.ld

Click the Startup tab of the Debug configuration, as shown in the "RAM Application Box in Debug Configuration Startup Tab" figure. Ensure that the RAM application box under Runtime Options is checked, and set the stack pointer (sp) in the Run/Restart Commands box as follows:

set $sp = *((int *) &ISR_Vector_Table)

Figure: RAM Application Box in Debug Configuration Startup Tab