Ah, yes, good idea, however, this will require a Cloud change as well. Here's why. At the moment this code runs, the Cloud has sent the Core a request. The `chunk_received` message is a response to that request, and the server is awaiting a response.  With the current protocol semantics, the Core must respond with `chunk_received`.

On the other hand, `chunk_missed` is a new request by the Core, to which the Cloud responds with the requested chunk. We somehow must finish dealing with the in-progress request-response cycle before we can initiate a new one.

I will figure out what Cloud changes we can make that will be backwards compatible with the previous code. Your overall idea here @satishgn is right on, definitely the thing we should do—go back and start the OTA process from the beginning of the sFLASH erase sector.

It will take me some days to figure out the backwards compatible protocol changes.