Quectel RM520N-GL Rpi cm4

Hello,
We are working on launching 5g modems on arm systems. I have compiled kernel modules (option.c and qmi_wwan.c) on my pc which is x86 and everything works fine. I am capable to get 5g modes, info below:

MY PC:

System | device: /sys/devices/pci0000:00/0000:00:14.0/usb4/4-4
| drivers: option, qmi_wwan
| plugin: quectel
| primary port: cdc-wdm1
| ports: cdc-wdm1 (qmi), ttyUSB2 (at), ttyUSB3 (at), wwan0 (net)

Status | lock: sim-pin
| unlock retries: sim-pin (3), sim-puk (10), sim-pin2 (3), sim-puk2 (10)
| state: locked
| power state: on
| signal quality: 0% (cached)

Modes | supported: allowed: 3g; preferred: none
| allowed: 4g; preferred: none
| allowed: 3g, 4g; preferred: 4g
| allowed: 3g, 4g; preferred: 3g
| allowed: 5g; preferred: none
| allowed: 4g, 5g; preferred: 5g
| allowed: 4g, 5g; preferred: 4g
| allowed: 3g, 5g; preferred: 5g
| allowed: 3g, 5g; preferred: 3g
| allowed: 3g, 4g, 5g; preferred: 5g
| allowed: 3g, 4g, 5g; preferred: 4g
| allowed: 3g, 4g, 5g; preferred: 3g
| current: allowed: 2g, 3g, 4g, 5g; preferred: 5g

And so i have compiled option.c on rpi and modem run with these options:

RPI:

Hardware | manufacturer: Quectel
| model: RM520N-GL
| revision: RM520NGLAAR01A05M4G
| supported: gsm-umts, lte
| current: gsm-umts, lte

System | device: /sys/devices/platform/soc/fe980000.usb/usb1/1-1/1-1.1
| drivers: option1
| plugin: Generic
| primary port: ttyUSB2
| ports: ttyUSB2 (at), ttyUSB3 (at)

Status | lock: sim-pin
| unlock retries: sim-pin (3), sim-pin2 (3), sim-puk (10), sim-puk2 (10)
| state: locked
| power state: on
| signal quality: 0% (cached)

Modes | supported: allowed: 2g, 3g, 4g; preferred: none
| current: allowed: 2g, 3g, 4g; preferred: none

I think this is because, i do not have a proper driver qmi_wwan, and so i can not get /dev/cdc-wdm
in System->ports. As you can see primary port on my pc is cdc-wdm, on rpi it is ttyUSB2.
But maybe I might be wrong. Can you help me?
I simulated this state (without 5g options) on my pc when i turned off qmi_wwan module.

I guess it is because the tool on the rpi is lower than it on the PC.

Which tool do you use?

You are right. I am using ModemManager. I am working around this.

If you upgrade the ModemManager to the same version with the PC,it might work.

Hi, I upgraded ModemManager to the same as i have and it stills does not work properly.

lsmod | grep qmi :
qmi_wwan 28672 0
cdc_wdm 20480 1 qmi_wwan

I am still missing of /dev/cdc-wdmX in /dev and qmi_wwan in drivers in ModemManager info
ModemManager info looks like this:

General | path: /org/freedesktop/ModemManager1/Modem/2
| device id: 6eed145984e12fea246f0148e32fb2f03c42a853

Hardware | manufacturer: Quectel
| model: RM520N-GL
| firmware revision: RM520NGLAAR01A05M4G
| supported: gsm-umts, lte
| current: gsm-umts, lte
|

System | device: /sys/devices/platform/soc/fe980000.usb/usb1/1-1/1-1.1
| drivers: option
| plugin: quectel
| primary port: ttyUSB2
| ports: ttyUSB2 (at), ttyUSB3 (at)

Status | lock: sim-pin
| unlock retries: sim-pin (3), sim-pin2 (3), sim-puk (10), sim-puk2 (10)
| state: locked
| power state: on
| signal quality: 0% (cached)

Modes | supported: allowed: 2g, 3g, 4g; preferred: none
| current: allowed: 2g, 3g, 4g; preferred: none

IP | supported: ipv4, ipv6, ipv4v6

3GPP | enabled locks: sim

SIM | primary sim path: /org/freedesktop/ModemManager1/SIM/2

What’s the version of the Ubuntu PC, and the kernel version about it ?

If it works on the PC, why not try to port the driver in the kernel of the PC to the RPI.

I can’t do this. Driver qmi_wwan on my pc is on x86 architecture and it is not possible to insert this module on rpi, arm architecture. I may be wrong but i tried this.

Okay, my fault. I was compiling qmi_wwan from kernel 5.15 on my 5.10.
Then i realised what i was doing, so after all compiled qmi_wwan from 5.10 (added QUectel RM520N) and everything works fine.
Thanks for everything