Hi,
I am working with the TMS570LC0714 Controller. I want to program a boot loader software which can erase and program the
flash bank 0. But I have problems to erase the flash area.
So what I know is that the fapi functions must run in RAM area if I want to erase flash section of bank 0.
The following points are showing what I have done:
1.) I use the controller without floating point unit, so I used the Lib "F021_API_CortexR4_BE.lib". Hope it is the right one.
2.) I adapted the Linker command file as followed:
VECTORS (X) : origin=0x00000000 length=0x00000020
FLASH_API (RX) : origin=0x00000020 length=0x000014E0
FLASH0 (RX) : origin=0x00001500 length=0x0001EB00
STACKS (RW) : origin=0x08000000 length=0x00001500
RAM_API (RWX): origin=0x08001500 length=0x0000EB00
RAM (RW) : origin=0x08010000 length=0x00010000
AJSM (RX) : origin=0xF0000000 length=0x00000010
flashapi :
{
--library= F021_API_CortexR4_BE.lib (.text)
} LOAD = FLASH_API, RUN = RAM_API, LOAD_START(FlashApi_LoadStart), RUN_START(FlashApi_RunStart), SIZE(FlashApi_LoadSize)
3.) I copied all Flash data into RAM before I want to erase the flash as followed:
void CopyApiFromFlashToRam(void) {
uint32 size;
uint32 i;
size = (uint32)&FlashApi_LoadSize;
for(i=0;i<size;i++)
{
((char *)&FlashApi_RunStart)[i] =((char *)&FlashApi_LoadStart)[i];
}
}
4.) My function to erase the flash is called Fapi_BlockErase (Flash area).
The following map file listing shows the Fapi functions with the corresponding Flash / RAM address.
000086d0 Fapi_BlockErase
All fapi functions are in RAM area, also the Fapi_serviceWatchdogTimer function.
08001c49 Fapi_calculateEcc
08001bc5 Fapi_calculateFletcherChecksum
08001a55 Fapi_enableEepromBankSectors
08001ad5 Fapi_enableMainBankSectors
08001c5d Fapi_getNumberOfBankSectors
08001501 Fapi_initializeFlashBanks
08001bfd Fapi_issueAsyncCommandWithAddress
080018dd Fapi_issueProgrammingCommand
08001c8c Fapi_serviceWatchdogTimer
08001761 Fapi_setActiveFlashBank
00000794 FlashApi_LoadSize
00000020 FlashApi_LoadStart
08001500 FlashApi_RunStart
But it is still not erasing the flash. Any ideas ?
Best regards
bruno