PCIe only modems?

Do you have the QFirehose documentation for PCIe modems. The process is different and I am getting errors.

root@josh:~# qfirehose -p /dev/wwan0firehose0 -f /tmp/RM520NGLAAR01A08M4G_01.205.01.205
[000.000]: Version: QFirehose_Linux_Android_V1.4.9
[000.000]: Builded: Oct 31 2024 21:34:24
[000.000]: Find md5 check file </tmp/RM520NGLAAR01A08M4G_01.205.01.205/md5.txt>
[000.000]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/contents.xml pass
[000.002]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/abl.elf pass
[000.003]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/aop.mbn pass
[000.003]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/apdp.mbn pass
[000.003]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/devcfg_low_ddr.mbn pass
[000.003]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/devcfg.mbn pass
[000.003]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/firehose/partition_complete_p4K_b256K.mbn pass
[000.004]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/firehose/patch_p4K_b256K.xml pass
[000.007]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/firehose/prog_firehose_lite.elf pass
[000.008]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/firehose/rawprogram_nand_p4K_b256K_update.xml pass
[000.008]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/hyp.mbn pass
[000.008]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/ipa_fws.elf pass
[000.009]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/logfs_ufs_8mb.bin pass
[000.009]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/multi_image.mbn pass
[000.009]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/multi_image_qti.mbn pass
[000.444]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/NON-HLOS.ubi pass
[000.449]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/oemapp.ubi pass
[000.452]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/oemdata.ubi pass
[000.452]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/partition.mbn pass
[000.452]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/partition_nand.xml pass
[000.501]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/sdxlemur-boot.img pass
[000.579]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/sdxlemur-recoveryfs.ubi pass
[000.964]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/sdxlemur-sysfs.ubi pass
[000.969]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/tz.mbn pass
[000.980]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/uefi.elf pass
[001.003]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/usrdata.ubi pass
[001.003]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/xbl_config.elf pass
[001.007]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/xbl.elf pass
[001.008]: md5 checking: /tmp/RM520NGLAAR01A08M4G_01.205.01.205/update/xbl_ramdump.elf pass
[001.009]: Totals checking 29 files md5 value, 0 file fail!
[001.009]: Quectel module not found
[001.009]: qfirehose.c main 356 fail

I also ran into this issue. Any flash attempt done on Linux fails with missing prog_firehose_sdx55.mbn which is obviously incorrect for the modem.

I’ve been using Qflash with Windows which seems to work fine if the COM ports are visible. With the Lenovo firmware I found the Lenovo driver has a exe that forces edl with no com ports.

1 Like

Do you have a link to the Lenovo firmware, maybe it can be edited with the latest firmware.

For QFlash, are you able to use a USB-C PCIe adapter or does it need to be plugged into a m.2 slot on the motherboard?

Also do you have a link to QFlash for Windows 11 with instructions?

Sorry for all the questions!

1 Like

Let me know if you get anywhere with it. Extract it by running the exe. Once run it should create a C:\DRIVERS\WIN\RM520N\20240411.11500854 folder. Inside you should find the drivers in the raw INF form. Go to the FW folder and the upgrader and firmware are there.

There are 3 firmware versions in the zip.

  1. AAR03A03M4G - Generic version for all carriers
  2. AAR03A03M4G_JP - Japanese carrier firmware
  3. AAR03A20M4G - Verizon firmware with SA completely disabled and cannot be enabled with AT

Reminder to be careful with these firmware. I flashed one of my modules with it and is now unusable outside of Windows because there isn’t a non Lenovo firmware I found to successfully flash and have not received any firmware from Quectel yet. OpenWRT detects and connects to carrier once AT+QCFG="fcc_enable",0 is run but fails DHCP. I get QMUX 0x46 errors when this happens.
I would recommend staying on the default old firmware but I get constant hiccups which is unacceptable.

The firmware upgrade tool FWUpgradeToolRM520NGL.exe acts like Qfirehose but for Windows. The Lenovo driver calls this when it detects a MNC and matches with ImageInfo.xml.

So far I’ve successfully flashed by calling FWUpgradeToolRM520NGL.exe -f \firmware\update\firehose The driver adds -v 0 but I don’t know what it does.

