We setup the TX2 using JetPack 3.3 and it has working wifi (wlan0 connected to network).
Then, we compiled a custom kernel using TX2 R28.2.1 sources. Only additional v4l2 sensor drivers were included in this custom kernel. Compilation was done using the following commands:
make O=$TEGRA_KERNEL_OUT tegra18_defconfig
make -B -j8 O=$TEGRA_KERNEL_OUT zImage
make -B -j1 O=$TEGRA_KERNEL_OUT dtbs
The compiled kernel and device tree are transferred to /Linux_for_Tegra/kernel/
The kernel image (Image) and compressed image (zImage) are both copied to /boot directory of TX2. Then, device tree is flashed using the command:
sudo ./flash.sh -r -k kernel-dtb jetson-tx2 mmcblk0p1
The v4l2 sensor works properly after flashing. However, wifi is no longer working. We only see a bridge connection automatically created (l4tbr0) and there is no wlan0.
Can anyone help us? How do we properly compile a custom kernel with enabled wifi/wlan0?
I guess this issue comes from the mismatch name of kernel version so that “lsmod” should have no bcmdhd driver.
If you compiled your own kernel image, you could check the kernel tag with command “uname -r”, and it should be 4.4.38.
However, original kernel version should be “4.4.38-tegra”. This difference would make modprobe to search different path of *.ko files.
That is, if you use your own kernel image, it would go searching /lib/module/4.4.38, which does not exist in rootfs at all.
You could firstly check my assumption by using “lsmod” and see if bcmdhd is there or not.
If there is no modules, please try below method
- You could add version suffix “tegra” during building kernel image.
- Or you could just follow the L4T document to build your own kernel modules as well. This time it would create /lib/module/4.4.38 and modprobe would able to load it automatically.
Thanks for the help.
The “lsmod” command showed that there are no modules included.
I tried your suggestion to add version suffix “tegra” during kernel build. However, I get the following error when running menuconfig:
make O=$TEGRA_KERNEL_OUT menuconfig
make: Entering directory '/home/hostpc/nvidia/tx2/kernel'
In file included from /home/hostpc/nvidia/source/kernel/kernel-4.4/scripts/kconfig/mconf.c:23:0:
/home/hostpc/nvidia/source/kernel/kernel-4.4/scripts/kconfig/lxdialog/dialog.h:38:20: fatal error: curses.h: No such file or directory
scripts/Makefile.host:108: recipe for target 'scripts/kconfig/mconf.o' failed
make: *** [scripts/kconfig/mconf.o] Error 1
/home/hostpc/nvidia/source/kernel/kernel-4.4/Makefile:542: recipe for target 'menuconfig' failed
make: *** [menuconfig] Error 2
make: Leaving directory '/home/hostpc/nvidia/tx2/kernel'
Makefile:150: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
Is there any other way in setting the version suffix?
Does it work if you add CONFIG_LOCALVERSION="-tegra" inside defconfig?
Is it a clean build?
I was able to run the menuconfig by installing libncurses5-dev.
I successfully flashed my custom kernel with wifi enabled using your first suggestion. I added -tegra as local version suffix.
Thanks for you help!
Should CONFIG_LOCALVERSION="-tegra" go in defconfig or tegra18_defconfig?
For TX2, it should go inside tegra18_defconfig.
When I do this I end up with the name 4.4.38-tegra+ instead of 4.4.38-tegra.
This creates 2 folders in my /lib/modules directory on the jetson.
It did fix my wifi which is nice but now I can’t modprobe anything.
How do I get rid of the plus to only have one kernel inside modules folder?
Basically you look in the kernel source “scripts/setlocalversion” file. Find the function “scm_version()”. Change it to force return with nothing done (insert this near the top will do the trick):
If you look closer you will find this appends from a file “.scmversion”. You could alternately remove that file.