LTE usb module on TX2

Hello,

Anyone here successfully used any usb LTE module (say AT&T beam) on TX2?

More specifically, I am trying to use AT&T beam (netgear aircard 340U) on TX2 and found linux packages here: https://kb.netgear.com/26983/AirCard-340U-AT-T-Beam-Downloads-and-Documentation?cid=wmt_netgear_organic.
When I compile the driver, I got the error as follows (it seems like the kernel is missing a header file). Any solution?


rm -rf *.o ~ core .depend ..cmd *.ko .mod.c .tmp_versions Module. modules.order
make -C /lib/modules/4.4.15-tegra/build SUBDIRS=/usr/src/GobiSerial modules
make[1]: Entering directory ‘/usr/src/linux-headers-4.4.15-tegra’
CC [M] /usr/src/GobiSerial/GobiSerial.o
In file included from ./arch/arm64/include/asm/sysreg.h:23:0,
from ./arch/arm64/include/asm/cpufeature.h:13,
from ./arch/arm64/include/asm/hw_breakpoint.h:20,
from ./arch/arm64/include/asm/processor.h:33,
from ./arch/arm64/include/asm/spinlock.h:21,
from include/linux/spinlock.h:87,
from include/linux/wait.h:8,
from include/linux/fs.h:5,
from include/linux/tty.h:4,
from /usr/src/GobiSerial/GobiSerial.c:75:
./arch/arm64/include/asm/opcodes.h:5:43: fatal error: …/…/arm/include/asm/opcodes.h: No such file or directory
compilation terminated.
scripts/Makefile.build:267: recipe for target ‘/usr/src/GobiSerial/GobiSerial.o’ failed
make[2]: *** [/usr/src/GobiSerial/GobiSerial.o] Error 1
Makefile:1399: recipe for target ‘module/usr/src/GobiSerial’ failed
make[1]: *** [module/usr/src/GobiSerial] Error 2
make[1]: Leaving directory ‘/usr/src/linux-headers-4.4.15-tegra’
Makefile:7: recipe for target ‘all’ failed
make: *** [all] Error 2

Thanks!

It seems like this is a known bug with splitting arm64 headers from regular arm headers:

https://patchwork.kernel.org/patch/9455793/

If you can get ahold of the 32-bit ARM headers for your kernel version, and place them in the file system, you should be able to continue the build.

Hi snarky,

Thanks a lot for the reply!

This is on the TX1 forum, but is actually from a TX2 for a similar problem:
[url]https://devtalk.nvidia.com/default/topic/996712/jetson-tx1/compile-kvaser-linuxcan-driver-in-tx1-fail/post/5136153/#5136153[/url]

The headers package is apparently incorrect, the above is a hack to work around it.

Thanks linuxdev!

Hi linuxdev,
Thanks!
After the driver was compiled and installed, I can see from the log that it worked (actiavted). However, I still cannot use my aircard 340U. The network manager can recognize the aircard showing Sierra Wireless Aircard 340U but as Ethernet Connection (eth1) and it’s gray and disconnected. In contrast, the aircard works well on my ubuntu 16.04 PC as mobile broadband.

Thanks!

I’ve stayed away from wireless setup, so there isn’t much help I can give you there. Apparently the driver is there, but some secondary requirement is not met for the user space software to be able to use the driver. Can anyone here suggest what would cause the card to be visible but disabled in the GUI app?

Given that you seem to be the only one with a Jetson and this particular card, you’d probably be better off with general Linux debugging approaches:
What do the system logs say?
If you start the GUI from the command line, what does it print?
You could also try the Ubuntu support forums, or some other more generic linux-networking support areas.
Also from Google: Netgear AirCard 340u (aka AT&T Beam) on Linux | mtekk's Crib

Hi linuxdev and snarky,

Thanks for the reply. I kind of feel it’s because that TX2 doesn’t have “qcserial” and “qmi_wwan” drivers in the OS. When I tried to modprobe those two dirvers I got:

modprobe: FATAL: Module qcserial not found in directory /lib/modules/4.4.15-tegra

Any chance you know how to install them? Thanks!

I don’t know if this is related or not, but I did see some notes on the internet of needing ModemManager…perhaps this is already there. If this isn’t it, then moving on to kernel config applies.

