I got the following problem. When the device is locked I can't erase and program flash.
Everything is in Zone1 and nothing is exeonly.
If I runt his code. Copied from example code:
void flash_test(void)
{
Fapi_StatusType oReturnCheck;
volatile Fapi_FlashStatusType oFlashStatus;
Fapi_FlashStatusWordType oFlashStatusWord;
EALLOW;
oReturnCheck = Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS, 100);
if(oReturnCheck != Fapi_Status_Success)
{
VT100_printf("Error 1\n\r");
}
oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank0);
if(oReturnCheck != Fapi_Status_Success)
{
VT100_printf("Error 2\n\r");
}
oReturnCheck = Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector,(uint32 *)Bzero_Sector12_start);
while (Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}
oReturnCheck = Fapi_doBlankCheck ((uint32_t *)Bzero_Sector12_start, Sector8KB_u32length, &oFlashStatusWord);
if(oReturnCheck != Fapi_Status_Success)
{
VT100_printf("Error 3\n\r");
}
}
This function return error 3. So there is a blank check error. But no error in the erase part.
So why Can't I program the flash as the part I want to flash is in the same zone as my program? This code works fine when the device is unlocked.
Thanks!