Updating EM7565 on openwrt

Hi,
I have a similar problem, even though the debug output looks a bit different. I have issued the -U command from single-TTY mode, it’s an EM7565 and the current FW is rather old. I understand it may be easier to plug the modem into an USB adapter, but I’s like to do it in OpenWRT :wink:

[/dev/cdc-wdm0] Successfully retrieved current firmware:
	Model: EM7565
	Boot version: SWI9X50C_01.00.02.00
	AMSS version: SWI9X50C_01.00.02.00
	SKU ID: 1103520
	Package ID: unknown
	Carrier ID: 1
	Config version: unknown
# qmi-firmware-update -t /dev/ttyUSB0 -U SWI9X50C_01.14.02.00.cwe SWI9X50C_0
1.14.02.00_GENERIC_002.035_000.nvu  --ignore-mm-runtime-check --verbose
[18 Apr 2021, 20:48:30] [Debug] [qfu-image] loading file info...
[18 Apr 2021, 20:48:30] [Debug] [qfu-image] opening file for reading...
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe] reading image headers...
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe] image offset range: [0,80241623]
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   image offset range: [400,7360]
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe] image at offset 400 is valid
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   image offset range: [7360,411416]
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]     image offset range: [7760,14640]
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   image at offset 7760 is valid
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]     image offset range: [14640,411416]
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   image at offset 14640 is valid
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe] image at offset 7360 is valid
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   image offset range: [411416,39979141]
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]     image offset range: [411816,418776]
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   image at offset 411816 is valid
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]     image offset range: [418776,875492]
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   image at offset 418776 is valid
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]     image offset range: [875492,1043080]
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   image at offset 875492 is valid
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]     image offset range: [1043080,39979141]
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   image at offset 1043080 is valid
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe] image at offset 411416 is valid
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   image offset range: [39979141,80241623]
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]     image offset range: [39979541,39986501]
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   image at offset 39979541 is valid
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]     image offset range: [39986501,40437529]
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   image at offset 39986501 is valid
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]     image offset range: [40437529,72856949]
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   image at offset 40437529 is valid
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]     image offset range: [72856949,80241623]
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   image at offset 72856949 is valid
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe] image at offset 39979141 is valid
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe] validating data size...
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe] preloading firmware/config/carrier...
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   firmware version: 01.14.02.00
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   config version:   unknown
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   carrier:          unknown
[18 Apr 2021, 20:48:30] [Debug] [qfu-image] loading file info...
[18 Apr 2021, 20:48:30] [Debug] [qfu-image] opening file for reading...
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe] reading image headers...
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe] image offset range: [0,10159]
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   image offset range: [400,7680]
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]     image offset range: [800,7680]
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   image at offset 800 is valid
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe] image at offset 400 is valid
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   image offset range: [7680,10159]
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]     image offset range: [8080,10159]
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   image at offset 8080 is valid
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe] image at offset 7680 is valid
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe] validating data size...
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe] preloading firmware/config/carrier...
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   firmware version: 01.14.02.00
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   config version:   002.035_000
[18 Apr 2021, 20:48:30] [Debug] [qfu-image-cwe]   carrier:          GENERIC
[18 Apr 2021, 20:48:30] [Debug] [qfu-sahara-device] opening TTY: /dev/ttyUSB0
[18 Apr 2021, 20:48:30] [Debug] [qfu-sahara-device] setting terminal in raw mode...
[18 Apr 2021, 20:48:30] [Debug] [qfu-sahara-device] waiting time for device to boot properly...
[18 Apr 2021, 20:48:32] [Debug] [qfu-sahara-device] initializing sahara protocol...
[18 Apr 2021, 20:48:35] [Debug] [qfu-updater] sahara device creation failed: no sahara response received
[18 Apr 2021, 20:48:35] [Debug] [qfu-qdl-device] opening TTY: /dev/ttyUSB0
[18 Apr 2021, 20:48:35] [Debug] [qfu-qdl-device] setting terminal in raw mode...
[18 Apr 2021, 20:48:35] [Debug] [qfu,dload-message] sent sdp:
[18 Apr 2021, 20:48:35] [Debug] [qfu-qdl-device] >> 70:00:00 [3, unframed]
[18 Apr 2021, 20:48:35] [Debug] [qfu-qdl-device] >> 7E:70:00:00:14:46:7E [7]
[18 Apr 2021, 20:48:35] [Debug] [qfu-qdl-device] << 04:00:00:00:10:00:00:00:07:00:00:00:01:00:00:00 [16]
[18 Apr 2021, 20:48:35] [Debug] [qfu-updater] qdl device creation failed: HDLC trailing control character not found
error: unsupported download protocol```

This looks like a SAHARA transfer error with status code 1 - “invalid command”. But I can’t tell why from the log you sent. Maybe @aleksander0m knows what goes on here?

1 Like

This looks like the module didn’t reboot into download mode, and the ttyUSB0 you’re talking to is really DIAG/QCDM. In this state, does the module also expose the cdc-wdm port and the wwan port? That would confirm this assumption, as in download mode there is only one single port exposed.

Could you retry with the additional --override-download option? That should request to force downloading, even if all the images already exist in the module.

I seem to not be able to perform the reset operation anymore (it worked in my last attempt).

I tried:
root@LEDE:/mnt/tmp# qmicli -d /dev/cdc-wdm0 -p --dms-set-firmware-
preference=“01.00.02.00,001.012_000,GENERIC”
root@LEDE:/mnt/tmp# qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode=offline
[/dev/cdc-wdm0] Operating mode set successfully
root@LEDE:/mnt/tmp# qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode=reset
[/dev/cdc-wdm0] Operating mode set successfully

but the 3 ttyUSB interfaces don’t anymore disappear, I also tried:

root@LEDE:~# qmi-firmware-update -t /dev/ttyUSB0 -b --ignore-mm-runtime-check
error: reseter operation finished: couldn't run reset operation

but I keep on having the 3 ttyUSB devices ?!

On top --override-download doesn’t seem to be a known optione to “qmi-firmware-update”. qmi-firmware-update 1.24.12

1 Like

Tried once more (I didn’t even notice that the download mode was finally active), then it seemed to work, uploaded up to 9x %, but then:

root@LEDE:/mnt/sda1# cd /mnt/sda1;qmi-firmware-update -t /dev/ttyUSB0 -U SWI9X50C_01.14.02.00.cwe  SWI9X50C_01.14.02.00_GENERIC_002.035_000.nvu   --ignore-mm-runtime-check
downloading cwe image: SWI9X50C_01.14.02.00.cwe (80.2 MB)...
finalizing download... (may take several minutes, be patient)
error: error downloading image: couldn't teardown download: unexpected firehose response received: value=NAK, rawmode=false

Now I’m back to “unsupported download protocol”

I see that you are trying to update from a very old firmware. That means that the firmware actually doing the update is very old. It is known to be buggy. Read the release notes closely.

One bug that springs to mind was fixed in 01.05.03.00: “Fixed issue when downloading FW in Linux using USB 3.0”

I can’t find any info in the posts you’ve made, but maybe you’re trying this over a USB 3.0 link? That will not work. You need to force the link to USB 2.0 to be able to upgrade from anything older than 01.05.03.00 in my experience.

And then there is the red text in the release notes. Did you read appendix A? Note that a failure is expected in the process. You’ll probably have to manually adapt the OpenWrt process according to this.

I read at least the part about USB3.0 and the other problem with 1.09 FW. I don’t have an USB3 port, I’m using a GL-Inet Mifi device with m.2/mPCIe Adapter.

On the 1.09 problem the desciption says that it would work on the 2nd attempt. Strange enough that it worked “once almost”. I will read again, but what is meant with “manually” here ?

Any suggestion what I can do ?

Attempt to do the upgrade using older FW on a Windows Machine ?

Thanks.

Try repeating the update. What I meant by manual was just that the update tool won’t know that the first update is supposed to fail. So you will have to run it twice.

Yeah, the problem is that the procedure only started once totally by chance.

I gave in the moment I saw an m2/mPCIe Adapter lying around at work… Went through a couple of old versions using Win10. It was a bit too easy.
Sorry for not playing fair :wink:

Hello. I know this thread is quite old by now, but it seems like it identified a problem and never quite came to a solution (everyone seems to have just done it through Windows).

I am at approximately the same place as tmuhlhoff was. I set the preference and reset the modem so that it is in download mode, but when I use qmi-firmware-update to try and update it fails with unsupported download protocol

my output when run with -v
root@OpenWrt:/tmp# qmi-firmware-update -t /dev/ttyUSB0 -U 9999999_9907152_SWI9X0
7Y_02.37.03.00_00_GENERIC_002.095_000.spk -v
[09 Aug 2021, 22:16:43] [Debug] [qfu-utils] couldn't ping ModemManager: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.freedesktop.ModemManager1" does not exist
[09 Aug 2021, 22:16:43] [Debug] [qfu-image] loading file info...
[09 Aug 2021, 22:16:43] [Debug] [qfu-image] opening file for reading...
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe] reading image headers...
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe] image offset range: [0,28667074]
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]   image offset range: [400,421664]
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]     image offset range: [800,7680]
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]   image at offset 800 is valid
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]     image offset range: [7680,421664]
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]   image at offset 7680 is valid
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe] image at offset 400 is valid
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]   image offset range: [421664,28638204]
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]     image offset range: [422064,429024]
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]   image at offset 422064 is valid
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]     image offset range: [429024,952172]
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]   image at offset 429024 is valid
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]     image offset range: [952172,1112684]
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]   image at offset 952172 is valid
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]     image offset range: [1112684,28638204]
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]   image at offset 1112684 is valid
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe] image at offset 421664 is valid
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]   image offset range: [28638204,28667074]
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]     image offset range: [28638604,28645884]
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]       image offset range: [28639004,28645884]
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]     image at offset 28639004 is valid
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]   image at offset 28638604 is valid
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]     image offset range: [28645884,28666072]
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]       image offset range: [28646284,28666072]
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]     image at offset 28646284 is valid
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]   image at offset 28645884 is valid
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]     image offset range: [28666072,28667074]
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]       image offset range: [28666472,28667074]
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]     image at offset 28666472 is valid
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]   image at offset 28666072 is valid
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe] image at offset 28638204 is valid
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe] validating data size...
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe] preloading firmware/config/carrier...
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]   firmware version: 02.37.03.00
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]   config version:   002.095_000
[09 Aug 2021, 22:16:43] [Debug] [qfu-image-cwe]   carrier:          GENERIC
[09 Aug 2021, 22:16:43] [Debug] [qfu-sahara-device] opening TTY: /dev/ttyUSB0
[09 Aug 2021, 22:16:43] [Debug] [qfu-sahara-device] setting terminal in raw mode...
[09 Aug 2021, 22:16:43] [Debug] [qfu-sahara-device] waiting time for device to boot properly...
[09 Aug 2021, 22:16:45] [Debug] [qfu-sahara-device] initializing sahara protocol...
[09 Aug 2021, 22:16:48] [Debug] [qfu-updater] sahara device creation failed: no sahara response received
[09 Aug 2021, 22:16:48] [Debug] [qfu-qdl-device] opening TTY: /dev/ttyUSB0
[09 Aug 2021, 22:16:48] [Debug] [qfu-qdl-device] setting terminal in raw mode...
[09 Aug 2021, 22:16:48] [Debug] [qfu,dload-message] sent sdp:
[09 Aug 2021, 22:16:48] [Debug] [qfu-qdl-device] >> 70:00:00 [3, unframed]
[09 Aug 2021, 22:16:48] [Debug] [qfu-qdl-device] >> 7E:70:00:00:14:46:7E [7]
[09 Aug 2021, 22:16:48] [Debug] [qfu-qdl-device] << 04:00:00:00:10:00:00:00:07:00:00:00:01:00:00:00 [16]
[09 Aug 2021, 22:16:49] [Debug] [qfu-updater] qdl device creation failed: HDLC trailing control character not found
error: unsupported download protocol

Unfortunately there is no way I can just connect to windows and update like the others have. The modem I am using is a WP7611, which should still work as far as I know.

It may also be worth noting the the qmi-utils I’m using is based on the feed available OpenWrt 19.07.

Any help would be very welcome.

So here I’m necromancing this post for whoever might be stuck trying to upgrade a Sierra EM7455 Modem.

So I got an old Dell DW5811e card, which i first made recognize as a Sierra MC card using the following AT commands:

Using picocom to connect to the serial port of the modem
# picocom -b 19200 /dev/ttyUSB2

run these commands

AT!ENTERCND="A710"
AT!USBPID=9071,9070
AT!USBVID=1199
AT!USBPRODUCT="EM7455"
AT!PRIID="9904802","001.001","Generic-Laptop"
AT!RESET

Now the modem identifies as a non OEM Sierra EM7455 modem.

i’ve then tried to upgrade the firmware with the automatic solution, being:

deviceid=`lsusb | grep -i -E '1199:9071|1199:9079|413C:81B6' | awk '{print $6}'`
echo $deviceid
qmi-firmware-update --update -d "$deviceid" SWI9X30C_02.38.00.00.cwe SWI9X30C_02.38.00.00_GENERIC_002.082_000.nvu -L upgrade.log --ignore-mm-runtime-check

This did not work, giving me a error: unsupported download protocol error.
In the logs, I got [qfu-updater] qdl device creation failed: unexpected response received in dload sdp: 0x13
Since the modem has 3 serial ports, I probably didn’t talk to the one accepting upgrades.

That’s the tricky part, when the modem gets rebooted in download mode, there should only be one serial port (something like /dev/ttyUSB0) and no /dev/cdc-wdm0 device.
That actually happens, but qmi-firmware-update just waits for too long, and the modem reverts to non download mode. The firmware update them complains it can’t find sahara protocol, which is the update protocol…

I ended up making a manual update with 2 ssh sessions:
The first terminal shows which devices are up every second:

watch -n 1 "ls /dev/{cdc-*,ttyUSB*}"

On the second terminal, i ran the following:

qmicli -d /dev/cdc-wdm0 -p --dms-set-firmware-preference="firmware-version=02.38.00.00,config-version=002.082_000,carrier=Generic"
qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode=offline
qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode=reset

Now I just had to wait (about 45 seconds or so) until my first terminal showed me that only /dev/ttyUSB0 existed, than I could run the actual firmware update with:

qmi-firmware-update -t "/dev/ttyUSB0" -L upgrade.log --ignore-mm-runtime-check -U SWI9X30C_02.38.00.00.cwe SWI9X30C_02.38.00.00_GENERIC_002.082_000.nvu

FW download went well with


downloading cwe image: SWI9X30C_02.38.00.00.cwe (64.3 MB)...
finalizing download... (may take more than one minute, be patient)
successfully downloaded in 57.90s (1.1 MB/s)
downloading cwe image: SWI9X30C_02.38.00.00_GENERIC_002.082_000.nvu (23.9 kB)...
finalizing download... (may take more than one minute, be patient)
successfully downloaded in 0.08s (298.1 kB/s)
rebooting in normal mode...
firmware update operation finished successfully

For an unknown reason, I had to do the update twice on my modem for it to work, eg:

 qmicli --device=/dev/cdc-wdm0 --dms-swi-get-current-firmware
[/dev/cdc-wdm0] Successfully retrieved current firmware:
        Model: EM7455B
        Boot version: SWI9X30C_02.38.00.00
        AMSS version: SWI9X30C_02.38.00.00
        SKU ID: 1102565
        Package ID: unknown
        Carrier ID: 1
        Config version: 002.017_000

Hope this helps someone :wink:

1 Like