Flash Quectel 5G/4G modem m.2

Hi everybody ,

Board : Banana BPI-R4 (5G modem)
Modem: Quectel RM551,,,, RM520
PC system i have : Windows

I remember there was way to flash Quectel modems by OpenWRT but now i don't see it anymore (Qfirehose)

Is there steps or package to flash modem by OpenWRT system without going to purchase new m.2 board to USB

I appreciate if you can help or advise .

Don't hesitate to search:

Thank you @AndrewZ
I searched and I read this subject before and I already tried what he mentioned (used ROOter system) and I don't understand very well your point .. (so take me as noob :smirk:)

I switched to ROOter system to try Qfirehose but didn't work

on ROOter forum
https://whrl.pl/RgMpZz

Now : I'm using OpenWRT SnapShot

, I mentioned my system is Windows . I know how to flash modem when its connected on m.2 USB board ... but right now I don't have it ... only I have The OpenWRT BPI-R4 Device

Can anyone help to extract IPK (opkg) or APK file from this github repo so I can use it to flash the modem , Quectel team mentoined to use Qfirehose V1.4.17 place of V1.4.9

or this link from Quectel team

https://forums.quectel.com/t/how-to-upgrade-module-thru-linux-qfirehose/15556/15?u=majid_alzahrani

Download link for Linux

Any support in this subject

