Fibocom FM350-GL Support

You mean The Post by AndrewZ?

I don't think ModemManager supports this modem in the given configuration (USB+RNDIS).
From what I see this modem needs to be connected to PCI bus first, then MM will be able to talk MBIM to it.

What you can probably do right now is remove MM, manually initiate connection from a terminal and read IP address(es), then manually configure the interface with the IP obtained from the modem.
If you're comfortable with scripting you can probably automate this procedure.

I'm a novice linux user and this does not help much...

then your in way over your head, unless @AndrewZ will elaborate.

well for starters I could try to manually configure the interface, without automation. But how?

Try to look here - evana/ModemManager-FM350-GL Copr

this sounds promising. It's bit over my head, so correct me if I'm wrong:
It's for fedora, so I should download the source and try to compile it?
Or just get the source for same version from here? https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/tags

I can't tell you here. I found information on the Internet, but I did not test it myself. I have OpenWRT and the modem works fine in it.

what did you do to get it working? I see some people have it working, but can't find the steps they took.

Hey, I've posted earlier what you need to do to get this to work.

Connectconnect using these AT commands:

AT+CGDCONT=1,"IP","mobile.o2.co.uk"
AT+CGACT=1,1

Then to get the IP address:

AT+CGPADDR=1

I then set the IP manually and the gateway to "x.x.x.1" with subnet of /24 and the connection works.

Please give it a try if you have the module and let me know how it works

At first, I wrote my own script to automate the process, but the Prusa solution is much more convenient and elegant.

Yes I do this and I get IP address, but what next, step by step? It does not appear as network interface, I only get many virtual com ports, ttyUSB0...ttyUSB8... But nothing else, or I could not find.

The @Prusa's luci-proto works for me, but I had to remove line 17 send "AT+CGPADDR=1^m" from the etc/gcom/fm350-connect.gcom file.

I also added a service /etc/init.d/fm350:

#!/bin/sh /etc/rc.common

START=99

start() {
    echo "0e8d 7126" > /sys/bus/usb-serial/drivers/generic/new_id
    echo "0e8d 7127" > /sys/bus/usb-serial/drivers/generic/new_id
}

In my repo i put some step by step instruction plus some scripts.
Feel free to use it.
Driver: optional without ModemManager (it works under kernel 6.1 and 6.6 for older kernel the generic driver is ok)

One general remark:
I noticed that router reboot with any linux command like "init 6" or "reboot" make the modem inaccessible somehow. I suggest power off/ power on if the reboot is needed.

Erratum:
I put another file fm350gl_reconnect.sh to work with crontab entry for every 30s checks and reconnecting while is broken. This is an idea how it could work - to be tested and validated :slight_smile: good is that modem is ready to work with commands to re-init :slight_smile:

@daniel :smiley:

After last clock fix on pcie2 modem fm350gl stopped to work in USB mode and now it appears like:
root@OpenWrt:/# lspci
...
0003:01:00.0 Wireless controller [0d40]: MEDIATEK Corp. Device 4d75 (rev 01) >>

I wish to know if there is any chance to have a control on it (how we can revert such clock fix if not used - in my case before it was not used and in the slot modem fm350gl was working ok? otherwise I dont know of we can go with trying to fix the issue on pcie communication here. Probably we need a kmod_t7xx (https://cateee.net/lkddb/web-lkddb/MTK_T7XX.html ) but it seems now it is not yet available in openwrt?

============================================

Per now I found only way to come back as revert the patch:

in target/linux/mediatek/patches-6.x/252-clk-mediatek-mt7988-infracfg-fix-clocks-for-2nd-PCIe.patch (line 159):
is (pcie mode): "infra_pcie_peri_ck_26m_ck_p3", 9),
should be (usb mode): "csw_infra_f26m_sel", 9),

and recompile the image.

It's easy to package the driver to use the modem in PCIe mode which will be better and faster than using USB:

2 Likes

