Quectel RM520N-GL USB is not detected in BPI-R3 mini

Hi all!

I recently got a BPI-R3 mini and a Quectel RM520N-GL module. I installed OpenWrt 24.10-rc.5 on the device using this guide.
Everything seems to work fine except that the RM520-GL is not detected (can't see it in lsusb or dmesg). I feel that I probably need some kernel modules for this, so far I have installed:

kmod-usb-core	6.6.69-r1	-	-	
kmod-usb-net	6.6.69-r1	-	-	
kmod-usb-net-cdc-ether	6.6.69-r1	-	-	
kmod-usb-net-cdc-mbim	6.6.69-r1	-	-	
kmod-usb-net-cdc-ncm	6.6.69-r1	-	-	
kmod-usb-net-huawei-cdc-ncm	6.6.69-r1	-	-	
kmod-usb-net-qmi-wwan	6.6.69-r1	-	-	
kmod-usb-serial	6.6.69-r1	-	-	
kmod-usb-serial-option	6.6.69-r1	-	-	
kmod-usb-serial-qualcomm	6.6.69-r1	-	-	
kmod-usb-serial-wwan	6.6.69-r1
kmod-usb-wdm	6.6.69-r1	-	-	
kmod-usb-xhci-hcd	6.6.69-r1	-	-	
kmod-usb-xhci-mtk	6.6.69-r1	-	-	
kmod-usb3	6.6.69-r1	-	-	
kmod-wwan	6.6.69-r1	-	-	

Is there anything I'm missing?

You don't need special drivers to make your USB modem show up in cat /sys/kernel/debug/usb/devices output.
You don't need all the drivers you mentioned.
Check the modem in the external adapter if you have one.
There is a possibility that the modem (i.e. NGFF slot) is not powered on.

1 Like

Thank you!

It does not show up in /sys/kernel/debug/usb/devices. I'm not sure if I explicitly have to turn on power on the modem slot (BPI R3 docs don't say anything about that). That being said, it also did not show up in the factory OpenWrt firmware.

I got this modem: https://shop.notebookkontor.de/detail/LENOVO-ThinkPad-Quectel-RM520N-GL-5G-M.2-WWAN-Module-for-4XC1Q24434_45163.html

Is it a problem that it s a lenovo part (the adapter itself looks exactly like the one on the picture)?

I'll get an external adapter and test it in there.

Since you bought it "for Lenovo" there is a risk that it's PCI only.
See if you can find another modem in the same form factor and test the slot or simply test the power pins on this slot with multimeter.

According to the datasheet the modem should always be USB and PCI:

I guess the best course of action is to wait for the external adapter and test with that.

Please post the output of cat /sys/kernel/debug/gpio when you have time.

Hey, thanks for getting back to me. Here's the output:

root@OpenWrt:~# cat /sys/kernel/debug/gpio 
gpiochip0: GPIOs 512-612, parent: platform/1001f000.pinctrl, pinctrl_moore:
 gpio-513 (                    |blue:wlan-1         ) out hi 
 gpio-514 (                    |blue:wlan-2         ) out lo 
 gpio-519 (                    |reset               ) in  hi IRQ ACTIVE LOW
 gpio-531 (                    |green:status        ) out hi 
 gpio-532 (                    |regulator-usb-vbus  ) out lo ACTIVE LOW
 gpio-559 (                    |PHY reset           ) out hi ACTIVE LOW
 gpio-561 (                    |PHY reset           ) out hi ACTIVE LOW

I'm sorry but I am getting the feeling that you might be right and this card does not have a USB interface as I can't discern whether it's an AA or an AP version.

Apologies for my oversight. I'll report back as soon as I have found out more. Thank you so far for your help, I really appreciate it.

Hey, a quick update. I now got the actual AA version. Sadly it's only detected sometimes. I couldn't figure out a pattern or anything but is there anything that could lead to this behavior? I was able to establish a connection using QMI but after a reboot the modem was not detected anymore :frowning:

I can think of some floating GPIO pin.
I would boot some "official" Linux for this board and see how the modem is detected there.

Here's an update. I was able to flash back the images from BananaPi themselves: https://docs.banana-pi.org/en/BPI-R3_Mini/BananaPi_BPI-R3_Mini#_openwrt

and the modem is consistently detected. Sadly these old versions don't get updates anymore and I can't install any software.

So I'm kind of stuck in between versions and it seems I have to wait until support for the modem is back in 24.10...

I also tried with Arch Linux from here: https://github.com/ericwoud/buildR64arch, which sadly also didn't work. It seems it only works with the official images, which are pretty much unusable at this point. Maybe it's a regression in the kernel?

Just tested again just to make sure on the stock 21.02.3 version using Kernel 5.4.188 it is properly detected:

