Other Parts Discussed in Thread: C2000WARE,
Tool/software: TI-RTOS
I successfully load .econst section of program from flash to RAM in DSP28335 referring to SPRA958H(Running an Application from Internal Flash Memory on the TMS320F28xxx DSP), so I try to load .text
section of program from flash to RAM
Firstly, I define .text section in F28335_BIOS_flash.cmd
SECTIONS
{
/*** Preemptively link the .text section ***/
/* Must come before DSP/BIOS linker command file is evaluated */
.text: LOAD = FLASH, PAGE = 0
RUN = L6SARAM, PAGE = 1
RUN_START(_text_runstart),
LOAD_START(_text_loadstart),
LOAD_END(_text_loadend)
}
Then, I copy the .text section from flash to RAM in main function
void main(void)
{
....
#ifdef EXAMPLE_FLASH
/* Copy the .text section */
memcpy(&text_runstart,
&text_loadstart,
&text_loadend - &text_loadstart);
memcpy(&secureRamFuncs_runstart,
&secureRamFuncs_loadstart,
&secureRamFuncs_loadend - &secureRamFuncs_loadstart);
//--- Initialize the Flash and OTP
InitFlash(); // Initialize the Flash
#endif
...
}
After CCS normally compile and build the program, I burn .out file into DSP28335, But the program can't start and run.
In .map file, .text section is defined:
section page origin length input sections
-------- ---- ---------- ---------- ----------------
.text 0 00300f0b 00000d66 RUN ADDR = 0000e000
How can I solve this question?