Unable to update GPy modem firmware



  • Hello,
    I'm having trouble updating the GPy modem firmware for the first time.

    Short version:
    I get error: "Received ERROR from AT+SMSWBOOT=0,1! Aborting!"

    Long version:
    I bought a Pysense and GPy (+antenna).
    I successfully updated the Pysense firmware to version 0.0.8 with dfu-util.
    I successfully updated the GPy module firmware to version v1.18.1.r1 and v1.18.1.r4 with the firmware upgrade tool.
    I've tried to update the GPy modem firmware with Atom/Pymakr.
    I have tried on a Ubuntu 18.04 and a windows 10 machine.
    I tried both 'Via SD card' and 'Via UART Serial Interface' instructions, same result.

    With v1.18.1.r1, bootrom is updated fine but after "Attempting AT auto-negotiation...", there is a long wait (several minutes) until the process apparently times-out. Repeated attempts after a hard reset give the exact same result.

    >>> sqnsupgrade.run('/sd/NB1-38729.dup', '/sd/updater.elf')
    <<< Welcome to the SQN3330 firmware updater >>>
    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...
    ERROR sending AT command... no response? b''
    AT auto-negotiation failed! Exiting.
    Unable to load updater from /sd/updater.elf
    >>>
    

    Now, with the new v1.18.1.r4, the update fails already at the bootrom phase with error: "Received ERROR from AT+SMSWBOOT=0,1! Aborting!".

    >>> from machine import SD
    >>> sd = SD()
    >>> os.mount(sd, '/sd')
    >>> os.listdir('/sd')
    ['CATM1-38638.dup', 'updater.elf']
    >>> import sqnsupgrade
    >>> sqnsupgrade.run('/sd/CATM1-38638.dup', '/sd/updater.elf')
    <<< Welcome to the SQN3330 firmware updater [1.2.0] >>>
    >>> GPy with firmware version 1.18.1.r4
    Attempting AT wakeup...
    Session opened: version 1, max transfer 8192 bytes
    Sending 55498 bytes: [########################################] 100%
    Received ERROR from AT+SMSWBOOT=0,1! Aborting!
    Unable to upgrade bootrom.
    Unable to load updater from /sd/updater.elf
    >>>
    

    I am able to send AT commands to the current CAT-M1 firmware the module shipped with, and it seems to be responding normally to them:

    >>> os.uname()
    (sysname='GPy', nodename='GPy', release='1.18.1.r4', version='v1.8.6-849-dfa1176 on 2018-11-12', machine='GPy with ESP32')
    
    >>> lte.send_at_cmd('ATI')
    SEQUANS Communications
    VZM20Q
    UEUnknown
    OK
    
    >>> lte.send_at_cmd('AT!="setDbgPerm full"')
    AT!="setDbgPerm full"
    OK
    
    >>> lte.send_at_cmd('AT!="showCaps"')
    AT!="showCaps"
    == CAPS config =============================
      .Lock UE on SRV band    : false
      .MFBI support           : true
      .TM8 TDD support        : false
    ============================================
    == CAPS ====================================
      . Access Stratum: R13
      . catM          : 1
    -- EUTRA bands --
      . supported     : 28/20/13/12/4/3
      . board         : 3/4/12/13/20/28
      . admin         :
      . pending admin :
    -- EUTRA carriers --
      . admin         :
      . pending admin :
    ============================================
    OK
    

    Any help would be appreciated.



  • @redferne

    A) Try the: Boot modes and safe boot
    FiPy Pin Layout

    Hook it up to Board (PyTrack/PySense/Expansion/PyScan...) ... and shorten 3V3 + P12 with a wire for 7-9 sec ... and let go

    B) Use the "upgdiff_33080-to*.dup" ... for the LTE-NB1 it is, and resp use the LTE-CATM1 version in the folder ...

    sqnsupgrade.run('/sd/upgdiff_33080-to-40343.dup',  debug=True)
    

    C) I haven't done this myself, but if I had the issue you have, I'd try to connect to the LTE-Modem by creating my own UART instance ...

    https://docs.pycom.io/firmwareapi/pycom/machine/uart.html

    Use the info from: https://github.com/pycom/pycom-micropython-sigfox/tree/master/esp32/lte

    To figure out how to conf the UART instance ...

    and lastly figure out how to send it the following AT_Command:

    "AT!=\"setlpm airplane=1 enable=1\""
    

    This will shut the modem down ... and after a Hard-reset (unplug everything, battery and usb-cable!) ... try to:

    from network import LTE
    lte = LTE()
    

    and then run the firmware process ...



  • Was given a FiPY which had failed a modem upgrade. I have now tried almost every trick in the book and cannot get any life signs from the modem:

    
    >>> import pycom
    >>> print(pycom.lte_modem_en_on_boot())
    False
    
    >>> os.uname()
    (sysname='FiPy', nodename='FiPy', release='1.18.1.r1', version='v1.8.6-849-b0520f1 on 2018-08-29', machine='FiPy with ESP32', lorawan='1.0.2', sigfox='1.0.1')
    
    >>> sqnsupgrade.run('/sd/CATM1-39529.dup', '/sd/updater.elf', debug=True)
    File /sd/updater.elf has size 429340
    File /sd/CATM1-39529.dup has size 6059510
    Modem state: None
    Resume: False Retry: False
    <<< Welcome to the SQN3330 firmware updater >>>
    mirror? False  recover? False  resume? False  direct? False  atneg_only? False bootrom? True
    Initial prepartion complete...
    Loading built-in recovery bootrom
    Attempting AT wakeup...
    b''
    count=1
    b''
    count=2
    b''
    count=3
    b''
    count=4
    b''
    count=5
    b''
    count=6
    b''
    count=7
    b''
    count=8
    b''
    count=9
    b''
    count=10
    b''
    Unable to upgrade bootrom.
    

    It is not possible to create a LTE() instance, the board simply hangs. Any ideas?



  • @bqpd

    You are welcomed :-)



  • @florianrdt said in Unable to update GPy modem firmware:

    from network import LTE
    lte = LTE()

    hmm, if you can't do that ... then I think there is an issue with our board / modem ...

    What is our "main board?" ... a PySense, PyTrack or PyScan? ... you are using with your GPy?

    And ...

    • did you update the firmware on the "main board"?
    • did you update the firmware on the GPy?

    As it's most recommended that you

    • 1st - update the firmware on the "main board" to the latest
    • 2nd - update the firmware on the "Logic board" .. GPy in your case ... to the latest stable version.


  • @ktleh @wtrocel @Paul-Thornton @combaindeft
    It works now for me as well!

    So following the steps @combaindeft suggested did indeed result in a successful upgrade of the firmware.
    One slight change: if using the upgdiff-file the updater.elf is not needed as @Paul-Thornton said, so for me (using an SD card)

    sqnsupgrade.run('/sd/upgdiff_33080-to-40343.dup',  debug=True)
    

    worked perfectly fine.
    (Update paused at 96% for about 15 seconds as described in the guide at https://docs.pycom.io/tutorials/lte/firmware.html - whole upgrade took about 5-7 minutes)

    So the whole process was:

    >>> from network import LTE
    >>> lte = LTE()
    >>> import pycom
    >>> print(pycom.lte_modem_en_on_boot())
    False
    >>> lte.reset()
    >>> lte.disconnect()
    >>> lte.dettach()
    >>>
    >>> lte.send_at_cmd('AT')
    '\r\nOK\r\n'
    >>> lte.send_at_cmd('ATI')
    '\r\nSEQUANS Communications\r\nVZM20Q\r\n'
    >>> lte.send_at_cmd('ATZ')
    '\r\nOK\r\n'
    >>> lte.reset()
    

    Hard Reset

    >>> from machine import SD
    >>> sd = SD()
    >>> os.mount(sd, '/sd')
    >>> os.listdir('/sd')
    ['NB1-40343.dup', 'updater.elf', 'upgdiff_33080-to-40343.dup', 'upgdiff_38729-to-40343.dup']
    >>> import sqnsupgrade
    >>> sqnsupgrade.run('upgdiff_33080-to-40343.dup', debug=True)
    

    This first upgrade took about 3-5 minutes -> it resulted in:

    SYSTEM VERSION
    ==============
      FIRMWARE VERSION
        Bootloader0  : 5.1.1.0 [33080]
        Bootloader1  : 6.0.0.0 [40343]
        Bootloader2* : 5.1.1.0 [38638]
        NV Info      : 1.1,0,0
        Software     : 6.0.0.0 [40343] by robot-soft at 2018-11-07 13:57:00
        UE           : 6.0.0.0
      COMPONENTS
        ZSP0         : 1.0.99-3171
        ZSP1         : 1.0.98-3170
    

    I then did the full update without using the differential file:

    >>> time.sleep(5)
    >>> sqnsupgrade.run('/sd/NB1-40343.dup', debug=True)
    >>> sqnsupgrade.info()
    <<< Welcome to the SQN3330 firmware updater [1.2.1] >>>
    >>> FiPy with firmware version 1.18.1.r7
    Your modem is in application mode. Here is the current version:
    UE6.0.0.0
    LR6.0.0.0-40343
    

    Thousand thanks to @combaindeft again for the great hint with the LTE.disconnect/reset/dettach
    This hint should be added to the renewed version of the upgrade guide.



  • @combaindeft Thanks a lot for the in-depth step-by-step walkthrough! I will try this tomorrow, when I get my NB-IoT SIM-card back and i will share if it works for me as well.

    I really appreciate your help, thanks again!



  • @combaindeft said in Unable to update GPy modem firmware:

    STEP THREE

    from network import LTE
    lte = LTE()

    Thank you for your reply, but unfortunately the command freezes again.

    import pycom
    print(pycom.lte_modem_en_on_boot())
    

    was already set to False.



  • @florianrdt said in Unable to update GPy modem firmware:

    @combaindeft I can't try this because I can't initialize the LTE object. The comand freeze.

    Step 1)

    ###
    ### STEP ONE
    ###
    import pycom
    print('LOG: pycom.lte_modem_en_on_boot() # to check, should be False')
    print(pycom.lte_modem_en_on_boot()) # to check, should be False
    
    print('LOG: pycom.lte_modem_en_on_boot(0) #set to False if above command is True')
    print(pycom.lte_modem_en_on_boot(0)) #set to False if above command is True
    
    print('LOG: pycom.lte_modem_en_on_boot() # to check again if change was made')
    print(pycom.lte_modem_en_on_boot()) # to check again if change was made
    
    

    Step 2)

    • A) It is imperative that you do a "HARD" reset of the board!
      DO NOT PRESS THE "RESET" BUTTON ON THE BOARD

    • B) To do a "HARD" reset:

      • Un-plug any battery source you might have attached!
      • Un-plug the USB-mini cable from the board
      • wait a few seconds
      • Re-attach the USB-mini to power up the device
      • continue to Step 3)

    Step 3)

    ###
    ### STEP THREE
    ###
    from network import LTE
    lte = LTE()
    lte.reset()
    lte.disconnect()
    lte.dettach()
    
    # few AT commands to check if modem is alive and responsive
    lte.send_at_cmd('AT') 
    lte.send_at_cmd('ATI')
    lte.send_at_cmd('ATZ')
    

    If you got back your LTE() ... done the "Reset", "Disconnect" and "Dettach" ... and could execute the AT commands... continue to Step 3a) or 3b) in https://forum.pycom.io/topic/4022/unable-to-update-gpy-modem-firmware/24



  • @bqpd said in Unable to update GPy modem firmware:

    @combaindeft Wait, so DID your upgrade of the sequans modem on the FiPy (where it failed in the first place) succeed AFTER you did:

    lte.reset()
    lte.disconnect()
    lte.dettach()
    

    Affirmative! ...

    I couldn't get it to update the modem firmware ... and I read somewhere, that the update firmware function won't work if the modem is in "active mode" ... ergo I tired to Reset, disconnect and dettach it ... and followed by a reboot (I did a reboot, just to make sure...) ... I could update the firmware of the modem.

    or did i misunderstand you and it is still not working?

    No, It is working superfine now :-)

    Sadly i have no SIM-card at the moment so i can't test it myself for the next few days.
    Did it actually work in the end just doing sqnsupgrade.run('NB1-40343.dup', debug=True) even without using the update.elf file after you did the lte.reset()?

    @combaindeft said in Unable to update GPy modem firmware:

    We bought a bunch of FiPy's ... and one one of them, had the same issue.
    ...
    but that didn't work, so I just ran

    sqnsupgrade.run('NB1-40343.dup', debug=True)
    

    Step 1)

    lte.reset()
    lte.disconnect()
    lte.dettach()
    

    Step 2)
    reboot the device.

    Step 3a) identify if this is the ABSOLUTE 1ST TIME that you are updating the modem firmware

    sqnsupgrade.run('upgdiff_33080-to-40343.dup', 'updater.elf', debug=True)
    time.sleep(5)
    sqnsupgrade.run('NB1-40343.dup', debug=True)
    

    Step 3b) - if not 3a) ... That is, it this isn't the 1st time you are updating the modem's firmware

    sqnsupgrade.run('NB1-40343.dup', 'updater.elf', debug=True)
    time.sleep(5)
    sqnsupgrade.run('NB1-40343.dup', debug=True)
    

    Step 4) if 3a) and 3b) both fail ... by this point you might try this step too ...

    sqnsupgrade.run('NB1-40343.dup', debug=True)
    

    ... and yes ... since 3a) and 3b) failed me ... i did Step 4) as I didn't have anything to loose ...and it worked *yay-me*

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Lastly - a tiny explanation - as may be asking yourselves "Why do you run two firmware updates after each other?!?!?" - in Step 3a) & 3b) ....

    As explained in the "Modem Firmware Update" in the docs: https://docs.pycom.io/tutorials/lte/firmware.html

    "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."



  • @combaindeft I can't try this because I can't initialize the LTE object. The comand freeze.



  • @combaindeft Wait, so DID your upgrade of the sequans modem on the FiPy (where it failed in the first place) succeed AFTER you did:

    lte.reset()
    lte.disconnect()
    lte.dettach()
    

    or did i misunderstand you and it is still not working?
    Sadly i have no SIM-card at the moment so i can't test it myself for the next few days.
    Did it actually work in the end just doing sqnsupgrade.run('NB1-40343.dup', debug=True) even without using the update.elf file after you did the lte.reset()?

    @combaindeft said in Unable to update GPy modem firmware:

    We bought a bunch of FiPy's ... and one one of them, had the same issue.
    ...
    but that didn't work, so I just ran

    sqnsupgrade.run('NB1-40343.dup', debug=True)
    


  • @florianrdt

    did you try to reset the modem?

    lte.reset()
    lte.disconnect()
    lte.dettach()
    

    I had the same issues ... and it's because the modem has been turned / power off in "active" state ... and it remembers that as it saves it state to it's internal memory ...



  • @bqpd ok, thanks anyway for your support!



  • @florianrdt Hmm, I think the sqnupgrade.info() method also tries to create an instance of "LTE" and is also failing.
    Sorry I can't really help you. I hope your Sequans modem isn't bricked.
    Maybe the developer team has some better insights and can help you. As @Paul-Thornton said, they are looking into the whole modem firmware upgrade process in the near future.



  • @bqpd On the GPy it does

    >>> import sqnsupgrade
    >>> sqnsupgrade.info()
    <<< Welcome to the SQN3330 firmware updater [1.2.1] >>>
    >>> GPy with firmware version 1.18.1.r7
    Cannot determine modem state!
    

    The command took some while.



  • @florianrdt What does

    import sqnsupgrade
    sqnsupgrade.info()
    

    return to you?



  • Hi guys,
    I tried to update the modem firmware of my GPy, but failed.

    First I updated the firmware of the GPy with the Pycom Firmware Update Tool to version 1.18.1.r7.

    Then I followed the instructions in the documentation for the update via UART Serial Interface. I downloaded the file CATM1-39529.zip and uploaded the file updater.elf via FileZilla into the Flash of the GPy. I got an error message that the connection was interrupted by a timeout, but it seemed as if the file was successfully transferred. The file sizes matched.

    Then I started the update process on the Gpy

    >>> import sqnsupgrade
    >>> sqnsupgrade.uart(True,'/flash/updater.elf')
    

    After the message

    Going into MIRROR mode... please close this terminal to resume the upgrade via UART
    

    I started the update process on my computer:

     >>> import sqnsupgrade
     >>> sqnsupgrade.run('COM9', 'CATM1-39529.dup')
    <<< Welcome to the SQN3330 firmware updater >>>
    Attempting AT wakeup...
    

    I got a timeout error after about 5 minutes.

    After a hardreset of the GPy I restarted the update process on the GPy and got the following message:

    >>> import sqnsupgrade
    >>> sqnsupgrade.uart(True, '/flash/updater.elf')
    <<< Welcome to the SQN3330 firmware updater [1.2.1] >>>
    >>> GPy with firmware version 1.18.1.r7
    Could not detect your modem!
    Please try to power off your device and restart in safeboot mode.
    
    

    Currently, the LTE module can no longer be reached.

    >>> from network import LTE
    >>> lte = LTE()
    

    The command hangs. SIM card is inserted.

    In the forum I read already that the command

    pycom.lte_modem_en_on_boot(0)
    

    could help, but still the modem cannot be addressed.

    Can you help me?


  • Global Moderator

    @combaindeft Yup. Documentation is wrong. Ill get it updated to clarify.



  • @paul-thornton

    Hmmm, says the opposite on your docu - https://docs.pycom.io/tutorials/lte/firmware.html ...

    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.

    Please also use the file upgdiff_33080-to-39529.dup (1.2M) from the archive.

    import sqnsupgrade
    sqnsupgrade.run('upgdiff_33080-to-39529.dup', 'updater.elf')
    
    

    and then it says, you must run it a 2nd time ...

    sqnsupgrade.run('NB1-40343.dup', debug=True)
    

    ... and this is the the 1st time you ever update the modem firmware ...


 

Pycom on Twitter