K64 Flash Swap remain in unreliable state

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

K64 Flash Swap remain in unreliable state

跳至解决方案
899 次查看
francescosalvat
Contributor II

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?

标签 (1)
标记 (2)
1 解答
681 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Francesco Salvatore,

I think you are facing a similar issue as the one discussed in the next thread:

MK22FN1M0VLQ12 SWAP: Return from UpErs to Ready 

The SWAP system uses a sequential state machine, not intended to move backwards (e.g. from UPDATE-ERASED to READY state).

You can stay in UPDATE-ERASED state, erase the corrupted firmware and start flashing again the correct firmware.

Please let me know if I misunderstood your situation or use-case.

Best Regards!,
Jorge Gonzalez

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

2 回复数
682 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Francesco Salvatore,

I think you are facing a similar issue as the one discussed in the next thread:

MK22FN1M0VLQ12 SWAP: Return from UpErs to Ready 

The SWAP system uses a sequential state machine, not intended to move backwards (e.g. from UPDATE-ERASED to READY state).

You can stay in UPDATE-ERASED state, erase the corrupted firmware and start flashing again the correct firmware.

Please let me know if I misunderstood your situation or use-case.

Best Regards!,
Jorge Gonzalez

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

681 次查看
francescosalvat
Contributor II

Hi, the situation was those and i resolved doing exactly what you wrote!  Thank you!

0 项奖励