Huston, Huston.... :wink:

[ 12.686678] Call trace:
[ 12.689114] t7xx_cldma_hw_set_start_addr+0x1c/0x3c [mtk_t7xx]
[ 12.694942] t7xx_fsm_uninit+0x578/0x5ec [mtk_t7xx]
[ 12.699814] process_one_work+0x154/0x2a0
[ 12.703818] worker_thread+0x2ac/0x488
[ 12.707558] kthread+0xe0/0xec
[ 12.710603] ret_from_fork+0x10/0x20
[ 12.714172] Code: f9400800 91001000 8b214001 d50332bf (f9000022)
[ 12.720253] ---[ end trace 0000000000000000 ]---
[ 12.731558] pstore: backend (ramoops) writing error (-28)
[ 12.736948] Kernel panic - not syncing: Oops: Fatal exception
[ 12.742680] SMP: stopping secondary CPUs
[ 12.746593] Kernel Offset: disabled
[ 12.750069] CPU features: 0x0,00000000,20000000,1000400b
[ 12.755370] Memory Limit: none
[ 12.765071] Rebooting in 1 seconds..
PANIC at PC : 0x000000004300490c

reboot

[ 14.527729] Call trace:
[ 14.530166] t7xx_cldma_hw_set_start_addr+0x1c/0x3c [mtk_t7xx]
[ 14.535993] t7xx_fsm_uninit+0x500/0x5ec [mtk_t7xx]
[ 14.540865] process_one_work+0x154/0x2a0
[ 14.544870] worker_thread+0x2ac/0x488
[ 14.548610] kthread+0xe0/0xec
[ 14.551655] ret_from_fork+0x10/0x20
[ 14.555224] Code: f9400800 91001000 8b214001 d50332bf (f9000022)
[ 14.561303] ---[ end trace 0000000000000000 ]---
[ 14.572501] pstore: backend (ramoops) writing error (-28)
[ 14.577889] Kernel panic - not syncing: Oops: Fatal exception
[ 14.583622] SMP: stopping secondary CPUs
[ 14.587534] Kernel Offset: disabled
[ 14.591009] CPU features: 0x0,00000000,20000000,1000400b
[ 14.596310] Memory Limit: none
[ 14.605895] Rebooting in 1 seconds..

PANIC at PC : 0x000000004300490c

[ 74.711006] mtk_t7xx 0003:01:00.0: MD handshake timeout
[ 74.716239] mtk_t7xx 0003:01:00.0: Boot Handshake failure

This modem is a bit chimerical and needs a long time to reboot or setup...

(Always) complete logs please, the interesting part just above is missing.

I will try to compile to the kernel module and next load manually after the system starts but it fails too:

