After programming the TMS320F28075 numerous times, it has suddenly developed a strange issue after programming the device over a JTAG connection from Code Composer. Stepping through the code shows that it seems to get stuck after calling "Fapi_setActiveFlashBank(Fapi_FlashBank0);" in my source below (most of which was copied from the Control Suite examples). Looking at the disassembly view, I see that after entering "Fapi_setActiveFlashBank(Fapi_FlashBank0)", the code jumps to address 0x3fe493 where the asm command is ESTOP. I see that the memory address corresponds to Secure ROM, so I'm not really sure what is going on in there. When stepping through the source, I see that the previous API call to "Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS, 120)" was successful. In InitSysCtrl, I have defined _FLASH so that the API gets moved into RAM and InitFlash is called. This issue has happened before and after 20 or so attempts at programming the device via JTAG, the issue disappeared. My problem seems similar to this issue https://e2e.ti.com/support/microcontrollers/c2000/f/171/p/399191/1454360%22, but I did not see any suggestions other than that the Control Suite version might be causing the issue - could it be the version of F021_API_F2837xD_FPU32.lib that I should change? I did think it was odd that this was the API in Control Suite even though the chip is different.
Note: commenting out the call to "Fapi_setActiveFlashBank(Fapi_FlashBank0);" allows the device to be programmed and run properly.
void main(void)
{
// initialize the system
InitSysCtrl();
Fapi_StatusType oReturnCheck;
EALLOW;
Flash0EccRegs.ECC_ENABLE.bit.ENABLE = 0x0;
oReturnCheck = Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS, 120);//for now keeping it out
// make sure flash initialization was successful
if(oReturnCheck != Fapi_Status_Success) {
// error handling
}
oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank0);
// make sure the setting the active flash bank was successful
if(oReturnCheck != Fapi_Status_Success) {
// error handling
}
EDIS;