Quectel RM502 modem Booting issue

Hi,

We are integrating the PCIe quectel modem in Xilinx zcu106 now we have booted successfully, and the enumeration is successful. We are facing some problems,

  1. I have given an external supply to the modem and tried to change the mode from USB mode to PCIE mode with AT commands in Minicom. These are the parts we are using,
    a.HIGHTECH GLOBAL PCIE ADAPTER
    b.ABLECONN MPEX-134B MINI PCIE ADAPTER
    STARTTECH.COM
    c.PCI EXPRESS TO MINI PCI EXPRESS CARD ADAPTER
    d.QUECTEL RM502 MODEM
    The commands we used here are
    sudo atcom AT+QCFG="data_interface",1,0
    sudo atcom AT+QCFG="pcie/mode",1
    sudo atcom AT+CFUN=1,1
    After changing the mode we are connected to the Xilinx board. After booting the enumeration is not happening PCIE is checking for the endpoint.
    Is there anything to change back to a normal state?

  2. After booting in Xilinx board we have integrated the quectel mhi driver we can able to detect the node while running minicom for the mhi_DUN node we cannot able to type anything is there any driver or configurations to be used for that.
    Please help us with that also,

Dear @Ranjithkumar_Rajendh
You can try power on device firstly, then power on your MCU. It seems it didn’t detect device.

1 Like

Hi Silvia

I have solved the first issue. But in the second issue, after debugging more things on the driver side, we have two boards: Raspberry Pi and Xilinx.
In raspberry pi all working fine. When I connect the same PCIe to the Xilinx zcu106 eval board with an FMC connector we are not able to execute AT commands,
Here we are using Quectel_Linux_PCIE_MHI_Driver_V1.3.5.zip
Working logs from Raspberry PI
I][mhi0][__mhi_prepare_channel] Entered: preparing channel:32
[ 570.828102] [I][mhi0][mhi_dump_tre] carl_ev evt_cmd_comp code=1, type=33
[ 570.828168] [I][mhi0][__mhi_prepare_channel] Chan:32 successfully moved to start state[ 570.828176] [I][mhi0][__mhi_prepare_channel] Entered: preparing channel:33
[ 570.836595] [I][mhi0][mhi_dump_tre] carl_ev evt_cmd_comp code=1, type=33
[ 570.836641] [I][mhi0][__mhi_prepare_channel] Chan:33 successfully moved to start state
[ 572.394556] [I][mhi0][mhi_dtr_dl_xfer_cb] preamble:0x4354524c msg_id:17 dest_id:33 msg:0x8

From Raspberry Pi, we can see that when I try to open the minicom the preamble,msg_id,dest_id and msg are receiving correctly.

Logs in xilinx

[ 115.013583] [I][mhi0][__mhi_prepare_channel] Entered: preparing channel:32
[ 115.022384] [I][mhi0][mhi_dump_tre] carl_ev evt_cmd_comp code=1, type=33
[ 115.022399] [I][mhi0][__mhi_prepare_channel] Chan:32 successfully moved to start state
[ 115.022403] [I][mhi0][__mhi_prepare_channel] Entered: preparing channel:33
[ 115.030927] [I][mhi0][mhi_dump_tre] carl_ev evt_cmd_comp code=1, type=33
[ 115.030938] [I][mhi0][__mhi_prepare_channel] Chan:33 successfully moved to start state
[ 115.031013] [I][mhi0][mhi_dtr_tiocmset] preamble [1280463939] msgId[16] destId [32] DTR:0 RTS:1
[ 116.125973] [I][mhi0][mhi_dtr_dl_xfer_cb] preamble:0x0 msg_id:0 dest_id:296222720 msg:0x5000

From Xilinx, we can see that when I try to open the minicom the preamble,msg_id,dest_id and msg are sending to the modem correctly but the modem is sending as like raspberry Pi it is different
preamble:0x0 msg_id:0 dest_id:296222720 msg:0x5000

So because of it we can’t able to do anything in minicom.

Could you please suggest any solutions?

Hi Silvia

I have solved the first issue. But in the second issue, after debugging more things on the driver side, we have two boards: Raspberry Pi and Xilinx.
In raspberry pi all working fine. When I connect the same PCIe to the Xilinx zcu106 eval board with an FMC connector we are not able to execute AT commands,
Here we are using Quectel_Linux_PCIE_MHI_Driver_V1.3.5.zip
Working logs from Raspberry PI
I][mhi0][__mhi_prepare_channel] Entered: preparing channel:32
[ 570.828102] [I][mhi0][mhi_dump_tre] carl_ev evt_cmd_comp code=1, type=33
[ 570.828168] [I][mhi0][__mhi_prepare_channel] Chan:32 successfully moved to start state[ 570.828176] [I][mhi0][__mhi_prepare_channel] Entered: preparing channel:33
[ 570.836595] [I][mhi0][mhi_dump_tre] carl_ev evt_cmd_comp code=1, type=33
[ 570.836641] [I][mhi0][__mhi_prepare_channel] Chan:33 successfully moved to start state
[ 572.394556] [I][mhi0][mhi_dtr_dl_xfer_cb] preamble:0x4354524c msg_id:17 dest_id:33 msg:0x8

