BPI-R4 - Modem M.2 Key B issues with PCIe

Hi all,

I face a strange issue with 5G Modems in this slot. The slot seems to work fine if I install a M.2 adapter with a M.2 NIC 2.5 Gbps. I can get full speed both directions via Ethernet port.

But if I connect a 5G modem like FM350-GL or Dell DW5934e into this slot I get some errors like this:

[   74.858008] mtk_t7xx 0003:01:00.0: MD handshake timeout
[   74.863243] mtk_t7xx 0003:01:00.0: Boot Handshake failure
[   85.032006] pcieport 0003:00:00.0: AER: Correctable error message received from 0003:00:00.0
[   85.040463] pcieport 0003:00:00.0: PCIe Bus Error: severity=Correctable, type=Physical Layer, (Receiver ID)
[   85.050200] pcieport 0003:00:00.0:   device [14c3:7988] error status/mask=00000001/00006000
[   85.058549] pcieport 0003:00:00.0:    [ 0] RxErr                  (First)
[   85.080389] pcieport 0003:00:00.0: AER: Uncorrectable (Fatal) error message received from 0003:00:00.0
[   85.089709] pcieport 0003:00:00.0: PCIe Bus Error: severity=Uncorrectable (Fatal), type=Transaction Layer, (Receiver ID)
[   85.100573] pcieport 0003:00:00.0:   device [14c3:7988] error status/mask=00000020/00400000
[   85.108919] pcieport 0003:00:00.0:    [ 5] SDES                   (First)
[   85.115703] pcieport 0003:00:00.0: AER: broadcast error_detected message
[   85.122399] mtk_t7xx 0003:01:00.0: AER: can't recover (no error_detected callback)
[   85.147996] pcieport 0003:00:00.0: waiting 100 ms for downstream link, after activation
[   86.177996] pcieport 0003:00:00.0: broken device, retraining non-functional downstream link at 2.5GT/s
[   86.337485] mtk_t7xx 0003:01:00.0: ready 0ms after bus reset
[   86.343149] pcieport 0003:00:00.0: AER: Root Port link has been reset (0)
[   86.349987] pcieport 0003:00:00.0: AER: device recovery failed

Or sometimes it doesn’t get this error but the driver mtk_t7xx is loaded but it doesn’t expose any kind of /dev/wwan0* interface.

On my Ryzen 5900X PC with a PCIe to M.2 B+M adapter and then M.2 Key B with SIM to M.2 Key B+M, the modem works OK with mtk_t7xx and it expose /dev/wwan0* interfaces.

The only difference between these 2 setups is the second one doesn’t have an USB 2.0/3.0 interface, so in my Ryzen 5900X works only in PCIe mode.

Both Ryzen 5900X and BPi R4 are running Kernel 7.1.x:

root@EasyOS:/# uname -a
Linux EasyOS 7.1.2-EasyOS-bpi-r4 #1 SMP PREEMPT Fri Jul  3 17:55:33 CEST 2026 aarch64 GNU/Linux

root@Ryzen5900X:~# uname -a
Linux Ryzen5900X 7.1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 7.1.1-1~exp1 (2026-06-19) x86_64 GNU/Linux

But in BPi R4 I can see modem on both interfaces: PCIe and USB.

And in logs I get:

# dmesg | grep mtk_t7xx
[   13.112835] mtk_t7xx 0003:01:00.0: vgaarb: pci_notify
[   13.123268] mtk_t7xx 0003:01:00.0: assign IRQ: got 120
[   13.128529] mtk_t7xx 0003:01:00.0: enabling device (0000 -> 0002)
[   13.134632] mtk_t7xx 0003:01:00.0: enabling bus mastering
[   13.361667] mtk_t7xx 0003:01:00.0: vgaarb: pci_notify
[   74.840882] mtk_t7xx 0003:01:00.0: MD handshake timeout
[   74.846119] mtk_t7xx 0003:01:00.0: Boot Handshake failure

I tried to disable all USB drivers for FM350-GL in /etc/modprobe.d/blacklist-mtk-usb.conf:

# Blacklist for USB driver for FM350-GL
blacklist option
blacklist cdc_acm
blacklist cdc_mbim
blacklist cdc_wdm

Also /etc/udev/rules.d/99-disable-mtk-usb.rules:

# Disable USB interfaces for FM350-GL (0e8d:7127)
ATTR{idVendor}=="0e8d", ATTR{idProduct}=="7127", ATTR{authorized}="0"

