swiflash - command line

swiflash allows to flash images into WP/AR products through USB port. This is a recovery tool that can be used even if the device is not booting anymore. This tool is platform specific (only for WP/AR Series).


Installation

Ubuntu/Debian Distributions

Follow these instructions for Ubuntu/Debian distributions

wget https://downloads.sierrawireless.com/tools/swiflash/swiflash_latest.deb -O /tmp/swiflash_latest.deb
sudo apt-get install /tmp/swiflash_latest.deb

Alternate Distributions

Usage

This is a recovery tool, that can be used to flash images even if the device is not booting anymore (because of corrupted configurations files in the root FS, badly customized Linux kernel or Legato framework, or whatever...).

Switching the module into bootloader mode (if necessary)

Most of times, the tool can be used without having to do any hardware manipulation, as soon as the DM USB port (download port) is available.
However, sometimes the module may be in a unrecoverable state (no DM port); in such cases, the module shall be switched in bootloader mode before the flashing operation.

Please follow these steps to switch your module in bootloader mode:

  • Use one of the following methods to toggle the bootloader mode:

    • Either toggle the TP1 pin to LOW or OFF position
      Please refer to your product PTS to know where this pin is connected
      (on MangOH board, this is switch number 7)
      Then reboot the module

    • Or use the AT!BOOTHOLD AT command (this will perform a module reset).
      You can access to AT commands from the device Linux shell (UART or SSH) by using the microcom -E /dev/ttyAT command
  • 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.

Preliminary checks

On Linux, swiflash requires a udev rule to be installed on the system in order to run correctly. This rule: The rule is automatically installed from the Debian package, but it can be also installed manually (e.g. when installation is done from a zip archive):
sudo cp $ROOT/99-sierrawireless-modem.rules /etc/udev/rules.d
sudo service udev restart
(Assuming that $ROOT is the location where swiflash was installed)
Then, if your device is already plugged through USB, you will need to power cycle it.

The tool verifies the rule is present before running. Anyway, this check can be disabled by using the --force option.

Command options

Run swiflash --help for complete usage details.

swiflash [OPTION] -m "<module>" -i <image>
or
swiflash [OPTION] -m "<module>" -r

Options:

-i <image> Uses the provided image file (cwe or spk file) to flash the device

-r Restore the Linux root filesystem in its original state by erasing the USER1 partition (all filesystem updates will be lost)
Note: This option is not supported on following modules: ar758x

-m "<module>" Specifies the target module type.
Allowed values are: ar86, ar7, ar758x, wp85, wp750x, wp76xx, wp77xx, fx30_wp85

-f,--force Bypass preliminary checks for dialout group and ModemManager service, and launch the download anyway (see above)

-p <port> Specify the USB port to be used for download (enabling multiple downloads to be performed simultaneously).

Linux:
Use any path from the /dev/serial/by-path or /dev/serial/by-id folders.
Multiple paths may point on the same device, just pick one of the list.
The input should look like:
/dev/serial/by-id/usb-Sierra_Wireless__Incorporated_Sierra_Wireless_WP7702_VU12345678901234-if01-port0
It is also possible to provide the USB path from the device in /sys/bus/usb/devices/.
This is typically static and depends on the USB physical setup (USB controllers, USB hubs, ...).
The input would then look like:
1-1.1
Note: only up to 12 simultaneous downloads are supported

Windows:
Use the HUB/PORT syntax, which are the USB hub and port numbers to be used. To precisely identify these numbers:
  • Identify the plugged device VID/PID, in the Device Manager, by looking at Hardware IDs property in the device Details (should be similar to VID: 1199 / PID: 68C0)
  • Open the registry editor (regedit)
  • Look for the sub-instances at this path:
    Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_1199&PID_68C0
    (adapt the VID/PID if different)
  • Look for the LocationInformation entry; it should be something like Port_#0007.Hub_#0003
  • Deduce the parameter value; in the above example, it will be 3/7
-h,--help Display this message


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.spk
where image.spk is the image to be used, according to your customer configuration