Other Parts Discussed in Thread: HALCOGEN
Hello,
I am trying to port working RM48 bootloader code to the TMS570LC4357. The bootloader uses QJ Wang's bl_flash.c, bl_ymodem.c, etc files to download a file via UART and write it to flash. For the TMS570LC4357, I am using F021 library F021_API_CortexR4_BE_L2FMC_V3D16.lib. I verified that Registers.h is including Registers_FMC_BE.h. (big endian mode). The library and bl_flash, bl_ymodem, etc objects are relocated at boot time and execute out of RAM. Execution from RAM is working as expected.
The bootloader attempts to download a file and program it to flash starting at bank 0 sector 4 = flash address 0x20000. This code runs fine on the RM48 HDK but not on the TMS570LC43x HDK board.
When I run the code and download a file the Fapi_initializeFlashBanks(), Fapi_setActiveFlashBank(), Fapi_enableMainBankSectors(), and Fapi_issueAsyncCommandWithAddress() execute and return success codes. And the following while loops checking for FSM readybusy and status are executed and complete as expected.
while( FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmBusy );
while(FAPI_GET_FSM_STATUS != Fapi_Status_Success);
But the call to Flash_Erase_Check() fails. The CCS debugger memory window shows many words starting at location 0x20000 that are not all 0xFFFFFFFF. I read a post that implies ECC, so I tried calling Fapi_disableAutoEccCalculation() just after the call to Fapi_initializeFlashBanks(). But that did not help the problem.
I attached a screenshot of the debugger memory window after the erase operation showing the non-erased memory. I also attached the slightly modified file bl_flash.c. My changes are indicated with the tag //KRB
What is needed to erase flash on the 570LC4357?
Thank you,
Keith