EM7565 firmware upgrade in OpenWrt
Bjørn Mork
bjorn at mork.no
Tue Nov 19 11:23:02 UTC 2019
Thought I should try this now that I had an opportunity and a new
firmware...
Started with qmi-firmware-update as usual and noted that the "normal
mode" options are reduced to "reset" only. Tried that. But it results
in a "Set Firmware ID" with missing arguments and an unsupported "Set
Boot Image Download Mode":
[19 Nov 2019, 11:03:47] [Debug] [/dev/cdc-wdm0] sent generic request (translated)...
<<<<<< QMUX:
<<<<<< length = 12
<<<<<< flags = 0x00
<<<<<< service = "dms"
<<<<<< client = 8
<<<<<< QMI:
<<<<<< flags = "none"
<<<<<< transaction = 1
<<<<<< tlv_length = 0
<<<<<< message = "Set Firmware ID" (0x003E)
[19 Nov 2019, 11:03:47] [Debug] [/dev/cdc-wdm0] received message...
<<<<<< RAW:
<<<<<< length = 20
<<<<<< data = 01:13:00:80:02:08:02:01:00:3E:00:07:00:02:04:00:01:00:11:00
[19 Nov 2019, 11:03:47] [Debug] [/dev/cdc-wdm0] received generic response (translated)...
<<<<<< QMUX:
<<<<<< length = 19
<<<<<< flags = 0x80
<<<<<< service = "dms"
<<<<<< client = 8
<<<<<< QMI:
<<<<<< flags = "response"
<<<<<< transaction = 1
<<<<<< tlv_length = 7
<<<<<< message = "Set Firmware ID" (0x003E)
<<<<<< TLV:
<<<<<< type = "Result" (0x02)
<<<<<< length = 4
<<<<<< value = 01:00:11:00
<<<<<< translated = FAILURE: MissingArgument
[19 Nov 2019, 11:03:47] [Debug] [qfu-reseter] error: couldn't run 'set firmware id' operation: QMI protocol error (17): 'MissingArgument'
[19 Nov 2019, 11:03:47] [Debug] [qfu-reseter] trying boot image download mode...
[19 Nov 2019, 11:03:47] [Debug] [/dev/cdc-wdm0] sent message...
<<<<<< RAW:
<<<<<< length = 17
<<<<<< data = 01:10:00:00:02:08:00:02:00:50:00:04:00:01:01:00:01
[19 Nov 2019, 11:02:57] [Debug] [/dev/cdc-wdm0] sent generic request (translated)...
<<<<<< QMUX:
<<<<<< length = 16
<<<<<< flags = 0x00
<<<<<< service = "dms"
<<<<<< client = 8
<<<<<< QMI:
<<<<<< flags = "none"
<<<<<< transaction = 2
<<<<<< tlv_length = 4
<<<<<< message = "Set Boot Image Download Mode" (0x0050)
<<<<<< TLV:
<<<<<< type = "Mode" (0x01)
<<<<<< length = 1
<<<<<< value = 01
<<<<<< translated = boot-and-recovery
[19 Nov 2019, 11:02:57] [Debug] [/dev/cdc-wdm0] received message...
<<<<<< RAW:
<<<<<< length = 20
<<<<<< data = 01:13:00:80:02:08:02:02:00:50:00:07:00:02:04:00:01:00:39:00
[19 Nov 2019, 11:02:57] [Debug] [/dev/cdc-wdm0] received generic response (translated)...
<<<<<< QMUX:
<<<<<< length = 19
<<<<<< flags = 0x80
<<<<<< service = "dms"
<<<<<< client = 8
<<<<<< QMI:
<<<<<< flags = "response"
<<<<<< transaction = 2
<<<<<< tlv_length = 7
<<<<<< message = "Set Boot Image Download Mode" (0x0050)
<<<<<< TLV:
<<<<<< type = "Result" (0x02)
<<<<<< length = 4
<<<<<< value = 01:00:39:00
<<<<<< translated = FAILURE: Wms.InvalidMessageId
So I set the new preference using qmicli:
root at wrt1900ac-1:/tmp# qmicli -p -d /dev/cdc-wdm0 --dms-set-firmware-preference=01.11.00.00,002.023_000,GENERIC
[/dev/cdc-wdm0] Firmware preference 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
After reset, the modem will wait in QDL mode for new firmware.
Images to download: 'modem, pri'
And rebooted the modem (no need for "offline" here, I believe?):
root at wrt1900ac-1:/tmp# qmicli -p -d /dev/cdc-wdm0 --dms-set-operating-mode=reset
[/dev/cdc-wdm0] Operating mode set successfully
Then updating worked as normally in QDL mode:
root at wrt1900ac-1:/tmp# qmi-firmware-update -t /dev/ttyUSB4 -U SWI9X50C_01.11.00.00*
downloading cwe image: SWI9X50C_01.11.00.00.cwe (79.7 MB)...
finalizing download... (may take several minutes, be patient)
successfully downloaded in 115.31s (691.1 kB/s)
downloading cwe image: SWI9X50C_01.11.00.00_GENERIC_002.023_000.nvu (10.2 kB)...
finalizing download... (may take several minutes, be patient)
successfully downloaded in 0.06s (174.1 kB/s)
rebooting in normal mode...
firmware update operation finished successfully
This could be made a bit easier, I think. I realize that it's hard to
make it work perfectly, like on the desktop, without udev. But it would
be useful to have qmi-firmware-update set the correct new firmware
preference based on the provided image, instead of manually cutting and
pasting (and getting it wrong...).
And it would be nice to be able to select the target slot, which I don't
think qmicli supports? Not a problem for me right now since there were 3
empty slots. But I have often wanted to override the auto-selection
when all slots have been in use. Typically becasue I consider an older
firmware version stable, and want to replace a newer and less stable
version.
Bjørn
More information about the libqmi-devel
mailing list