When it comes to building a full kernel you need to cross compile from your x86_64 host. Some modules can be built directly on the JTX2 if they don’t require the 32-bit compatibility, but I’d suggest to just “bite the bullet” and set up for cross compile. The whole topic of building kernels and configuring isn’t particular to a Jetson, but to start with you need to find out which kernel feature causes qcserial or qmi_wwan to exist; one form would be integrated, in case it would exist without a module and module listings would be irrelevant; the other format is a module. The fact that you couldn’t modprobe shows the module does not exist, it doesn’t really say the feature itself is missing (integrated features never show up with module listings).

So, start by researching which kernel config provides the feature. I found CONFIG_USB_NET_QMI_WWAN is the feature for qmi_wwan. Here is a thread I found about this particular modem:
[url]linux - how do I include the qcserial module in the kernel? - Unix & Linux Stack Exchange

I looked in the source code and the Kconfig file help text says USB_SERIAL_QUALCOMM produces feature qcserial.

There is information on kernel building in documents of [url]https://developer.nvidia.com/embedded/linux-tegra[/url]. There is also a link there for tools, and the GCC 4.8.5 tool is probably what you’d need. Basically there is a complete tool set (tool chain) needed for the 64-bit arm64/aarch64, and to deal with a small amount of 32-bit armhf compatibility, there is also a 32-bit compiler (only the compiler is needed, not the whole chain).

See how far you can get just with the docs, then ask for more detail as needed.

As a general note about building kernels, you should start with the configuration from the running kernel. This is in “/proc/config.gz”, you’d gunzip it, rename it to .config, set the CONFIG_LOCALVERSION to “-tegra” to match the running “uname -r”, and then use something “make menuconfig” or “make nconfig” to find the specific features mentioned above (add them as modules). Build per docs. Then you’d basically copy the “whichever_module.ko” to the Jetson’s proper module directory. If you fail to start with a matching config then you essentially have the wrong source code. If you fail to match the “uname -r” suffix in CONFIG_LOCALVERSION, then your kernel may have issues finding modules.

Thanks. I think I sort of got what you said.

Update:
I made two Makefiles and got the two .ko files into the os modules folder. Now the qcserial seems to work normally but the when I modprobe the qmi-wwan I got an error in dmesg…
[ 6394.825930] qmi_wwan: Unknown symbol usb_cdc_wdm_register (err 0)


  1. Following you guide in [b]https://devtalk.nvidia.com/default/topic/996712/jetson-tx1/compile-kvaser-linuxcan-driver-in-tx1-fail/post/5136153/#5136153[/b] I changed the .config and compiled the full kernel in /usr/local/src/linux-4.4.15/ and found qcserial.o in /usr/local/src/linux-4.4.15/drivers/usb/serial/ and qmi_wwan.o in /usr/local/src/linux-4.4.15/drivers/net/usb/. Do you mind telling me how to generate the certain .ko file? (do I need to?) I don’t know if I should do make install or not…

  2. Another question: as per your instruction, I am making the source kernel using the copied config file (modified to enable the two drivers and match the -tegra version). Based on this, if I sudo make install, would the resulting os files exactly the same as before except the two drivers?

I apologize for asking so many questions (never touched so bottom-level linux stuff before) and thanks a lot for helping me walking through the process.

A feature provided with a kernel config provides one or more symbols. When a symbol can’t be found it implies there was another feature that was a prerequisite to the one failing. One way to solve that is to build the module providing that symbol and insert this prior to inserting the module complaining of the missing symbol. When I look at kernel source I grep for that symbol and find it exported in “drivers/usb/class/cdc-wdm.c”. So something in Kconfig of that directory will be the feature providing that symbol. I suspect the config is USB_WDM (“USB Wireless Device Management support”).

You can generally just “make modules_prepare” then “make modules” and not care that all configured are made…it can be useful as a sanity test that they should build. If you know of a specific module I think you could specify that module with path to build just that, e.g., perhaps try somethig like “make drivers/usb/serial/qcserial.ko” (I have not verified this). Assuming you are cross compiling and named a module output directory on your command line, then “make modules_install” would put module-related stuff there. Since you are cross-compiling for another computer it is just as easy to copy the module directly from your build location to the Jetson. Most of this is a question of how organized you want to be; you won’t want to do a make install on your host unless you’ve set the output directories…you might end up creating a “/lib/modules/” directory on your host instead (the alternate output location is something I always do, but that’s a preference).