//LE If I don’t load any USB drivers, the PCIe works better, mtk_t7xx is loaded but doesn’t expose any /dev/wwan0* interface.

Any ideas?

Hi all,

I found the issue. The FM350-GL firmware version 81600.0000.00.29.23.22_GC, F30 is a little bit stupid! When I cross check with the configuration in my Ryzen 5900X and notice that if is connected on PCIe only is working fine, then I decided to block these pins on the modem PCB:

7 -> USB_D+
9 -> USB_D-
29 -> PERn1/USB3.1-Rx-/SSIC-RxN (is used for USB 3.0 in BPi R4)
31 -> PERp1/USB3.1-Rx+/SSIC-RxP (is used for USB 3.0 in BPi R4)
35 -> PETn1/USB3.1-Tx-/SSIC-TxN (is used for USB 3.0 in BPi R4)
37 -> PETp1/USB3.1-Tx+/SSIC-TxP (is used for USB 3.0 in BPi R4)

Guess what?!

# dmesg | grep "mtk_t7xx\|wwan"
[   17.316429] mtk_t7xx 0003:01:00.0: vgaarb: pci_notify
[   17.321620] mtk_t7xx 0003:01:00.0: assign IRQ: got 120
[   17.326795] mtk_t7xx 0003:01:00.0: enabling device (0000 -> 0002)
[   17.353675] mtk_t7xx 0003:01:00.0: enabling bus mastering
[   17.514806] mtk_t7xx 0003:01:00.0: vgaarb: pci_notify
[   17.560841] wwan wwan0: port wwan0at0 attached
[   17.587432] wwan wwan0: port wwan0mbim0 attached

# ls -l /dev/wwan0*
crw------- 1 root root 238, 0 Jul  9 10:04 /dev/wwan0at0
crw------- 1 root root 238, 1 Jul  9 10:04 /dev/wwan0mbim0

# mmcli -m 0
  -----------------------------
  General  |              path: /org/freedesktop/ModemManager1/Modem/0
           |         device id: 2d1dce3741c7812bb8ca39d3196ad844f98984fc
  -----------------------------
  Hardware |      manufacturer: mtk
           |             model: MBIM [14C3:4D75]
           | firmware revision: 81600.0000.00.29.23.22_GC
           |                    F30
           |      h/w revision: V1.0.6
           |         supported: gsm-umts, lte, 5gnr
           |           current: gsm-umts, lte, 5gnr
           |      equipment id: 35417XXXXXXXXXX
  -----------------------------
  System   |            device: /sys/devices/platform/soc/11280000.pcie/pci0003:00/0003:00:00.0/0003:01:00.0
           |           physdev: /sys/devices/platform/soc/11280000.pcie/pci0003:00/0003:00:00.0/0003:01:00.0
           |           drivers: mtk_t7xx
           |            plugin: mtk
           |      primary port: wwan0mbim0
           |             ports: wwan0 (net), wwan0at0 (at), wwan0mbim0 (mbim)
  -----------------------------
  Status   |             state: failed
           |     failed reason: sim-missing
           |       power state: low
  -----------------------------
  Modes    |         supported: allowed: 3g; preferred: none
           |                    allowed: 4g; preferred: none
           |                    allowed: 3g, 4g; preferred: none
           |                    allowed: 5g; preferred: none
           |                    allowed: 3g, 5g; preferred: none
           |                    allowed: 4g, 5g; preferred: none
           |                    allowed: 3g, 4g, 5g; preferred: none
           |           current: allowed: any; preferred: none
  -----------------------------
  IP       |         supported: ipv4, ipv6, ipv4v6
  -----------------------------
  3GPP     |              imei: 35417XXXXXXXXXX
  -----------------------------
  SIM      |    sim slot paths: slot 1: none (active)
           |                    slot 2: /org/freedesktop/ModemManager1/SIM/0

I can’t believe the firmware prioritize USB connection over PCIe!! :person_facepalming:

The modem is working fine right know, but I get such messages in dmesg:

