I am using CCS 5.3 with BIOS V5.42.0.7 to compile code for our TMS320C6701 DSP. Due to our RAD-HARD requirement, I cannot use any external memory. So far, we have managed to fit within the 64K code/data space of the DSP but just barely (6.8K of unused code memory).
I turned on file optimizations (Opt = 1, now 15.5K of unused code memory) and the code no longer worked...a lot of stack variables got optimized out of the code. Some of these variables were used to poll the hardware for a change. I changed a few variables to be volatile and got most of the code to work.
To verify that the emulator was not affecting code execution, I created a ROM image and placed the code in our EEPROM. Tried to run from EEPROM and the DSP did not report itself as running, it should set a bit in an FPGA if it's sane and running.
I added an infinite loop at the beginning of main and loaded only the symbols via the emulator when connecting. I can successfully step out of the infinite loop and run the code from EEPROM...at least I think I'm running from eeprom. So, now I'm out of ideas on how to debug the issue of running from EEPROM since that same image runs when the emulator is connected.
1. Any ideas what I should try next?
2. Should I change all stack variables to be volatile or only those used to poll h/w?
3. Does optimizations also remove stack variables that are pointers to h/w?
The current compiler/linker settings are:
-mv6700 --abi=coffabi -O1 -ms3 -g --define="CHIP_6701"
I have also tried dropping to Opt=0 and no improvement.
I added the directive "--call_assumptions=0" to a file via the CCS menu. The directive is in the compiler command line but did not seem to take affect. The local variables in a routine within this file are still being optimized out.
Regards, Bill.