Wifi driver fmac modules Build and bring up for Nvidia Nano B01 board

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
akshayd
Level 1
Level 1
5 sign-ins First reply posted First question asked

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-2...

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-compat.ko,brcmfmac.ko,brcmutil.ko and cfg80211.ko.
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 know whether the macro definations for the functions can be done-BUILD_BUG,BUILD_BUG_ON,BUILD_BUG_ON, BUILD_BUG_ON_NOT_POWER_OF_2,etc in header file backport-include/linux/bug.h as the definations are not present in the wifi backport package source code.

Wanted to know whether we need to add macro definations  for functions BUILD_BUG,BUILD_BUG_ON,BUILD_BUG_NOT_POWER_OF_2,etc.

I also wanted to know whether latest backport package-v5.15.58  is compatible with nvidia jetson nano older kernels-kernel 4.9.

Please find the screenshots and logs for the same.

Thanks and Regards

Akshay Dharmapuri

0 Likes
1 Solution
Qi_Colin
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 5 questions asked

Hi @akshayd :

I checked the  macro issue.

It seems that they're related to the definitions in the header file <linux/build_bug.h>.

You can try to modify these points in backport folder like below :

  • modify backport-include/linux/build_bug.h
- #if LINUX_VERSION_IS_GEQ(4,13,0)
+ #if LINUX_VERSION_IS_GEQ(4,9,0)
  • modify backport-include/linux/rbtree.h
- #if LINUX_VERSION_IS_LESS(4,14,0)
+ #if LINUX_VERSION_IS_LESS(4,9,0)

Then build it again.

Best Regards,

Colin

View solution in original post

0 Likes
4 Replies
Qi_Colin
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 5 questions asked

Hi @akshayd :

Latest backport package-v5.15.58  is compatible with nvidia jetson nano older kernels-kernel 4.9.

Let me check your error information at first.

Best Regards,

Colin

0 Likes
akshayd
Level 1
Level 1
5 sign-ins First reply posted First question asked

Sure Colin no issues..Thanks.

I also attached the logs  for backport WIFI module compilation in word document.

 

0 Likes
Qi_Colin
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 5 questions asked

Hi @akshayd :

I checked the  macro issue.

It seems that they're related to the definitions in the header file <linux/build_bug.h>.

You can try to modify these points in backport folder like below :

  • modify backport-include/linux/build_bug.h
- #if LINUX_VERSION_IS_GEQ(4,13,0)
+ #if LINUX_VERSION_IS_GEQ(4,9,0)
  • modify backport-include/linux/rbtree.h
- #if LINUX_VERSION_IS_LESS(4,14,0)
+ #if LINUX_VERSION_IS_LESS(4,9,0)

Then build it again.

Best Regards,

Colin

0 Likes
akshayd
Level 1
Level 1
5 sign-ins First reply posted First question asked

Hi Colin,

I tried the build again after modifying the files.The issue didn't reproduce.

Thanks a lot for the support,Colin.

 

0 Likes