[ 1672.622714] mtk_t7xx 0003:01:00.0: save config 0x04: 0x00100406
[ 1672.628639] mtk_t7xx 0003:01:00.0: save config 0x08: 0x0d400001
[ 1672.634564] mtk_t7xx 0003:01:00.0: save config 0x0c: 0x00000000
[ 1672.640473] mtk_t7xx 0003:01:00.0: save config 0x10: 0x2180000c
[ 1672.646396] mtk_t7xx 0003:01:00.0: save config 0x14: 0x00000000
[ 1672.652340] mtk_t7xx 0003:01:00.0: save config 0x18: 0x20800004
[ 1672.658259] mtk_t7xx 0003:01:00.0: save config 0x1c: 0x00000000
[ 1672.664175] mtk_t7xx 0003:01:00.0: save config 0x20: 0x2100000c
[ 1672.670085] mtk_t7xx 0003:01:00.0: save config 0x24: 0x00000000
[ 1672.676012] mtk_t7xx 0003:01:00.0: save config 0x28: 0x00000000
[ 1672.681921] mtk_t7xx 0003:01:00.0: save config 0x2c: 0x8c4a103c
[ 1672.687842] mtk_t7xx 0003:01:00.0: save config 0x30: 0x00000000
[ 1672.693773] mtk_t7xx 0003:01:00.0: save config 0x34: 0x00000080
[ 1672.699684] mtk_t7xx 0003:01:00.0: save config 0x38: 0x00000000
[ 1672.705600] mtk_t7xx 0003:01:00.0: save config 0x3c: 0x00000173
[ 1672.711572] mtk_t7xx 0003:01:00.0: PME# enabled
[ 1672.728145] pcieport 0003:00:00.0: save config 0x00: 0x798814c3
[ 1672.734066] pcieport 0003:00:00.0: save config 0x04: 0x00100406
[ 1672.739975] pcieport 0003:00:00.0: save config 0x08: 0x06040001
[ 1672.745912] pcieport 0003:00:00.0: save config 0x0c: 0x00010000
[ 1672.751825] pcieport 0003:00:00.0: save config 0x10: 0x20200004
[ 1672.757742] pcieport 0003:00:00.0: save config 0x14: 0x00000000
[ 1672.763664] pcieport 0003:00:00.0: save config 0x18: 0x00010100
[ 1672.769596] pcieport 0003:00:00.0: save config 0x1c: 0x000001f1
[ 1672.775512] pcieport 0003:00:00.0: save config 0x20: 0x20f02080
[ 1672.781421] pcieport 0003:00:00.0: save config 0x24: 0x21812101
[ 1672.787335] pcieport 0003:00:00.0: save config 0x28: 0x00000000
[ 1672.793243] pcieport 0003:00:00.0: save config 0x2c: 0x00000000
[ 1672.799156] pcieport 0003:00:00.0: save config 0x30: 0x00000000
[ 1672.805073] pcieport 0003:00:00.0: save config 0x34: 0x00000080
[ 1672.810981] pcieport 0003:00:00.0: save config 0x38: 0x00000000
[ 1672.816899] pcieport 0003:00:00.0: save config 0x3c: 0x00020173
[ 1672.822837] pcieport 0003:00:00.0: PME# enabled
[ 1674.746565] pcieport 0003:00:00.0: restore config 0x2c: 0x00000000 -> 0x00000000
[ 1674.753985] pcieport 0003:00:00.0: restore config 0x28: 0x00000000 -> 0x00000000
[ 1674.761390] pcieport 0003:00:00.0: restore config 0x24: 0x21812101 -> 0x21812101
[ 1674.768838] pcieport 0003:00:00.0: PME# disabled
[ 1674.785654] mtk_t7xx 0003:01:00.0: PME# disabled

My questions are:

  1. There is a way to disable USB 3.0 on M.2 Key B slot?
  2. There is an ongoing issue with PCIe on BPi R4?
1 Like

Hello, this is a long-standing problem and I rewrote the firmware to make it compatible with Fibocom 350 since I own it myself. Yes, the problem is with the PCI port and it needs to be disabled.

Please note that data polling must go through tty USB1 in modemmanager, and specify USB3 in the ATC interface. Also note that in this mode, this modem heats up a lot, I’m not kidding, you will need to cool it with a small cooler.

1 Like

Thanks Mikhail for the info!

That so strange. Over PCIe only it works ok until I reboot the BPi R4 or my PC. Then the modem remains in an “unkown” state.

I have to unplug the modem or router for about 10-15 seconds and then the modem works fine again. Example after unplug for 10-15 seconds:

# cat /sys/bus/pci/devices/0003\:01\:00.0/t7xx_mode
ready

And after reboot:

# cat /sys/bus/pci/devices/0003\:01\:00.0/t7xx_mode
unknown

Over USB is very strange because ModemManager doesn’t work properly. There is an issue opened for ATZ command Making sure you're not a bot! but there is no progress for the patch.

I use MM 1.24.2, which seems to be latest stable on.

