Part Number: TMS570LS3137
Where can I find a linker command file for the TMS570LS3137 that causes code execution to occur from RAM and not Flash?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: TMS570LS3137
Where can I find a linker command file for the TMS570LS3137 that causes code execution to occur from RAM and not Flash?
Thank you for your response. I had seen this previously as well. Is there an example that copies ALL of the .text from flash to RAM, and not just the bootloader and FAPI portions?
I am trying to write a reprogrammer that executes from RAM. This reprogrammer calls functions that call functions that call functions, etc. These lower-level functions are used by both the reprogrammer and the application (non-reprogrammer) part of the code. I first attempted to copy to RAM only the functions that I needed, but then I kept uncovering other functions (some in the processor library code) that would also need to be copied. Instead of trying to figure out which functions to copy and which ones I don't need to copy, I was wanting to try just copying everything. Is there a way to do this?
Hello Steven,
You can copy some objects to SRAM and execute the code from SRAM:
1. To create an output section named test1 which is composed of the input sections inside {... ... }. The test1 is allocated to FLASH0 for loading, and allocated to SRAM0 for running. When the program is loaded, test1 is in the FLASH0 memory range. During running sys_startup.c which runs in FLASH0, it copies output section test1 from FLASH0 to SRAM. Note this copy is not done automatically.
1. allocate the output sections (test1) to flash and SRAM
/*----------------------------------------------------------------------------*/
/* Section Configuration */
SECTIONS
{
.intvecs : {} > VECTORS
test1:
{
sys_main.obj (.text)
sys_selftest.obj (.text)
sys_vim.obj (.text)
system.obj (.text)
pinmux.obj (.text)
esm.obj (.text)
rti.obj (.text)
errata_SSWF021_45.obj (.text)
gio.obj (.text)
sys_core.obj (.text)
sys_pmu.obj (.text)
notification.obj (.text)
} load = FLASH0, run = RAM, LOAD_START(loadStart), RUN_START(runStart), SIZE(codeSize)
.text : {} > FLASH0
.const : {} > FLASH0
.cinit : {} > FLASH0
.pinit : {} > FLASH0
.bss : {} > RAM
.data : {} > RAM
.sysmem : {} > RAM
/* USER CODE BEGIN (4) */
/* USER CODE END */
}
2. Copy the output section test1 to SRAM using _copyAPI2RAM_()
3. Please find the code of _copyAPI2RAM_() in TI CAN bootloader