From your kernel source you can run “find . -name ‘*.ko’” and you’ll see all .ko files built.

The steps given for building after the copy of config would indeed result in an exact match for everything, except for the addition of the new modules. If you change an integrated feature then you probably should consider that it can no longer be a guaranteed exact match…then the CONFIG_LOCALVERSION should be changed and a whole new kernel and modules would be the proper way to go (adding a module does not change the base kernel; changing the base kernel implies a chain of features may now be drastically different).

Hi linuxdev,

Update:
I followed the instruction on jetsonhacks (JetsonHacks) · GitHub and rebuilt a new kernel. The aircard now can be in use. Thanks a lot for the help! Really learned a lot from you!


I compiled the two .ko files following your instruction instead of by my own Makefiles and I put them into the certain folders. Also, after I check my linux PC (lsmod) I found that I may need a lot more modules to enable the aircard as follows. I checked the source code and the config GUI and they are all checked with yes.

Module Size Used by
qmi_wwan 24576 0
qcserial 20480 0
cdc_wdm 20480 1 qmi_wwan
usb_wwan 20480 1 qcserial
usbnet 45056 2 qmi_wwan,GobiNet
usbserial 53248 2 qcserial,usb_wwan
mii 16384 1 usbnet

qmi-wwan - CONFIG_USB_NET_QMI_WWAN
qcserial - CONFIG_USB_SERIAL_QUALCOMM
cdc-wdm - CONFIG_USB_WDM
usb_wwan - CONFIG_USB_SERIAL_WWAN
usbnet - CONFIG_USB_USBNET
usbserial - CONFIG_USB_SERIAL
mii - CONFIG_MII

Two questions:

  1. How to get mii.ko? I didn’t see the option to compile mii.c as a module.
  2. I got the following in dmesg: (The correct one from my linux PC is in bold after the TX2 one).
    The “unable to handle kernel NULL pointer dereference at vertual address 00000050” is a issue.

[ 949.454159] usb 1-2.1: new high-speed USB device number 5 using xhci-tegra
[ 949.562831] usb 1-2.1: config 1 has an invalid interface number: 9 but max is 0
[ 949.570217] usb 1-2.1: config 1 has no interface number 0
[ 949.576625] usb 1-2.1: New USB device found, idVendor=1199, idProduct=0fff
[ 949.583604] usb 1-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 949.591023] usb 1-2.1: Product: AirCard 340U
[ 949.595393] usb 1-2.1: Manufacturer: Sierra Wireless, Incorporated
[ 949.601666] usb 1-2.1: SerialNumber: 013323002373380
[ 949.607697] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 6
[ 949.615742] usb-storage 1-2.1:1.9: USB Mass Storage device detected
[ 949.622980] usb-storage: probe of 1-2.1:1.9 failed with error -5
[ 952.569812] usb 1-2.1: USB disconnect, device number 5
[ 952.576076] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 6
[ 953.034628] usb 1-2.1: new high-speed USB device number 6 using xhci-tegra
[ 953.143318] usb 1-2.1: config 1 has an invalid interface number: 8 but max is 4
[ 953.150685] usb 1-2.1: config 1 has an invalid interface number: 9 but max is 4
[ 953.158172] usb 1-2.1: config 1 has no interface number 1
[ 953.163652] usb 1-2.1: config 1 has no interface number 4
[ 953.169929] usb 1-2.1: New USB device found, idVendor=1199, idProduct=9051
[ 953.176956] usb 1-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 953.184403] usb 1-2.1: Product: AirCard 340U
[ 953.188737] usb 1-2.1: Manufacturer: Sierra Wireless, Incorporated
[ 953.195008] usb 1-2.1: SerialNumber: 013323002373380
[ 953.201589] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 6
[ 953.210168] usb-storage 1-2.1:1.9: USB Mass Storage device detected
[ 953.216725] scsi host3: usb-storage 1-2.1:1.9
[ 953.248626] usbcore: registered new interface driver qcserial
[ 953.252404] usbcore: registered new interface driver cdc_wdm
[ 953.256752] Unable to handle kernel NULL pointer dereference at virtual address 00000050
[ 953.256754] pgd = ffffffc1b9067000
[ 953.256757] [00000050] *pgd=0000000000000000, *pud=0000000000000000