If I use AT commands directly over serial port and set everything with AT commands, then add IP address, gateway and DNS on WWAN interface, the modem works fine.

But the idea is to use an automatization daemon like ModemManager to manage the modem.

Yes, in fact the modem shouldn’t be operating in USB mode, and the fact that it switches to MBIM mode for you is a consequence of how the modem is being polled. The modem sees that it’s running on the PCI line and gets information from the kernel that it needs to switch to MBIM mode. This mode doesn’t work properly for this particular modem. I can tell you why: even though all modern modems work efficiently in this mode without overheating and with good speeds — this is a MediaTek problem, since they don’t want to properly maintain their software. That’s why modems like ours have been sitting in the backlog for years and will most likely stay there.

People have gotten our modems running in MBIM mode, and I managed to do it too back when I was a naive newcomer, but after about 10-15 minutes the whole router would reboot, and the logs showed that any issue on the modem and its PCI interface leads to a kernel crash, causing the whole device to reboot. The only mode that actually works reliably for this modem is RNDIS via AT commands, which is stable.

To prevent the modem from switching into MBIM mode, I made a patch in my firmware that disables the PCI line so the modem doesn’t fall into these weird modes and doesn’t lose its tty.

I also fixed the modemdata issue caused by incorrect polling: modemdata-update by Clientik · Pull Request #12 · woziwrt/bpi-r4-deploy · GitHub — it’s already been integrated into my firmware.

If by ModemManager you mean the interface, unfortunately you’ll have to give it up. I think that, like me, you care about stable device operation, so the compromise here is to use only RNDIS + AT. If you keep pursuing this, it’ll be pointless, because I’ve also spent a lot of time reading articles about enthusiasts getting this modem running over PCI, but unfortunately all of that is very unstable and isn’t properly supported.

1 Like

Thank you @Clientiks for this detailed explanation.

When I said I tried to use ModemManager I tried via USB. And here I got issues. Is detected as generic using option driver. MM detects the modem but sometimes doesn’t see SIM card, or if sees the SIM card, I can’t enable the modem.

In debug mode ModemManager logs are like this:

 mmcli -m 0
  --------------------------------
  General  |                 path: /org/freedesktop/ModemManager1/Modem/0
           |            device id: 7acb977d3746ea63a4f530958f14e9446e3e9296
  --------------------------------
  Hardware |         manufacturer: Fibocom Wireless Inc.
           |                model: FM350-GL
           |    firmware revision: 81600.0000.00.29.23.22
           |            supported: gsm-umts, lte
           |              current: gsm-umts, lte
           |         equipment id: 354XXXXXXXXXXXX
  --------------------------------
  System   |               device: /sys/devices/platform/soc/11200000.usb/usb2/2-1/2-1.1
           |              physdev: /sys/devices/platform/soc/11200000.usb/usb2/2-1/2-1.1
           |              drivers: option, rndis_host
           |               plugin: generic
           |         primary port: ttyUSB1
           |                ports: enx000011121314 (net), ttyUSB1 (at), ttyUSB3 (at)
  --------------------------------
  Numbers  |                  own: XXXXXXXXXXX
  --------------------------------
  Status   |       unlock retries: sim-pin (3), sim-puk (10), sim-pin2 (3), sim-puk2 (10)
           |                state: disabled
           |          power state: on
  --------------------------------
  Modes    |            supported: allowed: 2g, 3g, 4g, 5g; preferred: none
           |              current: allowed: 2g, 3g, 4g, 5g; preferred: none
  --------------------------------
  IP       |            supported: ipv4, ipv6, ipv4v6
  --------------------------------
  3GPP     |                 imei: 354XXXXXXXXXXXX
  --------------------------------
  3GPP EPS | ue mode of operation: csps-2
  --------------------------------
  SIM      |     primary sim path: /org/freedesktop/ModemManager1/SIM/0

