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

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.