Raw partition update
The update command simplifies the task of updating a partition of the storage media 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 to update.
-
Write the firmware image to the partition.
-
Read back and verify the written firmware image.
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 -> [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 named 'recovery' with file test.img downloaded from TFTP:
=> update recovery tftp test.img
Example 2: Update bootloader in the storage media of the module using default filename (determined by variable $uboot_file) reading the file from a FAT partition on the uSD card:
=> update uboot mmc 0:1 fat
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 |
---|---|
$loadaddr |
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 named <partition-name>. For example, the variable containing the default filename for a partition named "recovery" would be called $recovery_file. |
Source media
Variable | Description |
---|---|
$mmcdev |
Target MMC device index to write the firmware to. |
$mmcpart |
Target partition index of the selected MMC device to write the firmware to. |
Updating the bootloader
You can use the update command to update the bootloader in the storage media. 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:
=> 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 Hardware variants to verify which U-Boot binary you need.