( I tried to build the image from zero with adding this

qfirehose file by Quectel
https://cnquectel-my.sharepoint.com/personal/america-fae_quectel_com/_layouts/15/onedrive.aspx?id=%2Fpersonal%2Famerica-fae_quectel_com%2FDocuments%2F02-Tool%2FQFirehose_Linux_Android%2FQFirehose_Linux_Android_V1.4.17.zip&parent=%2Fpersonal%2Famerica-fae_quectel_com%2FDocuments%2F02-Tool%2FQFirehose_Linux_Android&ga=1
but I think I didn't do it by right way every time i'm getting msg saying qfirehose failed to build

maybe the makefile is wrong what gave me chatgpt ,,, becuase chatgpt saying I need to change makefile so to complie with openwrt

 make[3] -C package/boot/arm-trusted-firmware-mediatek compile
 make[3] -C feeds/packages/libs/libudev-zero compile
    ERROR: package/utils/qfirehose failed to build.
 make[3] -C package/boot/arm-trusted-firmware-mediatek compile
 make[3] -C package/boot/arm-trusted-firmware-mediatek compile

Thanks

Update ,,,,

I found makefile ready on google for QFirehose and I copied and paste it (the build passed ) but the issue its for 1.4.9 :cry: and the files for Qfirehose I added to openwrt was V1.4.17

Source:

include $(TOPDIR)/rules.mk

PKG_NAME:=qfirehose
PKG_VERSION:=1.4.9
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/nippynetworks/qfirehose/tar.gz/$(PKG_VERSION)?
PKG_HASH:=b7c04f9356823c6ee0f4ca152e8fd2015f34b95490cea68461a060993befadef

PKG_MAINTAINER:=Oskari Rauta <oskari.rauta@gmail.com>
PKG_LICENSE:=
PKG_LICENSE_FILES:=NOTICE

include $(INCLUDE_DIR)/package.mk

define Package/qfirehose
  SECTION:=utils
  CATEGORY:=Utilities
  TITLE:=Quectel Firehose Recovery application
  URL:=https://github.com/nippynetworks/qfirehose
endef

define Package/qfirehose/description
  Utility that is able to flash firmwares on Quectel's modems.
  Usage: qfirehose -f FW_PATH
  
  Warning.

   - Use of software is completely on your own risk.
     Flashing wrong firmware or failed flash can brick your modem permanently.
     Avoid flashing, if device works without issues and updated firmware does not contain new necessary changes.
     Do not flash, if you are not willing to take this risk or do not know what you are doing.

   - After succesful flashing, you should use terminal to issue factory reset for modem settings with AT&F command.

   - mPCIe users (mostly): If modem has completely disappeared after succesful flashing, reason might be that some firmware updates
     set default mode to USB3 which is unsupported by some mPCIe slots, in this case, you should connect it to USB
     port using mPCIe -> USB adapter, even most of cheap chinese modules can reveal device. After this you should issue
     a command to use USB2, which may vary between models, but on most Quectel modems is: AT+QUSBCFG="SS",0
     Changing value on end of AT command 0 to 1, selects USB3 instead. Refer to documents of your modem.
endef

define Build/Configure
	$(RM) $(PKG_BUILD_DIR)/QFirehose
endef

MAKE_ARGS += linux

define Package/qfirehose/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/QFirehose $(1)/usr/bin/qfirehose
endef

$(eval $(call BuildPackage,qfirehose))

any proposal

Here the version 1.4.17. QFirehose V1.4.17. Here the ipk i tried compiled QFirehost IPK

1 Like

Hi @hideyuki

Thank you so much for your efforts... I spoke with Quectel team they told me to use new Qfirehose
V1.V.4.21

I got the new version on Qfirehose from Quectel team
Qfirehose V1.4.21

Or from this link
https://forums.quectel.com/uploads/default/original/3X/9/f/9fc8d3a449c9780e4a3fed262e80129e89d27ef0.zip

Can you look to this to help


I tried QFirehose V1.4.17 is not working , I think because of that Quectel proposed to use QFirehose V1.4.21

root@OpenWrt:~# QFirehose -f /mnt/sda1/firmware
[000.000]: Version: QFirehose_Linux_Android_V1.4.17
[000.000]: Builded: Dec 23 2024 00:55:35
[000.019]: Find md5 check file </mnt/sda1/firmware/md5.txt>
[002.675]: md5 checking: /mnt/sda1/firmware/update/NON-HLOS.ubi pass
[002.682]: md5 checking: /mnt/sda1/firmware/update/abl.elf pass
[002.688]: md5 checking: /mnt/sda1/firmware/update/aop.mbn pass
[002.689]: md5 checking: /mnt/sda1/firmware/update/aop_devcfg.mbn pass
[002.690]: md5 checking: /mnt/sda1/firmware/update/apdp.mbn pass
[003.788]: md5 checking: /mnt/sda1/firmware/update/boot.img pass
[003.789]: md5 checking: /mnt/sda1/firmware/update/cdt.bin pass
[003.807]: md5 checking: /mnt/sda1/firmware/update/cmnlib64.mbn pass
[003.810]: md5 checking: /mnt/sda1/firmware/update/cpucp.elf pass
[003.812]: md5 checking: /mnt/sda1/firmware/update/devcfg.mbn pass
[003.829]: md5 checking: /mnt/sda1/firmware/update/firehose/partition_complete_p                              4K_b256K.mbn pass
[003.829]: md5 checking: /mnt/sda1/firmware/update/firehose/patch_p4K_b256K.xml                               pass
[003.885]: md5 checking: /mnt/sda1/firmware/update/firehose/prog_firehose_sdx7x.                              elf pass
[003.885]: md5 checking: /mnt/sda1/firmware/update/firehose/rawprogram_nand_p4K_                              b256K_update.xml pass
[003.888]: md5 checking: /mnt/sda1/firmware/update/fw_ipa_gsi_6.0_p.elf pass
[003.926]: md5 checking: /mnt/sda1/firmware/update/hypvm.mbn pass
[003.935]: md5 checking: /mnt/sda1/firmware/update/km41.mbn pass
[003.936]: md5 checking: /mnt/sda1/firmware/update/multi_image.mbn pass
[003.936]: md5 checking: /mnt/sda1/firmware/update/multi_image_qti.mbn pass
[003.961]: md5 checking: /mnt/sda1/firmware/update/oemapp.ubi pass
[003.977]: md5 checking: /mnt/sda1/firmware/update/oemdata.ubi pass
[003.978]: md5 checking: /mnt/sda1/firmware/update/partition.mbn pass
[003.979]: md5 checking: /mnt/sda1/firmware/update/partition_nand.xml pass
[003.981]: md5 checking: /mnt/sda1/firmware/update/qupv3fw.elf pass
[004.430]: md5 checking: /mnt/sda1/firmware/update/recoveryfs.ubi pass
[004.432]: md5 checking: /mnt/sda1/firmware/update/shrm.elf pass
[006.175]: md5 checking: /mnt/sda1/firmware/update/sysfs.ubi pass
[006.231]: md5 checking: /mnt/sda1/firmware/update/tz.mbn pass
[006.308]: md5 checking: /mnt/sda1/firmware/update/uefi.elf pass
[006.430]: md5 checking: /mnt/sda1/firmware/update/usrdata.ubi pass
[006.437]: md5 checking: /mnt/sda1/firmware/update/xbl_config.elf pass
[006.458]: md5 checking: /mnt/sda1/firmware/update/xbl_ramdump.elf pass
[006.499]: md5 checking: /mnt/sda1/firmware/update/xbl_s_nand.melf pass
[006.499]: Totals checking 33 files md5 value, 0 file fail!
[006.500]: find 'prog_firehose_sdx7x.elf'
[006.500]: find_firehose_mbn prog_firehose_sdx7x.elf
[006.500]: [1] /sys/bus/usb/devices/2-1.1 2c7c/122/515
[006.501]: qusb_read_speed_atime speed: 5000, st_atime: 20241226_16:03:06
[006.501]: P: /dev/bus/usb/002/003 idVendor=2c7c idProduct=0122
[006.501]: C: /dev/bus/usb/002/003 bNumInterfaces: 6
[006.501]: I: If#= 0 Alt= 0 #EPs= 2 Cls=ff Sub=ff Prot=30
[006.501]: E: Ad=01 Atr=02 MxPS= 1024 Ivl=0ms
[006.501]: E: Ad=81 Atr=02 MxPS= 1024 Ivl=0ms
[006.501]: I: If#= 1 Alt= 0 #EPs= 2 Cls=ff Sub=00 Prot=00
[006.501]: E: Ad=82 Atr=02 MxPS= 1024 Ivl=0ms
[006.501]: E: Ad=02 Atr=02 MxPS= 1024 Ivl=0ms
[006.501]: I: If#= 2 Alt= 0 #EPs= 3 Cls=ff Sub=00 Prot=00
[006.501]: E: Ad=84 Atr=03 MxPS= 10 Ivl=9ms
[006.501]: E: Ad=83 Atr=02 MxPS= 1024 Ivl=0ms
[006.501]: E: Ad=03 Atr=02 MxPS= 1024 Ivl=0ms
[006.501]: I: If#= 3 Alt= 0 #EPs= 3 Cls=ff Sub=00 Prot=00
[006.501]: E: Ad=86 Atr=03 MxPS= 10 Ivl=9ms
[006.501]: E: Ad=85 Atr=02 MxPS= 1024 Ivl=0ms
[006.501]: E: Ad=04 Atr=02 MxPS= 1024 Ivl=0ms
[006.501]: I: If#= 10 Alt= 0 #EPs= 1 Cls=02 Sub=06 Prot=00
[006.501]: I: If#= 11 Alt= 0 #EPs= 0 Cls=0a Sub=00 Prot=00
[006.501]: I: If#= 11 Alt= 1 #EPs= 2 Cls=0a Sub=00 Prot=00
[006.501]: tmp=/sys/bus/usb/devices/usb2/../driver, driver=../../../../bus/platform/drivers/xhci-mtk
[006.501]: qusb_noblock_open port_name = /dev/ttyUSB0
[009.508]: poll_wait events=POLLIN msec=3000 timeout
[009.508]: qfirehose.c detect_and_judge_module_version 250 fail
[010.509]: poll_wait events=POLLIN msec=1000 timeout
[010.509]: switch to 'Emergency download mode'
[010.514]: successful, wait module reboot
[011.515]: fail to fopen /sys/bus/usb/devices/2-1.1/uevent, errno: 2 (No such file or directory)
[012.515]: P: /dev/bus/usb/002/004 idVendor=05c6 idProduct=9008
[012.515]: C: /dev/bus/usb/002/004 bNumInterfaces: 1
[012.515]: I: If#= 0 Alt= 0 #EPs= 2 Cls=ff Sub=ff Prot=11
[012.515]: E: Ad=81 Atr=02 MxPS= 1024 Ivl=0ms
[012.515]: E: Ad=01 Atr=02 MxPS= 1024 Ivl=0ms
[012.515]: tmp=/sys/bus/usb/devices/usb2/../driver, driver=../../../../bus/platform/drivers/xhci-mtk
[012.515]: usbfs_is_kernel_driver_alive find interface 0 has match the driver qcserial
[012.529]: usbfs_detach_kernel_driver detach kernel driver success
[012.529]: <=== Q_SAHARA_ONE
[012.529]: Q_SAHARA_TWO ===>
[012.532]: <=== Q_SAHARA_EIGHTEEN
[012.532]: 0x0000000d 0x00000000 0x00000000
[017.570]: inf[0] ep_in -1/4096, errno = 110 (Operation timed out), timeout=5000
[017.570]: qusb_noblock_read read=0, errno: 110 (Operation timed out)
[017.570]: qusb_noblock_read cur=0, min_size=1
[017.570]: Sahara protocol error
[017.570]: Upgrade module failed.


Quectel shared this
Qfirehose V1.4.20(If version V.1.4.21 didn't work)
https://forums.quectel.com/uploads/short-url/1oS9G6ltjuVEN7XoRBGXoPj1aOx.zip

Or from this link

Qfirehose flashing support for Quectel modems on OpenWRT appears less accessible now. You can still communicate with modems using uqmi or mbimcli, but direct firmware flashing may require custom scripts or older builds with Qfirehose. Without these, an M.2 to USB adapter might still be necessary for reliable flashing.

@Yusuf6411
thank you Dear for your participation
I have m.2 board i'm using it for Flash modem ... but I know people they don't have m.2 board ... or they can't buy another boards ....

My target is to support these peoples so they can use this board OpenWRT to flash theirs modem ...

Maybe we can success with support people like our Dear @hideyuki developed ipk for this QFirehose ... Already I share Qfirehose V21 and V20
where hideyuki is working on it ....

if other people are interesting to share their feedback or image with this QFirehose i'm ready to test it