SIM7600G-H_4G_DONGLE installation on Jetson nano

Hi,

I followed,= below link to install 4g dongle driver but it failed to build.

here is the error while building :
nvidia@nvidia:~/simcom_wwan$ sudo make
[sudo] password for nvidia:
**make -C /lib/modules/4.9.140/build SUBDIRS= modules **
make[1]: *** /lib/modules/4.9.140/build: No such file or directory. Stop.
Makefile:6: recipe for target ‘default’ failed
make: *** [default] Error 2

If I do ls -al then it shows some obsolate simlik path with build, I suspect that is the error creator:
nvidia@nvidia:/lib/modules/4.9.140$ ls -al
total 1168
drwxr-xr-x 4 root root 4096 Jul 15 2020 .
drwxr-xr-x 3 root root 4096 Jul 2 2020 …
lrwxrwxrwx 1 root root 32 Jun 26 2020 build → nvidia@nvidia:/lib/modules/4.9.140$ ls -al
total 1168
drwxr-xr-x 4 root root 4096 Jul 15 2020 .
drwxr-xr-x 3 root root 4096 Jul 2 2020 …
lrwxrwxrwx 1 root root 32 Jun 26 2020 build → /home/donmichael/nano/kernel_out
drwxr-xr-x 2 root root 4096 Jun 26 2020 extra
drwxr-xr-x 8 root root 4096 Jul 15 2020 kernel
-rw-r–r-- 1 root root 366295 Jul 15 2020 modules.alias
-rw-r–r-- 1 root root 360933 Jul 15 2020 modules.alias.bin
-rw-r–r-- 1 root root 21575 Jul 15 2020 modules.builtin
-rw-r–r-- 1 root root 24567 Jul 15 2020 modules.builtin.bin
-rw-r–r-- 1 root root 49206 Jul 15 2020 modules.dep
-rw-r–r-- 1 root root 78760 Jul 15 2020 modules.dep.bin
-rw-r–r-- 1 root root 138 Jul 15 2020 modules.devname
-rw-r–r-- 1 root root 26481 Jul 15 2020 modules.order
-rw-r–r-- 1 root root 85 Jul 15 2020 modules.softdep
-rw-r–r-- 1 root root 96789 Jul 15 2020 modules.symbols
-rw-r–r-- 1 root root 119320 Jul 15 2020 modules.symbols.bin
lrwxrwxrwx 1 root root 84 Jul 15 2020 source → /home/myname/nano/kernel_sources/Linux_for_Tegra/source/public/kernel/kernel-4.9

drwxr-xr-x 2 root root 4096 Jun 26 2020 extra
drwxr-xr-x 8 root root 4096 Jul 15 2020 kernel
-rw-r–r-- 1 root root 366295 Jul 15 2020 modules.alias
-rw-r–r-- 1 root root 360933 Jul 15 2020 modules.alias.bin
-rw-r–r-- 1 root root 21575 Jul 15 2020 modules.builtin
-rw-r–r-- 1 root root 24567 Jul 15 2020 modules.builtin.bin
-rw-r–r-- 1 root root 49206 Jul 15 2020 modules.dep
-rw-r–r-- 1 root root 78760 Jul 15 2020 modules.dep.bin
-rw-r–r-- 1 root root 138 Jul 15 2020 modules.devname
-rw-r–r-- 1 root root 26481 Jul 15 2020 modules.order
-rw-r–r-- 1 root root 85 Jul 15 2020 modules.softdep
-rw-r–r-- 1 root root 96789 Jul 15 2020 modules.symbols
-rw-r–r-- 1 root root 119320 Jul 15 2020 modules.symbols.bin
lrwxrwxrwx 1 root root 84 Jul 15 2020 source → /home/myname/nano/kernel_sources/Linux_for_Tegra/source/public/kernel/kernel-4.9

here is the Makefile used:
obj-m:=simcom_wwan.o
simcom_wwanmodule-objs:=module
KDIR:=/lib/modules/$(shell uname -r)/build
MAKE:=make
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) clean

L4T i am working is : 32.3.1
Pelease help me to resolve this

