From 33e8b7151d31d6947106b2a6f7693dd7add4d664 Mon Sep 17 00:00:00 2001 From: Daniel Spindelbauer Date: Wed, 29 Aug 2018 18:07:48 +0000 Subject: [PATCH] GitBook: [development_release] one page modified --- tutorials/lte/firmware.md | 185 ++++++++++++++++++++++++++------------ 1 file changed, 128 insertions(+), 57 deletions(-) diff --git a/tutorials/lte/firmware.md b/tutorials/lte/firmware.md index a026f87..09d9806 100644 --- a/tutorials/lte/firmware.md +++ b/tutorials/lte/firmware.md @@ -4,78 +4,168 @@ description: Sequans LTE modem upgrade steps # Modem Firmware Update -There are 2 ways to upgrade the firmware on the LTE modem: via an SD card or via UART serial interface \(Windows, Linux, or macOS\) - {% hint style="info" %} -This article is only related to [GPy](../../datasheets/development/gpy.md), [FiPy](../../datasheets/development/fipy.md), and [G01](../../datasheets/oem/g01.md) boards +This article is only related to GPy, FiPy, and G01 boards {% endhint %} -Before going into details of this method, please do the following: +{% hint style="danger" %} +**Important**: When upgrading your modem for the first time, even if you have updated it in the past with the old firmware update method, you **MUST** use the "recovery" upgrade method described below. Otherwise you will risk breaking your module +{% endhint %} -1. [Upgrade Pycom Firmware Updater tool to the latest version](../../gettingstarted/installation/firmwaretool.md) -2. [Upgrade firmware](../../gettingstarted/installation/firmwaretool.md#updating-device-firmware) to latest `stable` version \(`v1.18.1`\) +Please read the following instructions carefully as there are some significant changes compared to the previous updater version. + +Most importantly, the updater is now integrated in the latest stable firmware release \(we will also publish a new development and pybytes firmware in the coming days\), so you no longer need to upload any scripts to your module. The built-in updater will take precedence over any scripts uploaded. + +Please start with the following steps: + +1. Upgrade the Pycom Firmware Updater tool to latest version +2. Select Firmware Type `stable` in the communication window to upgrade to version `v1.18.1.r1` + +You can find the different versions of firmwares available here: [https://software.pycom.io/downloads/sequans2.html](https://software.pycom.io/downloads/sequans2.html) + +There are two packages available, one for the latest CAT-M1 firmware, and another for the latest NB-IoT firmware. + +After unpacking the zip archive, you will find each firmware packages contains two files, one being the firmware file \(`CATM1-38638.dup` or `NB1-37781.dup`\) and the `updater.elf` file, which is required when using the "recovery" firmware update method or if a previous upgrade failed and the modem is in recovery mode. + +Please note that the `updater.elf` file is only around 300K so you can also store it inside the flash file system of the module. The firmware dup files will NOT fit into the available `/flash` file system on the module, so you either need to use an SD card or upload it directly from your computer. ## Via SD card -First, you need to get the firmware image files downloaded onto your FAT32 formatted SD card. You can find the different versions of the firmware here: [https://github.com/pycom/sqnsupgrade/tree/master/fw](https://github.com/pycom/sqnsupgrade/tree/master/fw) +To transfer the firmware files onto the SD card you have two options: -You will find 2 types of files for firmware: `.dup` and `updater.elf`. You will need the `updater.elf` file only for the first time you do this upgrade. +1. Format your SD card as with the FAT file system and then copy the files onto the card using your computer +2. * Make sure your SD card has an MBR and a single primary partition, the format it directly on the module and mount it: -Once you've downloaded the firmware files onto the SD card, insert it in your board and run the following commands: + ```text + from machine import SD + sd = SD() + os.mkfs(sd) + os.mount(sd, '/sd') + os.listdir('/sd') + ``` + + * Transfer the firmware files onto the SD card using FTP. Please ensure the transfer is successful and that the file on the module has the same size as the original file. + +Once you copied/uploaded the firmware files on to the SD card you can flash the LTE modem using the following command: + +To flash the CAT-M1 firmware onto your device: ```python import sqnsupgrade -sqnsupgrade.run('','>> +Attempting AT wakeup... +Starting STP (DO NOT DISCONNECT POWER!!!) +Session opened: version 1, max transfer 8192 bytes +Sending 54854 bytes: [########################################] 100% +Bootrom updated successfully, switching to upgrade mode +Attempting AT auto-negotiation... +Session opened: version 1, max transfer 2048 bytes +Sending 306076 bytes: [########################################] 100% +Attempting AT wakeup... +Upgrader loaded successfully, modem is in upgrade mode +Attempting AT wakeup... +Starting STP ON_THE_FLY +Session opened: version 1, max transfer 8192 bytes +Sending 5996938 bytes: [########################################] 100% +Code download done, returning to user mode +Resetting (DO NOT DISCONNECT POWER!!!)................ +Upgrade completed! +Here's the current firmware version: + SYSTEM VERSION ============== - FIRMWARE VERSION - Bootloader0 : 5.1.1.0 [33080] - Bootloader1 : 5.1.1.0 [38638] - Bootloader2* : 5.1.1.0 [38638] - NV Info : 1.1,0,0 - Software : 5.1.1.0 [38638] by robot-soft at 2018-08-20 09:51:46 - UE : 5.0.0.0d - COMPONENTS - ZSP0 : 1.0.99-13604 - ZSP1 : 1.0.99-12341 + FIRMWARE VERSION + Bootloader0 : 5.1.1.0 [33080] + Bootloader1 : 5.1.1.0 [38638] + Bootloader2* : 5.1.1.0 [38638] + NV Info : 1.1,0,0 + Software : 5.1.1.0 [38638] by robot-soft at 2018-08-20 09:51:46 + UE : 5.0.0.0d + COMPONENTS + ZSP0 : 1.0.99-13604 + ZSP1 : 1.0.99-12341 +``` + +{% hint style="info" %} + +After you have updated your modem once using the recovery method, you can now flash your modem again using just the `CATM1-38638.dup` or `NB1-37781.dup` file without specifying the `updater.elf` file. However, should the upgrade fail, your modem may end up in recovery mode and you will need the `updater.elf` file again. The updater will check for this and prompt you if using the `updater.elf` file is necessary. + +Example output using just the firmware file: + +```text +<<< Welcome to the SQN3330 firmware updater >>> +Attempting AT wakeup... + +Starting STP ON_THE_FLY +Session opened: version 1, max transfer 8192 bytes +Sending 5996938 bytes: [########################################] 100% +Code download done, returning to user mode +Resetting (DO NOT DISCONNECT POWER!!!)............................................................................ +Upgrade completed! +Here's the current firmware version: + +SYSTEM VERSION +============== + FIRMWARE VERSION + Bootloader0 : 5.1.1.0 [33080] + Bootloader1* : 5.1.1.0 [38638] + Bootloader2 : 5.1.1.0 [38638] + NV Info : 1.1,0,0 + Software : 5.1.1.0 [38638] by robot-soft at 2018-08-20 09:51:46 + UE : 5.0.0.0d + COMPONENTS + ZSP0 : 1.0.99-13604 + ZSP1 : 1.0.99-12341 ``` ## Via UART Serial Interface -If you don't want to use an SD card to hold the firmware images, you can directly use the existing UART interface you have with the board to load these firmware files from your computer. +If you can't use an SD card to hold the firmware images, you can use the existing UART interface you have with the board to load these firmware files from your Computer. -In that case, you need to **run upgrade scripts from both your board and your computer**. +You will need the following software installed on your computer: -### **Commands to be run on the board** +1. [Python 3](https://www.python.org/downloads), if it's not directly available through your OS distributor +2. [PySerial](https://pythonhosted.org/pyserial/pyserial.html#installation) + +You will also need to download the following Python scripts: [https://github.com/pycom/pycom-libraries/lib/sqnsupgrade](https://github.com/pycom/pycom-libraries/lib/sqnsupgrade) + +First, you need to prepare your modem for upgrade mode by using the following commands: + +### **Commands to run on the Pycom module** ```python import sqnsupgrade sqnsupgrade.uart(True) ``` -After this command is executed a message will be displayed asking you to close the port +After this command is executed a message will be displayed asking you to close the port. ```text Going into MIRROR mode... please close this terminal to resume the upgrade via UART ``` -You should close the terminal and run the following commands from your computer: +### **Commands to be run on your computer** -### **Commands to be run on your** computer +You must close the terminal/Atom or Visual Studio Code console to run the following commands from your computer: -Please note that you need to do these steps **before running the script on your computer:** - -* Have [Python 3](https://docs.python-guide.org/starting/installation/) installed on your computer -* Install [`Pyserial`](https://github.com/pyserial/pyserial#installation) package for Python 3 using [pip](https://pip.pypa.io/en/stable/installing/) - -Now, you have to download the Sequans upgrade scripts from GitHub: [https://github.com/pycom/sqnsupgrade](https://github.com/pycom/sqnsupgrade.git) - -Go to the directory and run the following commands in terminal: +Go to the directory where you saved the `sqnsupgrade` scripts run the following commands in terminal ```python $ python3 @@ -84,29 +174,10 @@ Python 3.6.5 (default, Apr 25 2018, 14:23:58) Type "help", "copyright", "credits" or "license" for more information. >>> >>> import sqnsupgrade ->>> sqnsupgrade.run('Serial_Port', './fw/.dup', './fw/updater.elf') +>>> sqnsupgrade.run('Serial_Port', '/path/to/CATM1-38638.dup', '/path/to/updater.elf') ``` -Once the update is finished successfully, you will have a summary of the new updated versions, something like this: +## Retrying process -```text -SYSTEM VERSION -============== - FIRMWARE VERSION - Bootloader0 : 5.1.1.0 [33080] - Bootloader1 : 5.1.1.0 [38638] - Bootloader2* : 5.1.1.0 [38638] - NV Info : 1.1,0,0 - Software : 5.1.1.0 [38638] by robot-soft at 2018-08-20 09:51:46 - UE : 5.0.0.0d - COMPONENTS - ZSP0 : 1.0.99-13604 - ZSP1 : 1.0.99-12341 -``` - -## **Retrying process** - -In case of any failure or interruption to the process of LTE modem upgrade, you can repeat the same steps **after doing a hard reset to the board \(i.e. disconnecting power and connect again\), normal reset is not enough.** - -In case of upgrade via UART, there is a change to the command that you should run on the board. Instead of `sqnsupgrade.uart(True)`, you should use `sqnsupgrade.uart(True, retry=True)` +In case of any failure or interruption to the process of LTE modem upgrade you can repeat the same steps **after doing a hard reset to the board \(i.e disconnecting and reconnecting power\), pressing the reset button is not enough.**