Program the firmware from Linux

You can update the entire system from a local update package using the included command tools.

Requirements:

Follow these steps to update your system from the command line using an already generated package:

  1. Make sure the update package is accessible locally. See Build a software update package for more information.

Note You can download Digi provided pre-built image from ftp://ftp1.digi.com/support/digiembeddedyocto/2.2/r3/images/ccimx6ulstarter/fb/core-image-base-swu-ccimx6ulstarter-20171215013922.swu

For example, in the update partition:

$ ls -l /mnt/update/
-rw-r--r--    1 root     root     731810304 Jan 26 18:15 core-image-base-swu-<platform>-<timestamp>.swu

Or in external media:

$ ls -l /run/media/sda1
-rwxrwx---    1 root     disk     241062400 Jan 18 19:30 core-image-base-swu-<platform>-<timestamp>.swu
$ ls -l /run/media/mmcblk1p1
-rwxrwx---    1 root     disk     241062400 Jan 18 19:30 core-image-base-swu-<platform>-<timestamp>.swu				
  1. Use the update-firmware command to trigger the firmware update process via the recovery boot mode:
$ update-firmware /mnt/update/core-image-base-swu-<platform>.swu
 
The recovery commands have been properly configured and the system will reboot into recovery mode in 10 seconds (^C to cancel).
 
[...]

If you need to set a new file system encryption key (see Digi TrustFence™ for Yocto), use the --encryption-key option:

#> update-firmware --encryption-key=YjNz1psJsO3PsxIcdQwCjW7MA0Y5IryT38UCddViJNM= /mnt/update/core-image-base-swu-<platform>.swu
#> update-firmware --encryption-key /mnt/update/core-image-base-swu-<platform>.swu

The reboot timeout is configurable using option -T of the update-firmware command.

CAUTION! The system will be restarted during the update process.

You can also install an update package from your custom application using the Firmware update API provided by Digi. See Recovery library (firmware update).

Firmware update process

Once the firmware update process is triggered, it follows these steps:

  1. Device reboots into recovery mode. The kernel and initramfs in the recovery partition are booted instead of the kernel in the linux partition.
  2. The recovery init reads U-Boot's environment recovery_command variable for the software update package file name.
  3. The recovery init looks for the software update package in the update partition and in external media.
  4. The recovery init executes the swupdate tool to program the firmware into the module.
  5. The device reboots and the firmware update is complete.