AnsweredAssumed Answered

K64 Flash Swap remain in unreliable state

Question asked by Francesco Salvatore on Sep 28, 2016
Latest reply on Oct 5, 2016 by Francesco Salvatore

Hi everyone,

i'm developing an OTA updater using Flash Swap feature. I successfully implemented flash swap but when i encounter an error in downloaded firmware (i use CRC to test integrity of the file) i abort the flashing and my flash remain in UPDATE_ERASED state so when i reset and retry to flash i obtain FTFx_ERR_ACCERR.

I tried to perform a flash eraser before reset after a CRC error but i don't find any examples on how return in READY state (or another reliable state) to restart flashing from initial point.

 

Now i perform an erase of swap indicator sector in that way:

ret = FlashEraseSector(&flashSSDConfig, PSWAP_INDICATOR_ADDR + (P_FLASH_SIZE/2), P_SECTOR_SIZE, g_FlashLaunchCommand);
if(ret != FTFx_OK)
{
return ret;
}
ret = PFlashSwapCtl(&flashSSDConfig, PSWAP_INDICATOR_ADDR, FTFx_SWAP_SET_INDICATOR_ADDR, &currentSwapMode, &currentSwapBlock, &nextSwapBlock, g_FlashLaunchCommand);
if ((FTFx_OK != ret))
{
return ret;
}

 

I erase the swap indicator in upper flash section and then set swap indicators in active flash section.

Is it correct?

Outcomes