[ 953.256760] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[ 953.256769] Modules linked in: qmi_wwan(+) cdc_wdm qcserial(+) bnep fuse bluetooth bcmdhd pci_tegra bluedroid_pm
[ 953.256773] CPU: 3 PID: 2107 Comm: systemd-udevd Not tainted 4.4.15-tegra #1
[ 953.256774] Hardware name: quill (DT)
[ 953.256776] task: ffffffc1cdd6e400 ti: ffffffc1b913c000 task.ti: ffffffc1b913c000
[ 953.256784] PC is at wdm_create+0x350/0x3f0 [cdc_wdm]
[ 953.256789] LR is at wdm_create+0x340/0x3f0 [cdc_wdm]
[ 953.256790] pc : [] lr : [] pstate: 80000045
[ 953.256791] sp : ffffffc1b913f850
[ 953.256794] x29: ffffffc1b913f850 x28: ffffffc0013094e0
[ 953.256796] x27: 0000000000001000 x26: ffffffbffd045c88
[ 953.256798] x25: ffffffbffd0550e8 x24: ffffffc0012e3348
[ 953.256800] x23: 0000000000000000 x22: ffffffc1f4379000
[ 953.256802] x21: ffffffbffd045c80 x20: ffffffc1eefae520
[ 953.256804] x19: ffffffc1eefae400 x18: 0000000000000a03
[ 953.256806] x17: 0000007f9b8ee7b8 x16: ffffffc000a6da80
[ 953.256808] x15: ffffffc000a6da80 x14: 0ffffffffffffffb
[ 953.256810] x13: 0000000000000038 x12: 0000000000000008
[ 953.256812] x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f
[ 953.256814] x9 : fefefefefefefeff x8 : 0000000000000000
[ 953.256816] x7 : ffffffc1b92694ce x6 : ffffffc1b9268c10
[ 953.256817] x5 : ffffffc001234a90 x4 : 00000001fed60000
[ 953.256819] x3 : 0000000000000000 x2 : ffffffc1b9268c48
[ 953.256821] x1 : 0000000000000000 x0 : ffffffc1f4379030

[ 953.256823] Process systemd-udevd (pid: 2107, stack limit = 0xffffffc1b913c020)
[ 953.256824] Call trace:
[ 953.256830] [] wdm_create+0x350/0x3f0 [cdc_wdm]
[ 953.256835] [] usb_cdc_wdm_register+0xc/0x38 [cdc_wdm]
[ 953.256843] [] qmi_wwan_bind+0xec/0x268 [qmi_wwan]
[ 953.256849] [] usbnet_probe+0x24c/0x788
[ 953.256855] [] qmi_wwan_probe+0x70/0xf0 [qmi_wwan]
[ 953.256859] [] usb_probe_interface+0x134/0x2f4
[ 953.256865] [] driver_probe_device+0xc8/0x408
[ 953.256867] [] __driver_attach+0x9c/0xa0
[ 953.256870] [] bus_for_each_dev+0x58/0x98
[ 953.256872] [] driver_attach+0x20/0x28
[ 953.256874] [] bus_add_driver+0x1f0/0x294
[ 953.256876] [] driver_register+0x68/0x108
[ 953.256878] [] usb_register_driver+0x88/0x16c
[ 953.256884] [] qmi_wwan_driver_init+0x18/0x38 [qmi_wwan]
[ 953.256888] [] do_one_initcall+0xc8/0x1c0
[ 953.256892] [] do_init_module+0x64/0x1c0
[ 953.256896] [] load_module+0xda0/0x107c
[ 953.256898] [] SyS_finit_module+0x94/0xbc
[ 953.256901] [] el0_svc_naked+0x24/0x28
[ 953.256903] —[ end trace dcd6c610756a156a ]—
[ 953.538318] usbserial: USB Serial support registered for Qualcomm USB modem
[ 954.219921] scsi 3:0:0:0: Direct-Access Aircard Disk Drive 1.00 PQ: 0 ANSI: 2
[ 954.229899] sd 3:0:0:0: [sda] Attached SCSI removable disk


