Show Contents

# Program the firmware from Linux

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

Requirements:

- Recovery partition programmed with the recovery image generated by Digi Embedded Yocto. See Recovery partition and utils.
- A software update package with the new firmware.

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/ccimx6ulsbc/x11/dey-image-qt-swu-ccimx6ulsbc-20171215000558.swu

For example, in the update partition:

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

> Or in external media:

>     $ ls -l /run/media/sda1
>     -rwxrwx---    1 root     disk     241062400 Jan 18 19:30 dey-image-qt-swu-<platform>.swu
>     $ ls -l /run/media/mmcblk1p1
>     -rwxrwx---    1 root     disk     241062400 Jan 18 19:30 dey-image-qt-swu-<platform>.swu

1. Use the update-firmware command to trigger the firmware update process via the recovery boot mode:

>     $ update-firmware /mnt/update/dey-image-qt-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:

- The update-firmware tool uses a base64-encoded string of a 32-byte binary key:

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

- Or it can generate a random key if one is not provided:

>     #> update-firmware --encryption-key /mnt/update/dey-image-qt-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.

© 2018 Digi International Inc. All rights reserved.
Program the firmware from Linux updated on 22 January 2018 08:08:28 PM