[PATCH 0/2] preparing qmicli for firmware download support

Bjørn Mork bjorn at mork.no
Fri Aug 19 19:59:58 UTC 2016


Tang Nguyen <tang_nguyen at yahoo.com> writes:

> I am interest in testing the firmware download support feature on my
> product equipped with Sierra MC73xx. Is the code available in git
> repos yet, Bjon ?

Not really.  It's mostly an experiment living on my laptop for now.  But
it works, at least for the EM7455. I'm attaching the current code.  Feel
free to play with it.  And if anyone wants to make this into a real
application, then I would be very happy.

I've seen a few requests from e.g OpenWRT users needing this, but not
wanting the full overhead of the Sierra SDK.  Which is a good reason it
should probably be independent of libqmi (codewise - it could of course
live in the same repo). I thought about doing a full featured QMI+QDL
integration like the SDK does, but concluded that I don't want that.
Much better to create smaller building blocks and let some wrapper
application stitch it all together.

One thing I haven't yet figured out, is how to upload multiple files in
one session. When looking at my snoop logs, I found that I don't have
any showing such an session.  Trying to start another upload makes the
firmware return an error. I assume this is due to the same staging area
being used or something. There is probably a neat trick fixing it.

But for now, I've worked around this by repeating the

 set-firmware-pref
 reset
 download

until all (or both really - MODEM and PRI) images are
downloaded. Typical usage on EM7455 in MBIM mode. MC73xx in QMI
mode should be similar.  Just drop the "--device-open-mbim ";

#qmicli  -p -d /dev/cdc-wdm0   --device-open-mbim  --dms-set-firmware-pref=02.14.03.00,002.011_000,TELUS
[/dev/cdc-wdm0] Stored image successfully selected

        You may want to power-cycle the modem now, or just set it offline and reset it:
                $> sudo qmicli ... --dms-set-operating-mode=offline
                $> sudo qmicli ... --dms-set-operating-mode=reset

        You should check that the modem|pri image pair is valid by checking the current operating mode:
                $> sudo qmicli .... --dms-get-operating-mode
        If the Mode is reported as 'online', you're good to go.
        If the Mode is reported as 'offline' with a 'pri-version-incompatible' reason, you chose an incorrect pair

        After reset, the modem will wait in QDL mode for new firmware.
        Images to download: 'modem, pri'

#  qmicli -p -d /dev/cdc-wdm0   --device-open-mbim  --dms-set-operating-mode=reset
[/dev/cdc-wdm0] Operating mode set successfully

... wait for the modem to boot into QDL mode

# swi-update --serial /dev/ttyUSB0 /tmp/SWI9X30C_02.14.03.00.cwe
swi-update (0.02)
Got QDL version: 6
Downloading CWE image '/tmp/SWI9X30C_02.14.03.00.cwe'
  CWE revision: 3
  type: SPKG
  product: 9X30
  image size: 64316579
  version: INTERNAL_?_SWI9X30C_02.14.03.00_?_?_?_?
  date: 03/28/16
..............................................................
Waiting for last ack................
Success!
Terminating session - rebooting modem...


... wait for modem to boot into application mode

# /usr/local/src/git/libqmi/src/qmicli/qmicli  -p -d /dev/cdc-wdm0   --device-open-mbim  --dms-set-firmware-pref=02.14.03.00,002.011_000,TELUS
[/dev/cdc-wdm0] Stored image successfully selected

        You may want to power-cycle the modem now, or just set it offline and reset it:
                $> sudo qmicli ... --dms-set-operating-mode=offline
                $> sudo qmicli ... --dms-set-operating-mode=reset

        You should check that the modem|pri image pair is valid by checking the current operating mode:
                $> sudo qmicli .... --dms-get-operating-mode
        If the Mode is reported as 'online', you're good to go.
        If the Mode is reported as 'offline' with a 'pri-version-incompatible' reason, you chose an incorrect pair

        After reset, the modem will wait in QDL mode for new firmware.
        Images to download: 'pri'

#  qmicli -p -d /dev/cdc-wdm0   --device-open-mbim  --dms-set-operating-mode=reset
[/dev/cdc-wdm0] Operating mode set successfully

... wait for the device to boot into QDL mode

# ~bjorn/privat/prog/git/qdm/swi-update  --serial /dev/ttyUSB0 /tmp/SWI9X30C_02.14.03.00_Telus_000.005_000.nvu 
swi-update (0.02)
Got QDL version: 6
Downloading CWE image '/tmp/SWI9X30C_02.14.03.00_Telus_000.005_000.nvu'
  CWE revision: 3
  type: SPKG
  product: 9X30
  image size: 5470
  version: 9999999_9905152_SWI9X30C_02.14.03.00_00_TELUS_000.005_000
  date: 03/28/16
.
Waiting for last ack
Success!
Terminating session - rebooting modem...



I haven't tried this on any modem without gobi image management yet. The
download should work the same.  But the QMI procedure initiating a
download session will be different.

And since I used the gobi-loader for reference, I thought it would be
fun to make it work seemlessly as a replacement.  The version probing is
highly experimental, though.  Don't know if it works...


Bjørn


-------------- next part --------------
A non-text attachment was scrubbed...
Name: swi-update.c
Type: text/x-csrc
Size: 26502 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/libqmi-devel/attachments/20160819/fd3df884/attachment-0001.c>


More information about the libqmi-devel mailing list