Sign in to the Source

Your account is not activated yet. Please check your email and click on the activation link that was sent to you when you registered to our site.
Did not received the activation email? Please click here to contact us.

swiflash - command line tool (linux host)

Jan 22, 2019 - Author: Sierra Wireless - Version 5.1 - 15703 Views

swiflash - command line

swiflash is a platform-specific tool used to flash images into WP/AR products
through the USB port. This is a recovery tool that can be used even if
the device is not booting anymore (due to corrupted configuration files in the root FS, badly customized Linux kernel or Legato framework, etc.).

Installation

Ubuntu/Debian Distributions

For Ubuntu (≥16.04)/Debian distributions, enter the following commands:

Install the udev rule that swiflash requires to run correctly (see udev Rule description below for details).
Enter the following commands (where <install_dir> is the location where swiflash was installed):

The rule is automatically installed from the Debian package, or can be also installed manually (e.g. when installation is done from a zip archive) as described in the Alternate Distributions procedure above.

swiflash verifies the rule is present before running. (Note — This check can be disabled by using the --force option.)

Running swiflash

swiflash uses the module's USB DM port (download port) to flash an image to the module.

Important — If the USB DM port is not available, the module is in an unrecoverable state and must be switched to bootloader mode before the image can be flashed. Follow the Troubleshooting — Force Module to Bootloader Mode instructions (next section) before running swiflash.

To use swiflash to flash an image to the module:

Make sure the device is connected via a USB cable.

Run the swiflash command using the appropriate Command Options described below.
(Note — If you used the hardware switch to enter bootloader mode earlier, switch it back to the ON (High) position after the download begins.)

Command options

Run swiflash --help for complete usage details. The following are two typical usage formats:

Bypass preliminary checks for dialout group and ModemManager service, and launch the download anyway (as noted in the udev Rule section above)

-p <port>

Specify the USB port to be used for download (enabling multiple downloads to be performed simultaneously).
Use any path from the /dev/serial/by-path or /dev/serial/by-id folders.
Multiple paths may point to the same device — pick one from the list.
Note: Up to 12 simultaneous downloads are supported.

-h,--help

Display this message

Troubleshooting — Force Module to Bootloader Mode (if necessary)

Usually, swiflash can be used without any hardware
manipulation, as soon as the USB DM port (download port) is available.

However, if the module is in an unrecoverable state (no DM
port), the module must be switched to bootloader mode
before the flashing operation.

To switch the module to bootloader mode:

Use either of the following methods:

Hardware switch:

Toggle the TP1 pin to LOW or OFF position
Please refer to your product PTS to know where this pin is connected
(on mangOH boards, this is switch number 7)

Reboot the module.

Software (AT command) switch:

Prepare to enter AT commands. To access AT commands from the module's Linux shell (UART or SSH), use the microcom -E /dev/ttyAT command.

Use the AT!BOOTHOLD AT command (this will perform a module reset).

Plug the device USB cable.

Check that a /dev/ttyUSBX serial port is mounted on your system—this will be the DM port, necessary to handle the download.

Then you will be able to execute the swiflash command (see below).

Note: if you used the hardware switch to enter bootloader mode, you'll have to switch back to HIGH or ON position once the download is started.

Example commands

Reset user partition on a Legato device:

swiflash -m "wp85" -r

Download reference device image on a Legato device:

swiflash -m "wp85" -i $WP85_DEVICE_IMAGE/image.spkwhere image.spk is the image to be used, according to your customer configuration