  Over-the-air (OTA) firmware updates are essential for updating and
maintaining IoT devices, especially those batteryless devices reliant on energy
harvesting power sources. Flash memory, favored for its low cost and high
density, is extensively used for data storage in many IoT devices. However, due
to its high energy demands for update operations, there is often insufficient
energy for code updates. This paper proposes an incremental flash-based OTA
update approach tailored for energy harvesting IoT devices, tackling the
challenges brought by limited memory resources and fluctuating energy
availability. Our approach is composed of three techniques: segmentbased update
packet design, deferred flash segment writes, and checkpoint-free update
resumption. Segment-based update packet design segments firmware updates into
smaller packets, each tailored for specific memory segments, thereby minimizing
unnecessary flash operations and conserving energy. Deferred flash segment
writes accumulate packets in Static Random-Access Memory (SRAM) for collective
processing, reducing the frequency of energy-intensive operations. Crucially,
our checkpointfree update resumption ensures efficient recovery from power
interruptions without significant energy cost on data backup. Through thorough
experimental evaluation, we have observed that our approach significantly
reduces the total energy consumed during OTA updates, and decreases the average
total update time in energy harvesting environments.
