I spent a couple of weeks troubleshooting my algorithm on a TMS320F28335 using CCS v6.1. I'm a seasoned analog engineer who is new to programming, digital control, etc. but I found CCS an intuitive environment where troubleshooting went surprisingly smoothly.
We're supposed to ship in two days (actually ON TIME), but now that I try and load the code into Flash, it doesn't work properly. I get the "I'm erasing flash" and "I'm loading" messages when I load the code by selecting Debug, but when I reset the power to my control board, the code doesn't operate quite right. The little hearbeat LED on the board blinks at 2Hz, so the timer interrupt is functioning at the right frequency. When I hit the ON button for the system it locks up in the turn on mode and doesn't proceed to the next mode. The heartbeat LED blinks at 2Hz, but nothing else happens. I can hit my OFF button and the system will go to off.
My limited understanding of the digital control world is based on the TMS320F28335 tutorial available on CD ROM that's broken up into 19 chapter or "modules". Chapter 14 provides details for loading the code into Flash. It essentially tells you to add these lines in main after the InitSysCtrl() function call:
memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, &RamfuncsLoadEnd - &RamfuncsLoadStart);
InitFlash(); // call InitFlash in RAM (SARAM - L0)
Also, declare the symbols used in memcpy() before main
extern unsigned int RamfuncsLoadStart;
extern unsigned int RamfuncsLoadEnd;
extern unsigned int RamfuncsRunStart;
Obviously, include a function prototype for InitFlash().
Also, exclude the 28335_RAM_lnk.cmd from the build and instead include F28335.cmd. In the Project -> Properties -> Debug -> F28335 Flash Settings, I set the OSCCLK to 20 since I'm using a 20 MHz crystal. After I complete the build, everything in the .map file is exactly what they describe in chapter 14 of the tutorial.
Since the tutorial is based on CCS 4, there may be some instructions for CCS v6.1 that have been left out.
Please, please do not tell me to read SPRA958L. I'm reading it now and it's not helping me much. Please let me know if you can help.
Thanks,
Tom