Other Parts Discussed in Thread: CONTROLSUITE
The F021 Flash API used for making a bootloader in Delfino F28377S doesn't seem to support erase/write Flash bank 1 (from address 0xC0000 / Sector O), only bank 0.
The example project provided from ControlSuite only illustrates erase and write of bank 0 which I've had no trouble making work for whole bank 0. Trying to adapt the code to bank 1, however, seems to erase bank 0 instead and nothing is written to bank 1. Writing to flash bank 1 via JTAG works fine.
Does the F021 Flash API work for bank 1 at this stage, and if so, is there any example code available or is anyone able to provide any hints?
If no bank 1 Flash API support at this stage; when can one expect Flash API support for bank 1?
In the function Init_FlashBank1_Sectors() below, "Fapi_Error_InvalidBank" is returned from the function Fapi_setActiveFlashBank(Fapi_FlashBank1). The equivalent function for bank 0 (Init_Flash_Sectors()) returns success.
void Init_FlashBank1_Sectors(void)
{
EALLOW;
Flash1EccRegs.ECC_ENABLE.bit.ENABLE = 0x0;
Fapi_StatusType oReturnCheck;
oReturnCheck = Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS, 200);
if(oReturnCheck != Fapi_Status_Success){
Flash_Error(oReturnCheck);
}
oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank1);
if(oReturnCheck != Fapi_Status_Success){
Flash_Error(oReturnCheck);
}
Flash1EccRegs.ECC_ENABLE.bit.ENABLE = 0xA;
EDIS;
}
void Init_Flash_Sectors(void)
{
EALLOW;
Flash0EccRegs.ECC_ENABLE.bit.ENABLE = 0x0;
Fapi_StatusType oReturnCheck;
oReturnCheck = Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS, 200);
if(oReturnCheck != Fapi_Status_Success){
Flash_Error(oReturnCheck);
}
oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank0);
if(oReturnCheck != Fapi_Status_Success){
Flash_Error(oReturnCheck);
}
Flash0EccRegs.ECC_ENABLE.bit.ENABLE = 0xA;
EDIS;
}