OTA2 flash endurance with header

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
NiMc_1688136
Level 5
Level 5
10 sign-ins 50 questions asked 10 solutions authored

Is anyone concerned or looked at the endurance issue with OTA2 updates and the rewrites of the header?

During a update, the header is rewritten with status and bytesReceived for each write function call.

My image is 966KB and my downloads are received in 1KB chunks.

That means the header is read/erased/written nearly 944 times during one update.

The external flash specifies 100,000 cycles so this is only like 100 ota updates over the life of the product which maybe a lot but may not be depending on the life and application.

Would it make more sense to modify wiced_ota2_image.c, wiced_ota2_image_write_data function to not update the header and create a new function that will update the header when all bytes have been received?

Device: CYW43907

0 Likes
1 Solution
PriyaM_16
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

Hello,

The bytes_received in OTA image header is updated every time a sector is written into the flash. This helps us to track the bytes that are copied to the staged area. If the bytes_received variable is updated in the RAM and not written back to flash, we might loose the status of total bytes received in case of power loss/connection loss.

I agree with the fact that a partial image will anyhow not allow us to do an OTA update but it helps to debug the ota2 feature.

One possible suggestion to overcome flash endurance is to not re-write the OTA2 image header everytime and keep on updating it in RAM. On completion of entire download i.e., when total bytes_received >= image_size, the OTA2 header can be written back to the sflash.

View solution in original post

2 Replies
PriyaM_16
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

Hello,

The bytes_received in OTA image header is updated every time a sector is written into the flash. This helps us to track the bytes that are copied to the staged area. If the bytes_received variable is updated in the RAM and not written back to flash, we might loose the status of total bytes received in case of power loss/connection loss.

I agree with the fact that a partial image will anyhow not allow us to do an OTA update but it helps to debug the ota2 feature.

One possible suggestion to overcome flash endurance is to not re-write the OTA2 image header everytime and keep on updating it in RAM. On completion of entire download i.e., when total bytes_received >= image_size, the OTA2 header can be written back to the sflash.

AFAICT, this is a real bug that needs fix.

A combination of this issue and CYW43907 watchdog and OTA2_bootloader

I believe it's easy to damage the h/w.

0 Likes