Firmware Bundles

UploadFirmware

Upload a firmware bundle as a .zip file, whether binary or base64-encoded. The bundle must contain a manifest.json file that conforms to this JSON schema:

{
   name?: string,
   description?: string,
   fwversion: string,
   'format-version': 1,
   files: {
     file: string,
     type: 'application' | 'mcuboot' | 'bootloader' | 'softdevice' | 'init_packet',
     size: number
   }[]
 }

Notes:

  • ? fields are optional
  • files is an array of objects, all of which should be of the same type.
  • file must have a .bin extension. Host-side tools like nRF Connect for Desktop Programmer can be used to convert .hex files to .bin.
  • type values application and mcuboot apply only to nRF91 FOTA. Values softdevice and init_packet apply only to Bluetooth LE FOTA.
  • For Bluetooth LE devices using FOTA, the .zip file must contain both the init_packet and the firmware image (application or soft device). The type field for the manifest must be application or softdevice, not init_packet.
  • 'format-version' should always be set to 1
  • fwversion is validated against this regular expression: /^[a-zA-Z0-9._-]{1,60}$/
  • The Zephyr build system produces dfu_application.zip in the build/zephyr folder, which contains a manifest.json plus the update binary. However, the manifest is currently generated without the required fwversion field, so you will need to add that field.
  • If you use the nRFCloud.com user interface to upload your zip file, you are given options to fill in the name, description, and fwversion fields. The UI will then properly generate the manifest.json file and zip file.
  • Although nRF Cloud supports modem FOTA, we do not allow uploading modem firmware. These updates are made available only by Nordic Semiconductor.

An example of a valid manifest:

{
   "name": "My application update",
   "description": "Changelog: Fixed an issue with sleep mode. Power consumption improvements.",
   "fwversion": "1.1",
   "format-version": 1,
   "files": [
       {
           "file": "my_application_v1_1.hex.bin",
           "type": "application",
           "size": 695672
       }
   ]
}

Following are examples of uploading with curl (base64 and binary):

Using base64 encoded content:

export FILE=$(base64 path/to/my-file.zip)
# If you get a console error such as "Argument list too long" try using a REST client like Postman.

# UTF-8
curl -X POST $API_HOST/v1/firmwares \
   -H "Authorization: Bearer $API_KEY" \
   -H "Content-Type: text/plain;charset=UTF8" \
   -d $FILE

# ASCII
curl -X POST $API_HOST/v1/firmwares \
   -H "Authorization: Bearer $API_KEY" \
   -H "Content-Type: text/plain;charset=ASCII" \
   -d $FILE

# Plain Text
curl -X POST $API_HOST/v1/firmwares \
   -H "Authorization: Bearer $API_KEY" \
   -H "Content-Type: text/plain" \
   -d $FILE

Using binary content:

# Octet-stream
curl -X POST $API_HOST/v1/firmwares \
   -H "Authorization: Bearer $API_KEY" \
   -H "Content-Type: application/octet-stream" \
   --data-binary @/path/to/my-file.zip

# ZIP
curl -X POST $API_HOST/v1/firmwares \
   -H "Authorization: Bearer $API_KEY" \
   -H "Content-Type: application/zip" \
   --data-binary @/path/to/my-file.zip

For more information, see the FOTA documentation.

post/firmwares

Headers

content-type'text/plain;charset=UTF8' | 'text/plain;charset=ASCII' | 'text/plain' | 'application/octet-stream' | 'application/zip' required

Request body

string required

Response

urisstring[] required

Changes

No recorded changes to this endpoint across all 1 revision of this API.