root@BPI-R4:/nvme/work# opkg install kmod-mtk-t7xx_6.6.22-1_aarch64_cortex-a53.i
pk
Installing kmod-mtk-t7xx (6.6.22-1) to root...
Configuring kmod-mtk-t7xx.
[ 293.991022] kmodloader: loading kernel modules from /etc/modules.d/*
[ 294.003962] mtk_t7xx 0003:01:00.0: assign IRQ: got 113
[ 294.009118] mtk_t7xx 0003:01:00.0: enabling device (0000 -> 0002)
[ 294.015264] mtk_t7xx 0003:01:00.0: enabling bus mastering
[ 294.021935] (unnamed net_device) (dummy): netif_napi_add_weight() called with weight 128
[ 294.031195] mtk-pcie-gen3 11280000.pcie: msi#0x1 address_hi 0x0 address_lo 0x11280c00 data 1
[ 294.039711] mtk-pcie-gen3 11280000.pcie: msi#0x2 address_hi 0x0 address_lo 0x11280c00 data 2
[ 294.043437] Unable to handle kernel paging request at virtual address ffffffc084a1f004
[ 294.048210] mtk-pcie-gen3 11280000.pcie: msi#0x3 address_hi 0x0 address_lo 0x11280c00 data 3
[ 294.051334] Unable to handle kernel paging request at virtual address ffffffc084a1d004
[ 294.051339] Mem abort info:
[ 294.051340] ESR = 0x0000000096000061
[ 294.051342] EC = 0x25: DABT (current EL), IL = 32 bits
[ 294.051346] SET = 0, FnV = 0
[ 294.051347] EA = 0, S1PTW = 0
[ 294.051349] FSC = 0x21: alignment fault
[ 294.051352] Data abort info:
[ 294.051353] ISV = 0, ISS = 0x00000061, ISS2 = 0x00000000
[ 294.051355] CM = 0, WnR = 1, TnD = 0, TagAccess = 0
[ 294.051357] GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[ 294.051360] swapper pgtable: 4k pages, 39-bit VAs, pgdp=0000000046ad6000
[ 294.051362] [ffffffc084a1d004] pgd=100000013ffff003, p4d=100000013ffff003, pud=100000013ffff003, pmd=0068000020a00711
[ 294.051373] Internal error: Oops: 0000000096000061 [#1] SMP
[ 294.051377] Modules linked in: mtk_t7xx(+) qcserial pppoe ppp_async option nft_fib_inet nf_flow_table_inet mt7921u(O) mt7921s(O) mt7921e(O) mt7921_common(O) iwlmvm(O) iwldvm(O) usb_wwan rndis_host qmi_wwan pppox ppp_generic nft_reject_ipv6 nft_reject_ipv4 nft_reject_inet nft_reject nft_redir nft_quota nft_numgen nft_nat nft_masq nft_log nft_limit nft_hash nft_flow_offload nft_fib_ipv6 nft_fib_ipv4 nft_fib nft_ct nft_chain_nat nf_tables nf_nat nf_flow_table nf_conntrack mt7996e(O) mt792x_usb(O) mt792x_lib(O) mt7915e(O) mt76_usb(O) mt76_sdio(O) mt76_connac_lib(O) mt76(O) mac80211(O) iwlwifi(O) huawei_cdc_ncm cfg80211(O) cdc_ncm cdc_ether wwan usbserial usbnet slhc sfp rtc_pcf8563 nfnetlink nf_reject_ipv6 nf_reject_ipv4 nf_log_syslog nf_defrag_ipv6 nf_defrag_ipv4 mt6577_auxadc mdio_i2c libcrc32c compat(O) cdc_wdm cdc_acm at24 crypto_safexcel pwm_fan i2c_gpio i2c_smbus industrialio i2c_algo_bit i2c_mux_reg i2c_mux_pca954x i2c_mux_pca9541 i2c_mux_gpio i2c_mux dummy oid_registry tun sha512_arm64 sha1_ce sha1_generic seqiv
[ 294.051501] md5 geniv des_generic libdes cbc authencesn authenc leds_gpio xhci_plat_hcd xhci_pci xhci_mtk_hcd xhci_hcd nvme nvme_core gpio_button_hotplug(O) dm_mirror dm_region_hash dm_log dm_crypt dm_mod dax usbcore usb_common ptp aquantia pps_core mii tpm encrypted_keys trusted
[ 294.051543] CPU: 3 PID: 5266 Comm: kworker/u9:1 Tainted: G O 6.6.22 #0
[ 294.051549] Hardware name: Bananapi BPI-R4 (DT)
[ 294.051551] Workqueue: md_hk_wq t7xx_fsm_uninit [mtk_t7xx]
[ 294.051569] pstate: 804000c5 (Nzcv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 294.051573] pc : t7xx_cldma_hw_set_start_addr+0x1c/0x3c [mtk_t7xx]
[ 294.051585] lr : t7xx_cldma_start+0xac/0x13c [mtk_t7xx]
[ 294.051595] sp : ffffffc085d63d30
[ 294.051597] x29: ffffffc085d63d30 x28: 0000000000000000 x27: 0000000000000000
[ 294.051602] x26: 0000000000000000 x25: ffffff80c804f2c0 x24: ffffff80ca196c05
[ 294.051608] x23: 0000000000000000 x22: ffffff80c814b9b8 x21: ffffff80c814b128
[ 294.051613] x20: 0000000000000001 x19: ffffff80c814b080 x18: 0000000000000014
[ 294.051618] x17: 0000000055c9806b x16: 000000007c5296d0 x15: 000000000f6bca68
[ 294.051623] x14: 00000000dbdbdce4 x13: 000000001aeaf72a x12: 0000000000000001
[ 294.051627] x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000
[ 294.051632] x8 : ffffff80ca1ef6b4 x7 : ffffff80c814b818 x6 : 0000000000000018
[ 294.051637] x5 : 0000000000000870 x4 : 0000000000000000 x3 : 0000000000000000
[ 294.051641] x2 : 000000010a947000 x1 : ffffffc084a1d004 x0 : ffffffc084a1d004
[ 294.051647] Call trace:
[ 294.051649] t7xx_cldma_hw_set_start_addr+0x1c/0x3c [mtk_t7xx]
[ 294.051659] t7xx_fsm_uninit+0x578/0x5ec [mtk_t7xx]
[ 294.051669] process_one_work+0x154/0x2a0
[ 294.051678] worker_thread+0x2ac/0x488
[ 294.051682] kthread+0xe0/0xec
[ 294.051686] ret_from_fork+0x10/0x20
[ 294.051693] Code: f9400800 91001000 8b214001 d50332bf (f9000022)
[ 294.051695] ---[ end trace 0000000000000000 ]---
[ 294.056043] Mem abort info:
[ 294.056044] ESR = 0x0000000096000061
[ 294.056046] EC = 0x25: DABT (current EL), IL = 32 bits
[ 294.056048] SET = 0, FnV = 0
[ 294.056050] EA = 0, S1PTW = 0
[ 294.056051] FSC = 0x21: alignment fault
[ 294.056053] Data abort info:
[ 294.056054] ISV = 0, ISS = 0x00000061, ISS2 = 0x00000000
[ 294.058817] pstore: backend (ramoops) writing error (-28)
[ 294.058820] Kernel panic - not syncing: Oops: Fatal exception
[ 294.058822] SMP: stopping secondary CPUs
[ 294.072372] CM = 0, WnR = 1, TnD = 0, TagAccess = 0
[ 294.072374] GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[ 294.072376] swapper pgtable: 4k pages, 39-bit VAs, pgdp=0000000046ad6000
[ 294.072379] [ffffffc084a1f004] pgd=100000013ffff003, p4d=100000013ffff003, pud=100000013ffff003, pmd=0068000020a00711
[ 295.071707] SMP: failed to stop secondary CPUs 0,3
[ 295.476407] Kernel Offset: disabled
[ 295.479884] CPU features: 0x0,00000000,20000000,1000400b
[ 295.485184] Memory Limit: none
[ 295.495376] Rebooting in 3 seconds..
[ 299.504620] SMP: failed to stop secondary CPUs 0,3
PANIC at PC : 0x000000004300490c

I have replaced build_dir/.../t7xx directory with (newer one?) from https://github.com/torvalds/linux/blob/master/drivers/net/wwan/t7xx

compiled and .... the same.... KERNEL PANIC

@daniel any idea?

Using driver from Linux git HEAD would also have been the first thing I'd have tried. Sad that it doesn't solve it, so the driver is buggy or something with PCIe MMIO ranges is borked.

From first glance it looks like the driver is accessing an address in the PCIe MMIO range in 32-bit alignment (ffffffc084a1d004) but likely the SoC only supports 64-bit aligned (so only addresses ending on 0 or 8 will work) access there, hence the [ 294.051349] FSC = 0x21: alignment fault.

I've ordered the hardware and will have it in a week or two,