How about telling us what is the machine you are using for this work?

Does the wiki page ask you to try this on x64 ubuntu host machine or jetson nano?

Also, by default the “build” folder is under /lib/modules/{uname -r}/ folder. I can see that on my jetson nano.
Does your command “uname -r” give you 4.9.140? That is not the one from default jetapck.

Hi,

  1. I am using this on one of our customized board which is designed based on Jetson Nano carrier board. here is the link :
    FLOYD Carrier for NVIDIA Jetson Nano / Xavier NX / TX2 NX

  2. I have tried Jetson Nano host machine instruction given on the wiki page.

  3. the BSP we are using is customized by us to add our interfaces using Jetson Nano Stock BSP sources.

4)"uname -r " gives me 4.9.140.

what do you suggest me to try? You say Am I missing the path or build?

Did you build the kernel by yourself before?

Looks like you forgot to add LOCALVERSION when you built the kernel image. Please check this in our developer guide.

Ok sure I will check on that

Yes, I have built some time

Can I do it now with commands with already flashed BSP? like creating symlink to the build ?

Replacing a new kernel image does not require flash.

Just copy the image file to /boot and replace the old one will take effect.

I am not clear here, which image file I have to copy? build a new image with LOCALVERSION and copy that image?

  1. Didn’t you try to build kernel image before? If you don’t know what I am saying, then how did you upgrade kernel image at that time?

  2. Your current problem is just the makefile fails to find the path under /lib/modules/{uname -r}.
    If you are using default jetpack, the result of “uname -r” will be something like 4.9.140-tegra. Thus, the makefile will go to /lib/modules/4.9.140-tegra and search what it needs. However, the makefile fails to find it on your device. Why? Because there is no such folder. And why no such folder here? Because the “uname -r” gives the different path. And why “uname -r” gives different result? Because your kernel has been re-built before and you didn’t give the LOCALVERSION during compilation.

Yes I didn’t give the LOCALVERSION during compilation earlier, so you are asking me to build image with that and replace the current image right?

Yes, and then see if the makefile will work now.

1 Like

I just need to export LOCALVERSION right? I mean set the environment variable before building as below,
export LOCALVERSION=-tegra

after adding this, the uname -r shall give you a image with -tegra suffix.

okey

Hi,

Now I see uname -r gives image with -tegra suffix.

but issue is not yet resolved:

I get belwo error:
nvidia@nvidia-desktop:~/Desktop/GSM$ ls
Simcom_wwan.zip
nvidia@nvidia-desktop:~/Desktop/GSM$ unzip Simcom_wwan.zip
Archive: Simcom_wwan.zip
creating: simcom_wwan/
inflating: simcom_wwan/Makefile
inflating: simcom_wwan/simcom_wwan.c
nvidia@nvidia-desktop:~/Desktop/GSM$ ls
simcom_wwan Simcom_wwan.zip
nvidia@nvidia-desktop:~/Desktop/GSM$ cd simcom_wwan/
nvidia@nvidia-desktop:~/Desktop/GSM/simcom_wwan$ sudo make
[sudo] password for nvidia:
make -C /lib/modules/4.9.140-tegra/build SUBDIRS= modules
make[1]: *** /lib/modules/4.9.140-tegra/build: No such file or directory. Stop.
Makefile:6: recipe for target ‘default’ failed
make: *** [default] Error 2

nvidia@nvidia-desktop:~/Desktop/GSM/simcom_wwan$ cd /lib/modules/4.9.140-tegra/
nvidia@nvidia-desktop:/lib/modules/4.9.140-tegra$ ls
build kernel modules.alias.bin modules.builtin.bin modules.dep.bin modules.order modules.symbols source
extra modules.alias modules.builtin modules.dep modules.devname modules.softdep modules.symbols.bin