[   13.802012] usbcore: registered new interface driver btusb
[   53.801010] usb 2-1: new SuperSpeed Gen 1x2 USB device number 2 using xhci-mtk
[   53.825268] usb 2-1: LPM exit latency is zeroed, disabling LPM.
[   53.858528] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB0
[   53.871955] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB1
[   53.879951] qmi_wwan_q 2-1:1.4: cdc-wdm0: USB WDM device
[   53.885424] qmi_wwan_q 2-1:1.4: Quectel RM520N-GL work on RawIP mode
[   53.891855] qmi_wwan_q 2-1:1.4: rx_urb_size = 31744
[   53.897226] qmi_wwan_q 2-1:1.4 wwan0: register 'qmi_wwan_q' at usb-11200000.xhci-1, RMNET/USB device, 0a:ed:2d:08:f4:4b

Ok, qmi_wwan_q actually gave me a hint. It's a special Quectel driver that apparently is not part of the mainline kernel yet:

The image provided by SinoVoip has this driver already compiled into the Kernel.

According to this patch here the RM520N-GL is already in mainline. So I have no idea what's going on here.

There is no need in using QMI, you can switch to MBIM.

When you say

do you mean QMI interface or USB device?

It's not showing up in the usb devices. Now consistently outside of within these two images:

  • 2023-11-15 BPI-R3 Mini OpenWRT image with Opensource MAC80211 wifi Driver BSP (support Quectel RM500U-CN & RM520N-GL 5G Modules)
  • 2023-11-15 BPI-R3 Mini OpenWRT image with MTK vendor wifi driver, Not OpenSource Driver BSP (support Quectel RM500U-CN & RM520N-GL 5G Modules)

I can't get it to show up.

BPI-R3 mini has some of the modem control pins of the ngff connector connected.

Pin
6	ngff-pwr-off	FULL_CARD_POWER_OFF
8	ngff-wwan-off	WWAN_DISABLE
26	ngff-gnss-off	GNSS_DISABLE2
50	ngff-pe-rst 	NGFF-PERST#
67	ngff-rst    	NGFF_RSTN_V1P8

In the dts file it´s configured under &pio

	usb_ngff_pins: usb-ngff-pins {
		ngff-gnss-off {
			pins = "GPIO_6";
			drive-strength = <8>;
			mediatek,pull-up-adv = <1>;
		};
		ngff-pe-rst {
			pins = "GPIO_7";
			drive-strength = <8>;
			mediatek,pull-up-adv = <1>;
		};
		ngff-wwan-off {
			pins = "GPIO_8";
			drive-strength = <8>;
			mediatek,pull-up-adv = <1>;
		};
		ngff-pwr-off {
			pins = "GPIO_9";
			drive-strength = <8>;
			mediatek,pull-up-adv = <1>;
		};
		ngff-rst {
			pins = "GPIO_10";
			drive-strength = <8>;
			mediatek,pull-up-adv = <1>;
		};
		ngff-coex {
			pins = "SPI1_CS";
			drive-strength = <8>;
			mediatek,pull-up-adv = <1>;
		};
	};

Maybe it´s possible to move them to gpio-export so they get vissible in cat /sys/kernel/debug/gpio

1 Like

Boot any "good" image you have then read and post gpio information like you did this before. Compare it with what you had with recent official OpenWrt.

Thank you, that would make a lot of sense! Sorry, to clarify, do you mean to look at /sys/kernel/debug/gpio in both environments?

Yes, like in my third response in this thread and then in your answer to it.

1 Like

These are the GPIOs in the working version (custom 21.02):

root@OpenWrt:~# cat /sys/kernel/debug/gpio 
gpiochip0: GPIOs 411-511, parent: platform/1001f000.pinctrl, pinctrl_moore:
 gpio-422 (                    |gnss_off            ) in  hi 
 gpio-431 (                    |sysfs               ) out lo 
 gpio-443 (                    |sysfs               ) in  lo 
 gpio-458 (                    |PHY reset           ) out hi ACTIVE LOW
 gpio-460 (                    |PHY reset           ) out hi ACTIVE LOW

And these are the GPIOs in the non-working version (24.10-rc.5):

root@OpenWrt:~# cat /sys/kernel/debug/gpio 
gpiochip0: GPIOs 512-612, parent: platform/1001f000.pinctrl, pinctrl_moore:
 gpio-513 (                    |blue:wlan-1         ) out lo 
 gpio-514 (                    |blue:wlan-2         ) out hi 
 gpio-519 (                    |reset               ) in  hi IRQ ACTIVE LOW
 gpio-531 (                    |green:status        ) out hi 
 gpio-532 (                    |regulator-usb-vbus  ) out lo ACTIVE LOW
 gpio-559 (                    |PHY reset           ) out hi ACTIVE LOW
 gpio-561 (                    |PHY reset           ) out hi ACTIVE LOW

I am pretty sure now that it is a gpio issue, thank you for pointing me in the right direction.
Specifically I found this file: https://github.com/BPI-SINOVOIP/BPI-R3MINI-OPENWRT-V21.02.3/blob/9bd78779f267a21c04c5bb4d16c32e83aae8d1d3/target/linux/mediatek/mt7986/base-files/etc/init.d/ltecalling

Now I just have to find a way to get this specific GPIO working.