From Raspberry Pi, we can see that when I try to open the minicom the preamble,msg_id,dest_id and msg are receiving correctly.

Logs in xilinx

[ 115.013583] [I][mhi0][__mhi_prepare_channel] Entered: preparing channel:32
[ 115.022384] [I][mhi0][mhi_dump_tre] carl_ev evt_cmd_comp code=1, type=33
[ 115.022399] [I][mhi0][__mhi_prepare_channel] Chan:32 successfully moved to start state
[ 115.022403] [I][mhi0][__mhi_prepare_channel] Entered: preparing channel:33
[ 115.030927] [I][mhi0][mhi_dump_tre] carl_ev evt_cmd_comp code=1, type=33
[ 115.030938] [I][mhi0][__mhi_prepare_channel] Chan:33 successfully moved to start state
[ 115.031013] [I][mhi0][mhi_dtr_tiocmset] preamble [1280463939] msgId[16] destId [32] DTR:0 RTS:1
[ 116.125973] [I][mhi0][mhi_dtr_dl_xfer_cb] preamble:0x0 msg_id:0 dest_id:296222720 msg:0x5000

From Xilinx, we can see that when I try to open the minicom the preamble,msg_id,dest_id and msg are sending to the modem correctly but the modem is sending as like raspberry Pi it is different
preamble:0x0 msg_id:0 dest_id:296222720 msg:0x5000

So because of it we can’t able to do anything in minicom.

Could you please suggest any solutions?

Dear @Ranjithkumar_Rajendh
[ 115.031013] [I][mhi0][mhi_dtr_tiocmset] preamble [1280463939] msgId[16] destId [32] DTR:0 RTS:1
=>It seems the module reset, could you confirm the power supply?

Hi Silvia,

We have tried giving an external supply from FMC to the PCIe modem. From the modem, we are getting four USBs from which we can perform AT commands from the minicom.

When we have connected to the Xilinx zcu106 board from FMC to PCIe.While accessing the modem we are getting this problem

[ 116.125973] [I][mhi0][mhi_dtr_dl_xfer_cb] preamble:0x0 msg_id:0 dest_id:296222720 msg:0x5000

after this minicom stop responding.Are there any configuration or driver modifications that need to be done?

Dear @Ranjithkumar_Rajendh
Could you try this command:AT+QCFG=“pcie/mode”,0 ?

This works fine,
sudo atcom AT+QCFG="pcie/mode",0
AT+QCFG="pcie/mode",0
OK

But same problem we are facing,

Please provide the full log.
What’s the kernel version of the xilinx?
show the result of “lspci” && “lspci -v”.

Hi Bean,

root@SD:~# lspci
00:00.0 PCI bridge: Xilinx Corporation Device 9131
01:00.0 Unassigned class [ff00]: Qualcomm Device 0306

