OS: Windows 10, CCS: 6.1.3
I am writing an Application Loader for the M3 core on an F28M36x part. This Application Loader has a few pertinent responsibilities:
- Verify that the Application in Flash is correct, or download/update the Application from a server
- Write some data to a block of RAM
- Jump to and run the Application
All of this is working:
- When the Application Loader downloads the Application to Flash, the contents of Flash are EXACTLY the same as if CCS had written the application to Flash
- My Application's first statement in main() is "while (myValue != 0);" loop, where "myValue" is a volatile integer with a unique value. When the Application Loader jumps to the Application, I can see that it is executing this loop (verified by the current program counter matching the address from the MAP file, and also the value in R0 matches the unique signature for "myValue").
- When the Application is stepping through the "while (myValue != 0);" loop, I verified that the block of RAM contains the data placed there by my Application Loader.
OK, so we're good so far. The unfortunate problem is that the Application doesn't behave the same as if I had loaded it from the debugger. So I stopped my debugger and reset the ControlCard (the development board). I can see by the LEDs that my Application Loader has jumped to the Application and that the Application is waiting in the "while (myValue != 0);" loop.
Now I want to connect to the system with a debugger and see what's going on. I created a custom "Code Composer Studio - Device Debugging" launch configuration with the following:
Program Tab:
Load symbols only
Target Tab:
Program/Memory Load Options
Disable all breakpoints when loading a different program
No Verification
Auto connect if a child connects
Disable interrupts: When Assembly Stepping, When Source Stepping
NOTE: "Reset the target on a program load or restart" is NOT CHECKED
NOTE: "Restart the target on a symbol load as well as a program load" is NOT CHECKED
Auto Run and Launch Options
Run to symbol: main
On a program load or restart
Connect to the target on debugger startup
Continue debug launch if target connection or program load fails
Misc/Other Options
Automatically load module symbols: Never
Simulators will flush the pipeline on a halt
Automatically step over functions without debug...
Allow software breakpoints to be used
Synchronize breakpoints and symbols (with like cores)...
Flash Settings
OSCCLK: 20
SPLLIMULT: 12
SYSDIVSEL: 1 [/2]
Backup/Restore clock register settings during Flash operations
Download: Verify Only
Erase Settings: Selected sectors Only (none selected)
Enable Verbose Output
But when I launch this, the program counter is at 0x01001572 and my block of memory is zero'd out.
How do I connect to a running program without having RAM cleared and the current Program Counter changed?