Hi team,
Regarding verify processing after ROM rewrite processing, NG is returned if some of the arguments of Fapi_doVerify() are local variables.
Why. In the manual it was a local declaration.
I am attaching the source code below, so please check if it is correct.
************************************************
unsigned int program_data_uh[256]; ← If you declare it here, it will not work properly (verification NG)
void write_state(REP_CTRL* ctrl_rep)
{
unsigned long int* program_data32_uw;
/// unsigned int program_data_uh[256]; ← If you declare it here, it will not work properly (verification NG)
unsigned int data_len_uh = 0;
unsigned int flg_error_ub = 0;
unsigned long int Index_uw = 0;
unsigned int i = 0;
unsigned int j = 0;
unsigned int flg_error_ub;
Fapi_StatusType oReturnCheck;
Fapi_FlashStatusType oFlashStatus;
Fapi_FlashStatusWordType oFlashStatusWord;
program_data32_uw = (unsigned long int*)program_data_uh;
flg_error_ub = 0;
data_len_uh = 128;
for (i=0; i<(256); i++){
program_data_uh[i] = 0x0000;
}
for (i=0; i<data_len_uh; i++){
program_data_uh[i] = i;
}
oReturnCheck = Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS, 120);
if (oReturnCheck != Fapi_Status_Success){
flg_error_ub = ON;
}
oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank0);
if (oReturnCheck != Fapi_Status_Success){
flg_error_ub = ON;
}
Index_uw = 0x86000;
while ((Index_uw < f_start_address_data_uw + data_len_uh) &&
oReturnCheck == Fapi_Status_Success){
oReturnCheck = Fapi_issueProgrammingCommand((unsigned long int*)Index_uw, (unsigned int*)program_data32_uw, 8, 0, 0, Fapi_AutoEccGeneration);
while (Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);
if (oReturnCheck != Fapi_Status_Success) {
flg_error_ub = ON;
}
oFlashStatus = Fapi_getFsmStatus();
if (oFlashStatus != Fapi_Status_Success){
flg_error_ub = ON;
}
oReturnCheck = Fapi_doVerify((unsigned long int*)Index_uw, 4, program_data32_uw, &oFlashStatusWord);
if (oReturnCheck != Fapi_Status_Success){
flg_error_ub = ON;
}
Index_uw += 8;
program_data32_uw += 4;
}
}
************************************************
Best regards,
sai