nvidia@nvidia-desktop:/lib/modules/4.9.140-tegra$ ls -al
total 1168
drwxr-xr-x 4 root root 4096 Apr 21 16:09 .
drwxr-xr-x 3 root root 4096 Apr 21 12:45 …
lrwxrwxrwx 1 root root 37 Apr 21 16:05 build → /home/hm/BSP/nano/20210412/kernel_out
drwxr-xr-x 2 root root 4096 Apr 21 16:09 extra
drwxr-xr-x 8 root root 4096 Apr 21 16:05 kernel
-rw-r–r-- 1 root root 366295 Apr 21 16:09 modules.alias
-rw-r–r-- 1 root root 360933 Apr 21 16:09 modules.alias.bin
-rw-r–r-- 1 root root 21575 Apr 21 16:05 modules.builtin
-rw-r–r-- 1 root root 24567 Apr 21 16:09 modules.builtin.bin
-rw-r–r-- 1 root root 49206 Apr 21 16:09 modules.dep
-rw-r–r-- 1 root root 78760 Apr 21 16:09 modules.dep.bin
-rw-r–r-- 1 root root 138 Apr 21 16:09 modules.devname
-rw-r–r-- 1 root root 26481 Apr 21 16:05 modules.order
-rw-r–r-- 1 root root 85 Apr 21 16:09 modules.softdep
-rw-r–r-- 1 root root 96789 Apr 21 16:09 modules.symbols
-rw-r–r-- 1 root root 119320 Apr 21 16:09 modules.symbols.bin
lrwxrwxrwx 1 root root 89 Apr 21 16:05 source →
/home/hm/BSP/nano/20210412/kernel_sources/Linux_for_Tegra/source/public/kernel/kernel-4.9

nvidia@nvidia-desktop:/lib/modules/4.9.140-tegra$ cd /usr/src/
nvidia@nvidia-desktop:/usr/src$ ls
linux-headers-4.9.140-tegra-linux_x86_64 linux-headers-4.9.140-tegra-ubuntu18.04_aarch64 nvidia
nvidia@nvidia-desktop:/usr/src$ pwd

tried to symlink:
nvidia@nvidia-desktop:/lib/modules/4.9.140-tegra$ sudo ln -s /usr/src/linux-headers-4.9.140-tegra-ubuntu18.04_aarch64/ build
nvidia@nvidia-desktop:/lib/modules/4.9.140-tegra$ ls -al
total 1168
drwxr-xr-x 4 root root 4096 Apr 22 11:14 .
drwxr-xr-x 3 root root 4096 Apr 21 12:45 …
lrwxrwxrwx 1 root root 57 Apr 22 11:14 build → /usr/src/linux-headers-4.9.140-tegra-ubuntu18.04_aarch64/
drwxr-xr-x 2 root root 4096 Apr 21 16:09 extra
drwxr-xr-x 8 root root 4096 Apr 21 16:05 kernel
-rw-r–r-- 1 root root 366295 Apr 21 16:09 modules.alias
-rw-r–r-- 1 root root 360933 Apr 21 16:09 modules.alias.bin
-rw-r–r-- 1 root root 21575 Apr 21 16:05 modules.builtin
-rw-r–r-- 1 root root 24567 Apr 21 16:09 modules.builtin.bin
-rw-r–r-- 1 root root 49206 Apr 21 16:09 modules.dep
-rw-r–r-- 1 root root 78760 Apr 21 16:09 modules.dep.bin
-rw-r–r-- 1 root root 138 Apr 21 16:09 modules.devname
-rw-r–r-- 1 root root 26481 Apr 21 16:05 modules.order
-rw-r–r-- 1 root root 85 Apr 21 16:09 modules.softdep
-rw-r–r-- 1 root root 96789 Apr 21 16:09 modules.symbols
-rw-r–r-- 1 root root 119320 Apr 21 16:09 modules.symbols.bin
lrwxrwxrwx 1 root root 89 Apr 21 16:05 source → /home/hm/BSP/nano/20210412/kernel_sources/Linux_for_Tegra/source/public/kernel/kernel-4.9
nvidia@nvidia-desktop:/lib/modules/4.9.140-tegra$