For QFlash it needs to see the EDL com port or at least the diag port. So if you go into device manager and do not see any Com ports (Happens when you flash Lenovo firmware) you cannot use QFlash. I have it on a M.2 to miniPCIE adapter directly connected to the motherboard. The AP is supposedly PCIE only so a USB-C adapter shouldn’t work.

github(dot)com/4IceG/RM520N-GL
Here is where I’ve been finding all the tools and firmware without the help of Quectel. I have received nothing from them despite requesting files a week ago. Some are outdated like the Linux pcie_mhi driver and is missing QConnectManager. These can be found in the ImmortalWRT github.

Please let me know if you get anywhere with this. Thanks!

Will something like this work: Amazon.com: chenyang M.2 SSD SATA NGFF B+M Key to NVME M-Key Expansion Card Converter Adapter JMB582 Chipset for Motherboard 2230/2242/2260/2280/22110 : Electronics

This will let you use the modem via PCIe

https://a.aliexpress.com/_mNPhiPI

On Windows you’ll need the PCIe drivers
On Linux same thing just the Linux version.

GLAA is PCIe + USB

GLAP is PCIe only with USB disabled.

I have a GLAP that’s been modified to behave like an AA. It will allow AA firmware to flash.

1 Like

I thought this was the case indeed
Do you have AP firmware you can send?

@iamromulan

just recieved mine today 11/4/2024 PCIe to M.2 key B adapter
Everything works,sort of…
I ony have an /dev/mhi_BHI device by the modem?
This is my first go around…not sure what I should be seeing for devices on a newly purchased (AP) module.

TIA

By any chance you know anything about QMUX error 0x46? This error shows up when dialing on my Lenovo flashed AP. Everything else seems to work fine so if I can fix the 0x46 during dialing we can flash A03R03 onto the APs.

It seems not like a Quectel PCIE driver.

These are the drivers included in Linux. I believe QFirehose is broke for Linux for the RM520N-GLAP, please test internally and confirm.

1 Like

@cgi2099

Edit: The below error is on Debian Trixie 13. GCC 14.2
I believe the running GCC version of whatever distro you are on really messes with the QFirehose app,along with any other source file that do not contain a ./configure file in the source.

I experience the same behavoir with QFirehose V1.4.17 attempting to flash RM520N-GLAP modem
Runs for a few seconds doing md5 checks on each file in the firmware ,then Ennds up with port =xyx unable to open
linuxusb . ,
failed to flash.

Did you find a fix or work around for this?

Hi @cgi2099

No,

Does your qfirehose end at ‘port xyz is not an ed5 port’ or something similar?
unable to open port = xyx
linuxusb,something.
,flash failed

Just for completeness,my qfirehose does go through all the md5 checksumming of all the files in the zip file,then, fails to open port.
Going from memory

Curious what version of gcc are you using.
‘gcc --version’
Did your qfirehose build without errors or warnings?

B

What was the commandline? I get sdx55.mbn is missing or something when I flash to /dev/mhi_bhi. That’s the farthest I got on Linux.

@TrashJager

commandline

sudo ./QFirehose -p /dev/mhi_BHI -f /home/superuser/Downloads/Quectel_RM520N-GL_Modem5G/QFirehose/QFirehose/RM520NGLAAR03A01M4G_2023_05_12.zip

,starting,

[000.000]: Version: QFirehose_Linux_Android_V1.4.17
[000.000]: Builded: Nov  5 2024 22:38:28
[000.005]: firehose_zip_name:RM520NGLAAR03A01M4G_2023_05_12

,ending, fail

find_firehose_mbn zip_cmd_buf:unzip -o -q /home/superuser/Downloads/Quectel_RM520N-GL_Modem5G/QFirehose/QFirehose/RM520NGLAAR03A01M4G_2023_05_12.zip '*update/firehose/prog_firehose_lite.elf' -d /tmp/ > /tmp/zip_process_info.txt
[002.217]: find_firehose_mbn update/firehose/prog_firehose_lite.elf
[002.217]: qpcie_open prog_firehose_sdx24:/tmp/update/firehose/prog_firehose_lite.elf
[003.218]: bhi_ee = 5
[003.218]: bhi_ee is not MHI_EE_EDL
[003.218]: usb_linux.c qpcie_open 1375 fail
[003.218]: qfirehose.c main 641 fail

