Building WIFI-brcmfmac backports on 32.7.3 for Jetson Nano B01 board

Hello!

I am building WIFI backports driver modules for Jetson Nano B01 platform. Below are the packages and versions used for the build:
Linux Driver Package -32.7.3
JetPack - 4.6.3
Kernel version - 4.9.299 tegra
Infineon wifi backport package- v5.15.58-backports

I am facing issues while building latest Infineon WIFI backport drivers ,which is v5.15.58 backports ,against the latest Jetson Linux kernel 4.9.299. I have followed the steps for kernel build as well as cross compiling the backport modules as mentioned below :

1.Manually downloaded the latest kernel source package 32.7.3 from the below link.
https://developer.nvidia.com/embedded/linux-tegra-r3273
Also, downloaded and extracted the Jetson Linux toolchain from the below link.
https://developer.nvidia.com/embedded/dlc/l4t-gcc-7-3-1-toolchain-64-bit

  1. The paths for the toolchain and kernel output directory are set for Jetson Nano Linux kernel as mentioned below :
  • export TEGRA_KERNEL_OUT=/home/eng/Documents/NvidiaNano/L4T_Kernel_Blt

  • export CROSS_COMPILE=/home/eng/Documents/NvidiaNano/Env_Setup/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-

  • export ARCH=arm64

  • export LOCALVERSION=“-tegra”

3.Cleaning the kernel for a clean build and Jetson nano configuration is made as the default configuration in kernel, which is tegra_defconfig as shown in the below commands :

  • make distclean

  • make ARCH=arm64 O=$TEGRA_KERNEL_OUT LOCALVERSION=“-tegra” CROSS_COMPILE=“${CROSS_COMPILE}” tegra_defconfig

  1. The kernel is configured with respect to WIFI by setting the flags as mentioned below in the menuconfig.
  • make ARCH=arm64 O=$TEGRA_KERNEL_OUT LOCALVERSION=“-tegra” menuconfig

Setting the below configuration in .config file.
CONFIG_CFG80211=m
CONFIG_BCMDHD=n
CONFIG_ASYMMETRIC_KEY_TYPE=y
CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
CONFIG_X509_CERTIFICATE_PARSER=y
CONFIG_PKCS7_MESSAGE_PARSER=y

  1. After configuring the kernel with respect to WIFI, kernel configuration is saved through the below command :
  • make ARCH=arm64 O=$TEGRA_KERNEL_OUT LOCALVERSION=“-tegra” CROSS_COMPILE=“${CROSS_COMPILE}” savedefconfig
  1. Compilation of the kernel and image file generation in the output kernel directory,that is ,L4T_Kernel_Blt .
  • make ARCH=arm64 O=$TEGRA_KERNEL_OUT LOCALVERSION=“-tegra” -j8
  1. The images -Image,Image.gz and dts are generated in the output kernel directory .The Linux kernel image and dts are stored in arch/arm64/boot/Image and arch/arm64/boot/dts respectively. They are copied to JetPack 4.6.3 release packages in the below path :

~/nvidianew/nvidia_sdk/JetPack_4.6.3_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/kernel/

  1. The kernel modules and firmware is installed through the below command :
  • sudo make ARCH=arm64 O=$TEGRA_KERNEL_OUT modules_install INSTALL_MOD_PATH=~/nvidianew/nvidia_sdk/JetPack_4.6.3_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/rootfs/
  1. Running the applybinaries.sh in JetPack4.6.3 release package and copy the kernel_supplements.tbz2 from rootfs to kernel in Jetpack package.

*cp ~/nvidianew/nvidia_sdk/JetPack_4.6.3_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/rootfs/kernel_supplements.tbz2 ~/nvidianew/nvidia_sdk/JetPack_4.6.3_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/kernel

  1. The kernel headers for Jetson nano kernel is extracted and then prepared through the below commands :
  • mkdir FMAC_module

  • mkdir mod_dep

  • cd mod_dep

  • tar -xjf /nvidia_sdk/JetPack_4.6.3_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/kernel/kernel_headers.tbz2

  • make ARCH=arm64 O=$TEGRA_KERNEL_OUT -j8 modules_prepare

  1. Kernel headers are installed through the below step:
  • make ARCH=arm64 INSTALL_HDR_PATH=$TEGRA_KERNEL_OUT headers_install
  1. Building WIFI backports modules (v5.15.58) for Nvidia kernel 4.9.
    The steps done are mentioned below :
    a) Backports package is diwnloaded from the below link :

https://community.infineon.com/t5/Wi-Fi-Bluetooth-for-Linux/Cypress-Linux-WiFi-Driver-Release-FMAC-2022-12-23/td-p/389610

b) Extract the packages and go into backport source code directory.
cd v5.15.58-backports

c) The MY_KERNEL ,MY_ROOT and CROSS_COMPILE paths are exported for compilation. MY_KERNEL represents compiled target Jetson kernel built in Step 6. MY_ROOT represents the rootfs path where the modules were installed.

  • export MY_KERNEL=/home/eng/Documents/NvidiaNano/L4T_Kernel_Blt

  • export CROSS_COMPILE=/home/eng/Documents/NvidiaNano/Env_Setup/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-

  • export MY_ROOT=/home/eng/nvidianew/nvidia_sdk/JetPack_4.6.3_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/rootfs/lib/modules/4.9.299-tegra/

d) The .config file is generated using defconfig-brcmfmac,which is configuration for FMAC driver as mentioned below in the command:

make ARCH=arm64 KLIB=$MY_ROOT KLIB_BUILD=$MY_KERNEL defconfig-brcmfmac

e) Kernel modules are cross compiled and FMAC driver modules(.ko files) are generated through the below command :