still get this error:
nvidia@nvidia-desktop:~/Desktop/GSM$ cd simcom_wwan/
nvidia@nvidia-desktop:~/Desktop/GSM/simcom_wwan$ sudo make
make -C /lib/modules/4.9.140-tegra/build SUBDIRS= modules
make[1]: Entering directory ‘/usr/src/linux-headers-4.9.140-tegra-ubuntu18.04_aarch64’
make[1]: *** No rule to make target ‘modules’. Stop.
make[1]: Leaving directory ‘/usr/src/linux-headers-4.9.140-tegra-ubuntu18.04_aarch64’
Makefile:6: recipe for target ‘default’ failed
make: *** [default] Error 2
nvidia@nvidia-desktop:~/Desktop/GSM/simcom_wwan$ make
make -C /lib/modules/4.9.140-tegra/build SUBDIRS=/home/nvidia/Desktop/GSM/simcom_wwan modules
make[1]: Entering directory ‘/usr/src/linux-headers-4.9.140-tegra-ubuntu18.04_aarch64’
make[1]: *** No rule to make target ‘modules’. Stop.
make[1]: Leaving directory ‘/usr/src/linux-headers-4.9.140-tegra-ubuntu18.04_aarch64’
Makefile:6: recipe for target ‘default’ failed
make: *** [default] Error 2

Please suggest whats wrong?

Hi,

Further to this I have flashed Nano Stock BSP (L4T 32.3.1)and tried to follow driver building (native ) and installing steps and still I get some issues like below, Please help:

SIM7X00-Driver simcom_wwan Simcom_wwan.zip
nvidia@nvidia-desktop:~/test$ cd simcom_wwan/
nvidia@nvidia-desktop:~/test/simcom_wwan$ ls
Makefile simcom_wwan.c
nvidia@nvidia-desktop:~/test/simcom_wwan$ sudo make
[sudo] password for nvidia:
make -C /lib/modules/4.9.140-tegra/build SUBDIRS= modules
make[1]: Entering directory ‘/usr/src/linux-headers-4.9.140-tegra-ubuntu18.04_aarch64/kernel-4.9’
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/bin2c
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
drivers/net/ethernet/nvidia/Kconfig:30: can’t open file “drivers/net/ethernet/nvidia/eqos/Kconfig”
scripts/kconfig/Makefile:37: recipe for target ‘silentoldconfig’ failed
make[3]: *** [silentoldconfig] Error 1
Makefile:565: recipe for target ‘silentoldconfig’ failed
make[2]: *** [silentoldconfig] Error 2
make[1]: *** No rule to make target ‘include/config/auto.conf’, needed by ‘include/config/kernel.release’. Stop.
make[1]: Leaving directory ‘/usr/src/linux-headers-4.9.140-tegra-ubuntu18.04_aarch64/kernel-4.9’
Makefile:6: recipe for target ‘default’ failed
make: *** [default] Error 2
nvidia@nvidia-desktop:~/test/simcom_wwan$

Hi Now I am able to build with sudo user. here is the log:

