I wrote a bootloader (since there is no word on a TMS570LC4357 TI example) and everything was working fine until our code grew into bank 0 block 1 sector 9. Then, during a block erase operation I got a hang. I'm using F021_API_CortexR4_BE_L2FMC_V3D16.lib. I traced it to the following code:
status= Fapi_enableMainBankSectors(0xFFFE); /* used for API 2.01*/
while( FAPI_CHECK_FSM_READY_BUSY != Fapi_Status_FsmReady );
do{
status= Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector, eraseStartAddr);
while( FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmBusy );
while(FAPI_GET_FSM_STATUS != Fapi_Status_Success); // <- HANG HERE with 0x00004010 in FMSTAT
remaining -= flash_sector[j++].length;
eraseStartAddr = flash_sector[j].start;
}while((remaining > 0) && ( j < flash_bank[bk].numOfSectors));
I checked my sector struct matched the data sheet:
(mine)
(void *)0x00018000, 0x08000, 0, 6, 0xfff87000,
(void *)0x00020000, 0x20000, 0, 7, 0xfff87000,
(void *)0x00040000, 0x20000, 1, 8, 0xfff87000,
(void *)0x00060000, 0x20000, 1, 9, 0xfff87000,
(void *)0x00080000, 0x40000, 2, 10, 0xfff87000,
(void *)0x000C0000, 0x40000, 3, 11, 0xfff87000,
(void *)0x00100000, 0x40000, 4, 12, 0xfff87000,
(data sheet)
Everything checks out. I don't know what the deal is.
Am I doing something wrong?
Thanks,
Dan