Part Number: TMS320F28069M
Other Parts Discussed in Thread: C2000WARE
Tool/software: TI C/C++ Compiler
Dear Support:
I have been working on trying to move code that is running out of on-chip FLASH and have it run out of RAM to make it run faster. In the process of making changes go the linker .cmd file to do so, I managed to get my project to get into some funky mode where I could no longer recover. From searching through previous forum submissions, I found this previous post:
which this unfortunate soul ran into a similar problem, bu never got an answer or resolution. I found a similar fix to my problem, but would really like to know what the heck is going on vs having to rebuild the project from scratch to fix this. Can you tell me how modifying the linker .cmd file can put you into a state where your project is non-recoverable by going into limp mode (whatever that means) and requires you to trash the project and come up with a new project that no longer goes into limp mode?
I have wasted a couple of days on this problem and have yet to figure out what the heck is going on other than not messing with the linker .cmd file to not go into this mode. I made changes to a .c file in my project like the following:
#pragma CODE_SECTION( xmit_spi, "ramfuncs" );
#pragma CODE_SECTION( rcvr_spi, "ramfuncs" );
#pragma CODE_SECTION( rcvr_spi_m, "ramfuncs" );
#pragma CODE_SECTION( rcvr_datablock, "ramfuncs" );
#pragma CODE_SECTION( disk_read, "ramfuncs" );
where I was trying move these routines (that are designated by the 1st argument in parenthesis) into a section "ramfuncs" in the linker command file and then doing the following in my linker .cmd file:
ramfuncs : LOAD = FLASHD,
RUN = RAML0,
LOAD_START(_RamfuncsLoadStart),
LOAD_END(_RamfuncsLoadEnd),
RUN_START(_RamfuncsRunStart),
PAGE = 0
to run my code out of RAM instead of FLASH. But more importantly, somehow introducing the #pragma statements above got my project in some weird mode where when I tired to download the code it would go into limp mode and as a result of making a call to:
InitSysCtrl();
which eventually calls this routine:
InitPll( DSP28_PLLCR, DSP28_DIVSEL );
which takes me to the following routine:
if (SysCtrlRegs.PLLSTS.bit.MCLKSTS != 0)
{
EALLOW;
// OSCCLKSRC1 failure detected. PLL running in limp mode.
// Re-enable missing clock logic.
SysCtrlRegs.PLLSTS.bit.MCLKCLR = 1;
EDIS;
// Replace this line with a call to an appropriate
// SystemShutdown(); function.
__asm(" ESTOP0"); // Uncomment for debugging purposes
}
where the asm instruction gets called and the project no longer works - i.e., clock routines no longer work and the nothing from the console output ). And since this is non-recoverable, I have to trash the project and start over again.
All as a result of screwing with the linker .cmd file to move code that was running out of FLASH into running out of RAM - pretty bizarre. More importantly, once I get into this mode it is pretty much non-recoverable. From what I found, I have to trash the project and start over and hope that I have an easy way of doing getting back to where I started - bummer. Any idea as to what I am doing wrong to get into this mode and when doing so, is there a way of recovering vs just trashing the project? Please advise.
Thanks,
Tim