Raw partition update

The update command simplifies the task of updating a partition (or UBI volume) of the NAND by performing the following operations:

  • Download the required firmware image files from the specified media to RAM memory.

  • Retrieve and check information (offset, size) of the partition (or UBI volume) to update.

  • Write the firmware image to the partition (or UBI volume).

  • Read back and verify the written firmware image.

Syntax

'update' syntax
=> help update
update - Digi modules update command

Usage:
update <partition>  [source] [extra-args...]
 Description: updates <partition> in NAND via <source>
              If the partition is UBI formatted, or a filename with
              extension *.ubifs is passed, writing a UBIFS is assumed
              Otherwise, this command raw-writes the file to the partition.

 Arguments:
   - partition:    a partition index, a GUID partition name, or one
                   of the reserved names: uboot
   - [source]:     tftp|nfs|mmc|ram
   - [extra-args]: extra arguments depending on 'source'

      source=tftp|nfs -> [filename]
       - filename: file to transfer (if not provided, filename
                   will be taken from variable $<partition>_file)

      source=mmc|usb -> [device:part] [filesystem] [filename]
       - device:part: number of device and partition
       - filesystem: fat (default)|ext4
       - filename: file to transfer (if not provided, filename
                   will be taken from variable $<partition>_file)

      source=ram -> [image_address] [image_size]
       - image_address: address of image in RAM
                        ($loadaddr if not provided)
       - image_size: size of image in RAM
                    ($filesize if not provided)

Examples

Example 1: Update partition (or UBI volume) named myname with file test.img downloaded from TFTP:

=> update myname tftp test.img

Example 2: Update partition (or UBI volume) named linux in the NAND of the module using default filename (determined by variable $linux_file) reading the file from a FAT partition on the uSD card:

=> update linux mmc 0:1 fat

Check the default partition (or UBI volume) names at [{XREF_yocto_r_storage-layout}].

Customization using environment variables

You can customize the behavior of the update command through its parameters and also by using the following environment variables:

Addresses

Variable Description

$update_addr

RAM address where the firmware image file to use for the update is downloaded.

$verifyaddr

RAM address where the firmware image is read back to, for verification. U-Boot automatically sets this variable to a RAM address halfway through the available RAM, starting at $loadaddr, to maximize the size of firmware that can be transferred to RAM and verified during the update process.

Image file names

Variable Description

$uboot_file

Default image filename to use for updating the bootloader (if no filename is passed as parameter).

$<partition-name>_file

A variable of this form will contain the default filename to use for updating the partition (or UBI volume) named <partition-name>. For example, the variable containing the default filename for a partition (or UBI volume) named recovery would be called $recovery_file.

Updating the bootloader

You can use the update command to manually update the bootloader in the NAND. For example, to update from TFTP using the default filename (in variable $uboot_file):

=> update uboot tftp
Writing an invalid bootloader file may lead to the target not booting.

Digi releases U-Boot updates from time to time to fix problems or add new functionality. Much of the custom functionality added to U-Boot depends on environment variables and scripts that may have new values in newly released versions. Digi recommends that you reset the environment to its defaults after upgrading U-Boot:

Reset U-Boot environment to default values
=> env default -a

This resets the whole environment, with the exception of protected variables (like the MAC addresses). After resetting the environment, you may need to adjust your manufacturing or boot scripts to accommodate changes in the default environment, like new or modified scripts, variables, and default filenames.

See U-Boot files by variant to verify which U-Boot binary you need.