root@SD:~# lspci -v
00:00.0 PCI bridge: Xilinx Corporation Device 9131 (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0, IRQ 255
Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
I/O behind bridge: 00000000-00000fff [size=4K]
Memory behind bridge: a0000000-a00fffff [size=1M]
Prefetchable memory behind bridge: [disabled]
Capabilities: [40] Power Management version 3
Capabilities: [48] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [70] Express Root Port (Slot+), MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [128] Vendor Specific Information: ID=0000 Rev=1 Len=038 <?> Capabilities: [200] Vendor Specific Information: ID=0002 Rev=0 Len=038 <?>

01:00.0 Unassigned class [ff00]: Qualcomm Device 0306
Subsystem: Qualcomm Device 5022
Flags: bus master, fast devsel, latency 0, IRQ 61
Memory at a0000000 (64-bit, non-prefetchable) [size=4K]
Memory at a0001000 (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, MSI 00
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: pcie_mhi

The RM502Q seems link up successful.
Could you provide the host side log first.
dmesg
cat /sys/kernel/debug/mhi_q//states
cat /sys/kernel/debug/mhi_q/
/chan
cat /sys/kernel/debug/mhi_q//events
cat /sys/kernel/debug/mhi_q/mhi_netdev/
/states
cat /proc/interrupts

Could we also see the /dev/mhi_DUN there?

Yes Bean, we can also able to see /dev/mhi_DUN

root@SD:~# ls /dev/mhi*
/dev/mhi_BHI /dev/mhi_DIAG /dev/mhi_DUN /dev/mhi_LOOPBACK /dev/mhi_QMI0

root@SD:~# cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3
11: 212323 108642 213727 82441 GICv2 30 Level arch_timer
14: 0 0 0 0 GICv2 67 Level zynqmp_ipi
20: 0 0 0 0 GICv2 156 Level zynqmp-dma
21: 0 0 0 0 GICv2 157 Level zynqmp-dma
22: 0 0 0 0 GICv2 158 Level zynqmp-dma
23: 0 0 0 0 GICv2 159 Level zynqmp-dma
24: 0 0 0 0 GICv2 160 Level zynqmp-dma
25: 0 0 0 0 GICv2 161 Level zynqmp-dma
26: 0 0 0 0 GICv2 162 Level zynqmp-dma
27: 0 0 0 0 GICv2 163 Level zynqmp-dma
28: 0 0 0 0 GICv2 164 Level Mali_GP_MMU, Mali_GP, Mali_PP0_MMU, Mali_PP0, Mali_PP1_MMU, Mali_PP1
29: 0 0 0 0 GICv2 109 Level zynqmp-dma
30: 0 0 0 0 GICv2 110 Level zynqmp-dma
31: 0 0 0 0 GICv2 111 Level zynqmp-dma
32: 0 0 0 0 GICv2 112 Level zynqmp-dma
33: 0 0 0 0 GICv2 113 Level zynqmp-dma
34: 0 0 0 0 GICv2 114 Level zynqmp-dma
35: 0 0 0 0 GICv2 115 Level zynqmp-dma
36: 0 0 0 0 GICv2 116 Level zynqmp-dma
38: 1463 0 0 0 GICv2 95 Level eth0, eth0
40: 0 0 0 0 GICv2 49 Level cdns-i2c
41: 0 0 0 0 GICv2 50 Level cdns-i2c
42: 0 0 0 0 GICv2 42 Level ff960000.memory-controller
43: 0 0 0 0 GICv2 57 Level axi-pmon, axi-pmon
44: 0 0 0 0 GICv2 155 Level axi-pmon, axi-pmon
45: 0 0 0 0 GICv2 47 Level ff0f0000.spi
46: 2 0 0 0 GICv2 58 Level ffa60000.rtc
47: 0 0 0 0 GICv2 59 Level ffa60000.rtc
48: 0 0 0 0 GICv2 165 Level ahci-ceva[fd0c0000.ahci]
49: 2138 0 0 0 GICv2 81 Level mmc0
50: 1006 0 0 0 GICv2 53 Level xuartps
53: 0 0 0 0 GICv2 84 Edge ff150000.watchdog
54: 0 0 0 0 GICv2 88 Level ams-irq
55: 0 0 0 0 GICv2 154 Level fd4c0000.dma-controller
57: 7 0 0 0 GICv2 121 Level xilinx-pcie
58: 0 0 0 0 GICv2 97 Level xhci-hcd:usb1
59: 3 0 0 0 GICv2 101 Level dwc3-otg
61: 1 0 0 0 xilinx_pcie:msi 524288 Edge mhi
62: 6 0 0 0 xilinx_pcie:msi 524289 Edge mhi
63: 0 0 0 0 xilinx_pcie:msi 524290 Edge mhi
64: 0 0 0 0 xilinx_pcie:msi 524291 Edge mhi
IPI0: 224 243 395 340 Rescheduling interrupts
IPI1: 1511 1726 2359 2924 Function call interrupts
IPI2: 0 0 0 0 CPU stop interrupts
IPI3: 0 0 0 0 CPU stop (for crash dump) interrupts
IPI4: 0 0 0 0 Timer broadcast interrupts
IPI5: 0 0 0 0 IRQ work interrupts
IPI6: 0 0 0 0 CPU wake-up interrupts
Err: 0

root@SD:~# cat /sys/kernel/debug/mhi_q/mhi_netdev/rmnet_mhi_0306_00.01.00_0/states
tx_tre:511 rx_tre:0 qmap_chain:0 skb_chain:0 tx_allocated:0 rx_allocated:0
netif_queue_stopped:0, link_state:0x0, flow_control:0x0
rmnet_map_command_stats: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

We don’t have these files
cat /sys/kernel/debug/mhi_q/states
cat /sys/kernel/debug/mhi_q/chan
cat /sys/kernel/debug/mhi_q/events
cat /sys/kernel/debug/mhi_q/mhi_netdev/states