### mmcli -m 0 -e
### error: couldn't enable the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.MobileEquipment.UnexpectedDataValue: Unexpected data value'
ModemManager[4225]: <dbg> [1783685661.350070] [ttyUSB1/at] device open count is 0 (close)
ModemManager[4225]: <dbg> [1783685661.350151] [ttyUSB1/at] closing serial port...
ModemManager[4225]: <dbg> [1783685661.350528] [ttyUSB1/at] serial port closed
ModemManager[4225]: <dbg> [1783685697.475154] [modem0] [operation 3] default - enable: scheduled
ModemManager[4225]: <dbg> [1783685697.475244] [modem0] [operation 3] default - enable: lock acquired
ModemManager[4225]: <inf> [1783685697.475363] [modem0] processing user request to enable modem...
ModemManager[4225]: <msg> [1783685697.475464] [modem0] state changed (disabled -> enabling)
ModemManager[4225]: <dbg> [1783685697.475817] [ttyUSB1/at] opening serial port...
ModemManager[4225]: <dbg> [1783685697.476222] [ttyUSB1/at] setting up baudrate: 57600
ModemManager[4225]: <dbg> [1783685697.476289] [ttyUSB1/at] no flow control explicitly requested for device
ModemManager[4225]: <dbg> [1783685697.476325] [ttyUSB1/at] port attributes not fully set
ModemManager[4225]: <dbg> [1783685697.476400] [ttyUSB1/at] device open count is 1 (open)
ModemManager[4225]: <dbg> [1783685697.476446] [ttyUSB3/at] opening serial port...
ModemManager[4225]: <dbg> [1783685697.476986] [ttyUSB3/at] setting up baudrate: 57600
ModemManager[4225]: <dbg> [1783685697.477041] [ttyUSB3/at] no flow control explicitly requested for device
ModemManager[4225]: <dbg> [1783685697.477080] [ttyUSB3/at] port attributes not fully set
ModemManager[4225]: <dbg> [1783685697.477158] [ttyUSB3/at] device open count is 1 (open)
ModemManager[4225]: <dbg> [1783685697.477191] [modem0] flashing primary AT port before enabling...
ModemManager[4225]: <dbg> [1783685697.477389] [modem0] running initialization sequence...
ModemManager[4225]: <dbg> [1783685697.477438] [ttyUSB1/at] device open count is 2 (open)
ModemManager[4225]: <dbg> [1783685697.477549] [ttyUSB1/at] --> 'ATZ<CR>'
ModemManager[4225]: <dbg> [1783685697.487876] [ttyUSB1/at] <-- '<CR><LF>+CME ERROR: 59<CR><LF>'
ModemManager[4225]: <dbg> [1783685697.488010] [ttyUSB1/at] operation failure: 59 (Unexpected data value)
ModemManager[4225]: <msg> [1783685697.488088] [modem0] state changed (enabling -> disabled)
ModemManager[4225]: <wrn> [1783685697.488408] [modem0] failed enabling modem: Unexpected data value
ModemManager[4225]: <dbg> [1783685697.488505] [modem0] [operation 3] default - enable: lock released
ModemManager[4225]: <dbg> [1783685697.488560] [ttyUSB1/at] device open count is 1 (close)
ModemManager[4225]: <dbg> [1783685697.488585] [ttyUSB3/at] device open count is 0 (close)
ModemManager[4225]: <dbg> [1783685697.488612] [ttyUSB3/at] closing serial port...
ModemManager[4225]: <dbg> [1783685697.489324] [ttyUSB3/at] serial port closed
ModemManager[4225]: <dbg> [1783685697.489428] [ttyUSB1/at] device open count is 0 (close)
ModemManager[4225]: <dbg> [1783685697.489476] [ttyUSB1/at] closing serial port...
ModemManager[4225]: <dbg> [1783685697.489906] [ttyUSB1/at] serial port closed

When I used it via PCIe mode, is detected via mtk plugin and works fine, if the modem initialize ok.

But via USB, ModemManager fails most of the time.

The worst part is also the crash using 5G Modem DW5934e. Somebody on OpenWRT said to use pcie_port_pm=off to avoid power management on PCIe slot. I notice no more AER errors with this option.

I will take a look on that pull from GitHub.

I have already pointed this out to you in the text above, for USB mode you need to use the AT interface. Once again, the modemmanager package cannot be used for this modem because it is unstable. I also repeat that the power supply to the PCI port is turned off in my firmware, the use of PCI is specifically disabled because it causes problems at the core level and the fact that it works does not mean that it will work stably 24/7. Using this modem, you make specific changes to the firmware for this modem, other modems can work well without disabling PCI

Try downloading the firmware from GitHub, uploading it to an SD card, and testing. It should work. If you’re constantly changing modems, I can’t guarantee that the firmware updates for the 350 modem will work if you connect a different modem.

Please accept this; this issue has been going on for over two years, and no one has found a fix. Everyone on the forums is rebuilding the firmware of anyone who has this modem from the latest versions. I gave you a ready-made recipe for what and how to use, but it seems like you’re being given hints by a neural network that doesn’t understand the context of this problem, which is why there are forums that can explain it clearly.

1 Like