[ 54.061459] usb 1-6.4: new high-speed USB device number 6 using xhci_hcd
[ 54.161888] usb 1-6.4: config 1 has an invalid interface number: 9 but max is 0
[ 54.161889] usb 1-6.4: config 1 has no interface number 0
[ 54.162343] usb 1-6.4: New USB device found, idVendor=1199, idProduct=0fff
[ 54.162345] usb 1-6.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 54.162346] usb 1-6.4: Product: AirCard 340U
[ 54.162347] usb 1-6.4: Manufacturer: Sierra Wireless, Incorporated
[ 54.162347] usb 1-6.4: SerialNumber: 013323002373380
[ 54.187743] usb-storage 1-6.4:1.9: USB Mass Storage device detected
[ 54.188299] usb-storage: probe of 1-6.4:1.9 failed with error -5
[ 54.188319] usbcore: registered new interface driver usb-storage
[ 54.189339] usbcore: registered new interface driver uas
[ 57.691637] usb 1-6.4: USB disconnect, device number 6
[ 58.065545] usb 1-6.4: new high-speed USB device number 7 using xhci_hcd
[ 58.165859] usb 1-6.4: config 1 has an invalid interface number: 8 but max is 4
[ 58.165860] usb 1-6.4: config 1 has an invalid interface number: 9 but max is 4
[ 58.165861] usb 1-6.4: config 1 has no interface number 1
[ 58.165862] usb 1-6.4: config 1 has no interface number 4
[ 58.166350] usb 1-6.4: New USB device found, idVendor=1199, idProduct=9051
[ 58.166352] usb 1-6.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 58.166353] usb 1-6.4: Product: AirCard 340U
[ 58.166354] usb 1-6.4: Manufacturer: Sierra Wireless, Incorporated
[ 58.166354] usb 1-6.4: SerialNumber: 013323002373380
[ 58.167420] usb-storage 1-6.4:1.9: USB Mass Storage device detected
[ 58.167536] scsi host7: usb-storage 1-6.4:1.9
[ 58.174849] usbcore: registered new interface driver usbserial
[ 58.174974] usbcore: registered new interface driver usbserial_generic
[ 58.175008] usbserial: USB Serial support registered for generic
[ 58.176375] usbcore: registered new interface driver cdc_wdm
[ 58.176869] usbcore: registered new interface driver qcserial
[ 58.176878] usbserial: USB Serial support registered for Qualcomm USB modem
[ 58.177339] qcserial 1-6.4:1.2: Qualcomm USB modem converter detected
[ 58.177429] usb 1-6.4: Qualcomm USB modem converter now attached to ttyUSB0
[ 58.177893] qcserial 1-6.4:1.3: Qualcomm USB modem converter detected
[ 58.177938] usb 1-6.4: Qualcomm USB modem converter now attached to ttyUSB1
[ 58.178343] qmi_wwan 1-6.4:1.8: cdc-wdm1: USB WDM device
[ 58.178436] qmi_wwan 1-6.4:1.8 wwan0: register ‘qmi_wwan’ at usb-0000:00:14.0-6.4, WWAN/QMI device, ba:4b:6b:5a:73:4d
[ 58.178454] usbcore: registered new interface driver qmi_wwan
[ 58.178797] qcserial 1-6.4:1.0: Qualcomm USB modem converter detected
[ 58.178851] usb 1-6.4: Qualcomm USB modem converter now attached to ttyUSB2
[ 58.179100] GobiNet: 2014-05-01/NTGR_2.25
[ 58.179113] usbcore: registered new interface driver GobiNet
[ 58.182178] qmi_wwan 1-6.4:1.8 wwp0s20f0u6u4i8: renamed from wwan0
[ 59.166014] scsi 7:0:0:0: Direct-Access Aircard Disk Drive 1.00 PQ: 0 ANSI: 2
[ 59.166188] sd 7:0:0:0: Attached scsi generic sg3 type 0
[ 59.167160] sd 7:0:0:0: [sdd] Attached SCSI removable disk

The reason to use programs like “make nconfig” is that you can find symbols and search for them such that prerequisites are also automatically configured. I suggest using “make nconfig” to find things (you would probably be able to search for “mii” and something will show up). Once modules are actually on the system you can use “depmod -a” to have the system search for and make arrangements for order of module install without naming a specific module.

The error is either a bug of the driver, or a bug of data passed to the driver. From the above I don’t know anything more specific. One example of a reason for this would be if a module were forced to insert even with a missing dependency. Another might be if there is associated firmware and the firmware is missing/incorrect. Be sure to check all requirements of the given card, especially any listings for required firmware.