Part Number:TMS320F28075
Tool/software: TI C/C++ Compiler
I am developing a framework for the TMS320F28075 that allows it to be reprogrammed from an RS-485 connection. I created two projects in CCS with .cmd files configured such that their flash program memory would not overlap. The first project is generic code that simply toggles an LED (but theoretically can have any code that fits into its program space); it occupies flash sectors C through J. The second project contains routines that allow it to erase, flash, and verify the sectors from the first project from commands over the serial port; it occupies flash sectors A and B. In this second project, I modified F2807x_CodeStartBranch.asm to jump to an .asm file I wrote (instead of jumping to _c_int00). This .asm code checks if the first memory location in flash sector M (configured as a data section in both projects) is set, and either jumps to the beginning of flash sector A (to boot to the the second project) or sector C (the beginning of the first project). Doing this allows me to make the processor to boot to either project depending on whether or not flash sector M is erased (obviously, both projects have code that allows me to flash data to or erase sector M; the processor will boot to the corresponding project after a power cycle).
I first tested this system by programming both projects to the TMS320F28075 using CCS (I changed the flash settings so that the flash sectors belonging to the other project wouldn't be erased). With both projects loading onto the same chip, I then used my RS-485 host to change the value stored in flash sector M, allowing the processor to switch between projects (I verified this by coding different LED toggle routines on each project). So far so good, I was able to get both projects to coexist and switch between them.
The next step was to erase and reprogram the flash sectors corresponding to the first project from the second project (rather than doing this from CCS). I generated a .hex file that my RS-485 host could read, and used the data to complete a programming sequence. However, when I switch to the newly flashed program sectors, my code fails to execute (i.e. none of the LEDs blink). My first thought was that some of the program data must have been flashed incorrectly. I changed the flash settings in CCS from "Erase and Program" to "Verify Only", but the verification completes successfully (indicating that my host did flash the program data correctly). Furthermore, using Debug after "Verify Only" allowed me to step through the code and use the memory browser. I compared exported data from the memory browser from my flash routine (non-functional) against data after reprogramming from CCS (functional). Again, I was not able to find any differences between the flash sectors, though clearly something must be different due to the difference in behavior. When stepping through the code (using "Verify Only" after reprogramming from my utilities) I did notice some anomalies such as the clock_source switch statement jumping to INT_OSC2 even though the variable in Debug showed clock_source to equal "XTAL_OSC". I checked the .switch section in map and found that the section was left uninitialized despite setting it to FLASHJ in my .cmd file.
I've attached the .cmd and .map files for both projects. Any suggestions would be greatly appreciated (I changed the file extensions to .txt so I could attach them here).
(Please visit the site to view this file)
(Please visit the site to view this file)
(Please visit the site to view this file)
(Please visit the site to view this file)