Using IAP Firmware Update
If you're using a compatible STM32, ESP32, or nRF microcontroller, we highly recommend using Notecard Outboard Firmware Update to perform DFU operations as it's more reliable, secure, and you can rollback any unintended changes.
IAP (In Application Programming) is a more traditional form of DFU that performs firmware updates while the program is running.
Read more about IAP vs ISP (In System Programming) in this kanda.com article.
Upload Host MCU Firmware
-
Select Settings > Firmware from the left navigation bar and click Upload Firmware.

-
Upload your new firmware binary with the form provided.

Deploy Firmware
-
Select Devices from the left navigation bar, select a device from the list of devices in the Host Firmware tab, and then click Update.

-
Select the firmware you wish to apply from the list of available firmware, and click Apply.

-
Consult Notecard API Requests for DFU to configure how Notecards process DFU requests.
Implementing IAP on the Host
Once a firmware binary has been uploaded to Notehub and a DFU action has been applied to a device, the host MCU is responsible for polling the Notecard, transferring the binary in chunks, validating it, and rebooting into the new image. Each individual API request used during this flow is documented on Notecard API Requests for DFU; the steps below show how those requests fit together end-to-end.
A typical host DFU loop, called periodically, performs the following actions:
-
Issues a
dfu.statusrequest to the Notecard and checks themodefield in the response to determine whether: a) a firmware image is being downloaded by the Notecard; b) a firmware image has been downloaded and is ready for installation; or, c) no new firmware is available. -
Once a new firmware binary has been downloaded and any pending network activity completes, issues a
hub.setrequest withmodeset todfu, signaling to the Notecard that the host is ready to retrieve firmware. -
Prepares the host's secondary (inactive) partition or update region to receive the incoming binary.
-
Performs a series of
dfu.getrequests to obtain the host firmware binary in chunks. Each chunk is CRC-validated and written to the host's update region using whatever flash-write or OTA utility the host platform provides. -
After the entire binary is retrieved, issues another
hub.setwithmodeset todfu-completedto indicate that the Notecard can resume its normal operations. -
Performs a final CRC check, comparing the CRC of the downloaded firmware to the value provided by Notehub in the initial
dfu.statusresponse. If the values match, marks the new image as the boot target. -
Issues a
dfu.statusrequest with thestopfield set totrue. Upon receipt, the Notecard removes the firmware binary from its internal storage. -
Restarts the host and begins running the new firmware.
For a complete reference implementation in C++ for the ESP32, see the
note-tutorials DFU example
on GitHub. The dfu.cpp file in that repository implements the full loop above
and can be adapted to other host platforms.