am using a C28346 with DSP/BIOS CCS 3.3 BIOS 5.33.06 Compiler 5.2.2, trying to relocate small section of code for use in copying serial flash contents to program memory for rebooting new firmware download.
I am using a CODE_SECTION pragma with linker cmd section definition which seems to work as far as the linker and disassembly go, everything looks like it maps and loads and relocates correctly to the right address location, but right after the long jump to the relocated function CopyData() it crashes. I cannot do a single step in assembly mode from the start of the relocated CopyData() function and I cant see why. I have disabled all interrupt enable IER bits, the stack pointer looks ok, the relocated code looks ok, but it crashes immediately on entering the relocated function.
I am wondering if it is something to do with the pipeline? Do I have to flush the pipeline before doing a long jump?
#pragma CODE_SECTION(CopyData, "RamFuncs");
void CopyData()
{
}
/**************************************************************/
SECTIONS
{
RamFuncs : LOAD = L47SARAM, PAGE = 0
RUN = L03SARAM, PAGE = 0
LOAD_START(_RamFuncs_loadstart),
LOAD_END(_RamFuncs_loadend),
RUN_START(_RamFuncs_runstart)
}
// Section RamFuncs contains relocatable code
memcpy( &RamFuncs_runstart, &RamFuncs_loadstart, (&RamFuncs_loadend - &RamFuncs_loadstart)+1);