Also worth noteing, the unit i received i can only get one device to be generated by the modem - /dev/mhi_BHI nothing else.
Also a quirk, with this modem/adapter setup if i reboot the computer the modem never appears again. Have to power off comupter. ON two different pc’s , both fairly new units.
Am wondering if only way to flash these are in EDL mode. I dont think the (AP) version of these was a good choice. Didnt have a clue there where two versions of these. Thought had done a lot of research. I think these are ‘engineering samples’. :slight_smile:
Im sure they would work on routers that kernel and accesories were built with these as the baseline.

Am using Debian 13 Trixie, just for reference.

Photo of adapter I am using attached.
5G-adapter

They aren’t engineering samples AFAIK. They are just special modules used by laptop manufacturers. You can find these on Digikey and Mouser but minimum order quantity is 100. They buy loads of them so they can ask for custom firmware. Such as the A03R03 I found from Lenovo. My modules did work out the box but one was unstable.

You should be seeing multiple MHI devices. Off the top of my head there should be mhi_dun, mhi_diag and one more. This could mean bad driver or corrupt firmware from a bad flash attempt.

For the module to work properly you MUST fully remove power after reboot. These have reset pins according to hardware design that are probably used by laptop boards when they reboot.

@TrashJager

What is OS you are in?
Did your pcie_mhi Quectel driver build without warnings.
When I build on gcc 14.2 i get 25 warnings. Im pretty certain that is why im only seeing one device,
Mine always end end up with

0b:00.0 Unassigned class [ff00]: Qualcomm Technologies, Inc Device 0308
	Subsystem: Qualcomm Technologies, Inc Device 0308
	Flags: bus master, fast devsel, latency 0, IRQ 73, NUMA node 0, IOMMU group 45
	Memory at f3c01000 (64-bit, non-prefetchable) [size=4K]
	Memory at f3c00000 (64-bit, non-prefetchable) [size=4K]
	Capabilities: [40] Power Management version 3
	Capabilities: [50] MSI: Enable+ Count=4/32 Maskable+ 64bit+
	Capabilities: [70] Express Endpoint, IntMsgNum 0
	Capabilities: [100] Advanced Error Reporting
	Capabilities: [148] Secondary PCI Express
	Capabilities: [168] Physical Layer 16.0 GT/s <?>
	Capabilities: [18c] Lane Margining at the Receiver
	Capabilities: [19c] Transaction Processing Hints
	Capabilities: [228] Latency Tolerance Reporting
	Capabilities: [230] L1 PM Substates
	Capabilities: [240] Data Link Feature <?>
	Kernel driver in use: mhi_q
	Kernel modules: mhi_pci_generic, pcie_mhi


You may be using a prebuilt router kernel?
Have never gotten to where i can mess with firmware to kill it.
Interesting your worked out of the box,under Linux"
Im not into Windows at all, so they would be no good for me there.

Thanks

So far I’ve used.

  1. OpenWRT with generic Linux drivers.
  2. ImmortalWRT with Quectel drivers.
  3. Ubuntu server 24 with generic Linux drivers.
  4. Windows 10 22h2 with Quectel and Lenovo drivers.

All have detected fine. Only one with issues is the Lenovo driver. They have all the com ports hidden by default. The generic driver on Ubuntu only had AT control but worked fine with modemmanager.

It’s possible someone messed with the firmware before you. If not then it should be a driver problem.

@TrashJager

Thank You for info.
So on Ubuntu, You did not even build the proprietary Quectel driver stuff?
If that is the case I think mine has been borked with firmware voodoo.
Example. Just using the generic Debian mhi drivers inbuilt. I do not even get the /dev/mhi_BHI
I have to use the Quectel driver for that to show.

Question, So you have never been able to use qfirehose under Ubuntu to do any firmware flashing.?
You done all your firmware flashing under Windows?
Just wonder what Im missing,is why asking."

TIA