nvidia@nvidia-desktop:~/test/simcom_wwan$ ls
Makefile simcom_wwan.c
nvidia@nvidia-desktop:~/test/simcom_wwan$ sudo su
root@nvidia-desktop:/home/nvidia/test/simcom_wwan# make
make -C /lib/modules/4.9.140-tegra/build SUBDIRS=/home/nvidia/test/simcom_wwan modules
make[1]: Entering directory ‘/usr/src/linux-headers-4.9.140-tegra-ubuntu18.04_aarch64/kernel-4.9’
CC [M] /home/nvidia/test/simcom_wwan/simcom_wwan.o
/home/nvidia/test/simcom_wwan/simcom_wwan.c: In function ‘simcom_wwan_suspend’:
/home/nvidia/test/simcom_wwan/simcom_wwan.c:118:17: warning: unused variable ‘dev’ [-Wunused-variable]
struct usbnet *dev = usb_get_intfdata(intf);
^~~
/home/nvidia/test/simcom_wwan/simcom_wwan.c: In function ‘simcom_wwan_resume’:
/home/nvidia/test/simcom_wwan/simcom_wwan.c:136:1: warning: label ‘err’ defined but not used [-Wunused-label]
err:
^~~
/home/nvidia/test/simcom_wwan/simcom_wwan.c:131:17: warning: unused variable ‘dev’ [-Wunused-variable]
struct usbnet *dev = usb_get_intfdata(intf);
^~~
Building modules, stage 2.
MODPOST 1 modules
CC /home/nvidia/test/simcom_wwan/simcom_wwan.mod.o
LD [M] /home/nvidia/test/simcom_wwan/simcom_wwan.ko
make[1]: Leaving directory ‘/usr/src/linux-headers-4.9.140-tegra-ubuntu18.04_aarch64/kernel-4.9’
root@nvidia-desktop:/home/nvidia/test/simcom_wwan# ls
Makefile modules.order Module.symvers simcom_wwan.c simcom_wwan.ko simcom_wwan.mod.c simcom_wwan.mod.o simcom_wwan.o
root@nvidia-desktop:/home/nvidia/test/simcom_wwan# insmod simcom_wwan.ko
root@nvidia-desktop:/home/nvidia/test/simcom_wwan# lsmod
Module Size Used by
simcom_wwan 3881 0
bnep 16562 2
zram 26166 4
overlay 48691 0
fuse 103841 3
spidev 13282 0
nvgpu 1575721 18
bluedroid_pm 13912 0
ip_tables 19441 0
x_tables 28951 1 ip_tables
root@nvidia-desktop:/home/nvidia/test/simcom_wwan#

But I still have issue for below driver:

root@nvidia-desktop:/home/nvidia/test/SIM7X00-Driver# cd Linux_driver/
root@nvidia-desktop:/home/nvidia/test/SIM7X00-Driver/Linux_driver# ls
gobiserial gobiserial.zip ‘How to use the SIM7100 Module in Linux-driver.pdf’
root@nvidia-desktop:/home/nvidia/test/SIM7X00-Driver/Linux_driver# cd gobiserial
root@nvidia-desktop:/home/nvidia/test/SIM7X00-Driver/Linux_driver/gobiserial# ls
GobiSerial.c Kconfig kernel-deploy-guide Makefile Makefile.kernel Readme.txt
root@nvidia-desktop:/home/nvidia/test/SIM7X00-Driver/Linux_driver/gobiserial# make
rm -rf *.o ~ core .depend ..cmd *.ko .mod.c .tmp_versions Module. modules.order
make -C /lib/modules/4.9.140-tegra/build M=/home/nvidia/test/SIM7X00-Driver/Linux_driver/gobiserial modules
make[1]: Entering directory ‘/usr/src/linux-headers-4.9.140-tegra-ubuntu18.04_aarch64/kernel-4.9’
CC [M] /home/nvidia/test/SIM7X00-Driver/Linux_driver/gobiserial/GobiSerial.o
/home/nvidia/test/SIM7X00-Driver/Linux_driver/gobiserial/GobiSerial.c:56:10: fatal error: linux/drivers/usb/serial/usb-wwan.h: No such file or directory
#include <linux/drivers/usb/serial/usb-wwan.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
scripts/Makefile.build:341: recipe for target ‘/home/nvidia/test/SIM7X00-Driver/Linux_driver/gobiserial/GobiSerial.o’ failed
make[2]: *** [/home/nvidia/test/SIM7X00-Driver/Linux_driver/gobiserial/GobiSerial.o] Error 1
Makefile:1629: recipe for target ‘module/home/nvidia/test/SIM7X00-Driver/Linux_driver/gobiserial’ failed
make[1]: *** [module/home/nvidia/test/SIM7X00-Driver/Linux_driver/gobiserial] Error 2
make[1]: Leaving directory ‘/usr/src/linux-headers-4.9.140-tegra-ubuntu18.04_aarch64/kernel-4.9’
Makefile:6: recipe for target ‘all’ failed
make: *** [all] Error 2
root@nvidia-desktop:/home/nvidia/test/SIM7X00-Driver/Linux_driver/gobiserial#

https://www.waveshare.com/w/upload/4/42/SIM7X00-Driver.7z (driver)