make ARCH=arm64 KLIB=$MY_ROOT KLIB_BUILD=$MY_KERNEL LOCALVERSION=“-tegra” modules

I am facing the issue in this command while generating driver modules.
I am getting implicit declaration error for the functions BUILD_BUG_ON ,BUILD_BUG,etc.
I am attaching the screenshots and logs of the errors for the same.
I have used the backports package(v5.15.58) which is the latest release in december 2022.
I wanted to enquire whether v5.15.58 backports is compatible with Nvidia 32.7.3 kernel 4.9 for latest Jetpack 4.6.3.

Thanks and Regards,
Akshay Dharmapuri







WIFI_modules_build_error.txt (21.5 KB)

Hi,
You may try to fix the compiling error to build out the ko file first. Or try to build it on Jetson Nano.

Hi Dane,

I am getting the error while compilation of backports for jetson 32.7.3 kernel 4.9 .Will try to fix that.
I wanted to enquire whether 5.15.58 backports is compatible with Nvidia latest JetPack 4.6.3 -32.7.3 ?

Thanks and Regards,
Akshay Dharmapuri

We don’ know that. You may need to check with Infineon.

Hello,

Oh ok sure Thanks a lot for the support.
I have built WIFI backports driver modules for Jetson Nano B01 platform. Below are the packages and versions used for the build:
Linux Driver Package -32.7.3
JetPack - 4.6.3
Kernel version - 4.9.299 tegra
Infineon wifi backport package- v5.15.58-backports

The 4 .ko files -compat.ko,brcmutil.ko,brcmfmac.ko and cfg80211.ko are generated after building Wifi backports for Nvidia latest kernel 4.9.

Dts file for wifi-fmac is copied to the below path in the nano kernel-source and also in the Makefile. Also I have copied the dts file to the overlays path also.

The screenshots for the Makefile and the path are shown below :

/home/eng/Documents/NvidiaNano/Linux_for_Tegra/source/public/hardware/nvidia/platform/t210/porg/kernel-dts

/home/eng/Documents/NvidiaNano/Linux_for_Tegra/source/public/hardware/nvidia/platform/tegra/common/kernel-dts/overlays

tegra210-p3448-0000-p3449-0000-b00-cypress-btwifi-fmac.dts (323.5 KB)

I am attaching screenshots for the same.


After compiling the nvidia kernel 2nd time ,I am getting the following issues as shown in the screenshot:
I have followed the below steps for kernel and boot image generation :

  1. The paths for the toolchain and kernel output directory are set for Jetson Nano Linux kernel as mentioned below :
  • export TEGRA_KERNEL_OUT=/home/eng/Documents/NvidiaNano/L4T_Kernel_Blt
  • export CROSS_COMPILE=/home/eng/Documents/NvidiaNano/Env_Setup/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
  • export ARCH=arm64
  • export LOCALVERSION=“-tegra”

2.Cleaning the kernel for a clean build and Jetson nano configuration is made as the default configuration in kernel, which is tegra_defconfig as shown in the below commands :

  • make distclean
  • make ARCH=arm64 O=$TEGRA_KERNEL_OUT LOCALVERSION=“-tegra” CROSS_COMPILE=“${CROSS_COMPILE}” tegra_defconfig
  1. The kernel is configured with respect to WIFI by setting the flags as mentioned below in the menuconfig.
  • make ARCH=arm64 O=$TEGRA_KERNEL_OUT LOCALVERSION=“-tegra” menuconfig

Setting the below configuration in .config file.
CONFIG_CFG80211=m
CONFIG_BCMDHD=n
CONFIG_ASYMMETRIC_KEY_TYPE=y
CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
CONFIG_X509_CERTIFICATE_PARSER=y
CONFIG_PKCS7_MESSAGE_PARSER=y
CONFIG_ARCH_LAYERSCAPE=y
CONFIG_CRYPTO_DEV_FSL_CAAM_PKC_API=y
CONFIG_CRYPTO_DEV_FSL_CAAM=y
CONFIG_CRYPTO_DEV_FSL_CAAM_JR=y
CONFIG_MODULE_SIG=y
CONFIG_OID_REGISTRY=y
CONFIG_ASN1=y
CONFIG_SYSTEM_DATA_VERIFICATION=y
CONFIG_SYSTEM_TRUSTED_KEYRING=y
CONFIG_KEYS=y
CONFIG_CRYPTO=y
CONFIG_CRYPTO_RSA=y

  1. After configuring the kernel with respect to WIFI, kernel configuration is saved through the below command :
  • make ARCH=arm64 O=$TEGRA_KERNEL_OUT LOCALVERSION=“-tegra” CROSS_COMPILE=“${CROSS_COMPILE}” savedefconfig
  1. Compilation of the kernel and image file generation in the output kernel directory,that is ,L4T_Kernel_Blt .
  • make ARCH=arm64 O=$TEGRA_KERNEL_OUT LOCALVERSION=“-tegra” -j8

I got the below header missing issues when I compile the nvidia kernel again after doing distclean and mrproper.
Please guide for the same.



Thanks and Regards
Akshay Dharmapuri

Hi,
You may begin with default config and enable the config one by one. To clarify which config triggers the failure.

Sure Dane Thanks a lot will try that…
Is the kernel getting corrupted after compiling jetson kernel 2nd time?

So it would be a menuconfig flag setting issue in the make menuconfig in nvidia jetson kernel source code 4.9

Hi,
Please try to modify tegra_defconfig and execute the commands:

kernel/kernel-4.9$ make ARCH=arm64 O=$KERNEL_OUT tegra_defconfig
kernel/kernel-4.9$ make ARCH=arm64 O=$KERNEL_OUT -j5

To make sure it can build successfully first, and then remove KERNEL_OUT and do clean build.

Sure Thanks a lot Dane for the support .will execute them

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.