Hello,
We implemented flash swap feature for OTA firmware update in our program. We noticed that sometimes flash swapping provoked a reboot and flash blocks were not swapped.
After many debug sessions, it appears that it's when we call FTFx_CMD_SwapControl or FLASH_Swap function while other OS tasks are running that a crash can occurs.
When enabling only 2 or 3 tasks I was not able to reproduce the issue. But with more tasks running (up to 9) it happens quite often.
Disabling interruptions before calling the swap methods resolved this issue.
My question is why do we need to do this whereas none of the running tasks are doing flash write instructions during the call of these methods?
Is disabling interrupts during swap procedure the correct way to proceed with an rtos?
Target is a MK26FN2M0VMD18.
SDK version 2.5.0
Regards,
Tim
Hi Tim:
Since you can not reproduce this issue when enabling 2 or tasks, and can reproduce when running more than 9 tasks. I would suggest you check the stack size.
In a multitask OS, the main tasks should can continue running while new firmware is being loaded by a separate uploader/programmer task.
Regards
Daniel