WFM200SS22XNN3R WiFi driver build error

Hi Team,

I am unable to building & loading WFM200SS22XNN3R WiFi driver in Linux kernel 4.9.
I have put three questions Please reply for all questions.

Q1) I have build wfx-linux-driver-master wifi driver on running nano jetson board. I am getting lot of error when load .ko file.
How can resolved it ?

cimcon@cimcon-jetson:~/wfx-linux-driver-master$ make KDIR=/lib/modules/4.9.253-tegra/build
make -C /lib/modules/4.9.253-tegra/build M=/home/cimcon/wfx-linux-driver-master modules
make[1]: Entering directory ‘/usr/src/linux-headers-4.9.253-tegra-ubuntu18.04_aarch64/kernel-4.9’
CC [M] /home/cimcon/wfx-linux-driver-master/bh.o
CC [M] /home/cimcon/wfx-linux-driver-master/hwio.o
CC [M] /home/cimcon/wfx-linux-driver-master/fwio.o
CC [M] /home/cimcon/wfx-linux-driver-master/data_rx.o
CC [M] /home/cimcon/wfx-linux-driver-master/data_tx.o
CC [M] /home/cimcon/wfx-linux-driver-master/main.o
CC [M] /home/cimcon/wfx-linux-driver-master/queue.o
CC [M] /home/cimcon/wfx-linux-driver-master/hif_tx_mib.o
CC [M] /home/cimcon/wfx-linux-driver-master/hif_tx.o
CC [M] /home/cimcon/wfx-linux-driver-master/hif_rx.o
CC [M] /home/cimcon/wfx-linux-driver-master/key.o
CC [M] /home/cimcon/wfx-linux-driver-master/nl80211_vendor.o
CC [M] /home/cimcon/wfx-linux-driver-master/sta.o
CC [M] /home/cimcon/wfx-linux-driver-master/scan.o
CC [M] /home/cimcon/wfx-linux-driver-master/debug.o
CC [M] /home/cimcon/wfx-linux-driver-master/bus_spi.o
CC [M] /home/cimcon/wfx-linux-driver-master/bus_sdio.o
CC [M] /home/cimcon/wfx-linux-driver-master/secure_link.o
CC [M] /home/cimcon/wfx-linux-driver-master/mbedtls/library/aes.o
CC [M] /home/cimcon/wfx-linux-driver-master/mbedtls/library/bignum.o
/home/cimcon/wfx-linux-driver-master/mbedtls/library/bignum.c: In function ‘mbedtls_mpi_exp_mod’:
/home/cimcon/wfx-linux-driver-master/mbedtls/library/bignum.c:2163:1: warning: the frame size of 3264 bytes is larger than 2048 bytes [-Wframe-larger-than=]
}
^
CC [M] /home/cimcon/wfx-linux-driver-master/mbedtls/library/ccm.o
CC [M] /home/cimcon/wfx-linux-driver-master/mbedtls/library/cipher.o
CC [M] /home/cimcon/wfx-linux-driver-master/mbedtls/library/cipher_wrap.o
CC [M] /home/cimcon/wfx-linux-driver-master/mbedtls/library/ecdh.o
CC [M] /home/cimcon/wfx-linux-driver-master/mbedtls/library/ecp_curves.o
CC [M] /home/cimcon/wfx-linux-driver-master/mbedtls/library/ecp.o
CC [M] /home/cimcon/wfx-linux-driver-master/mbedtls/library/error.o
CC [M] /home/cimcon/wfx-linux-driver-master/mbedtls/library/md.o
CC [M] /home/cimcon/wfx-linux-driver-master/mbedtls/library/md_wrap.o
CC [M] /home/cimcon/wfx-linux-driver-master/mbedtls/library/platform_util.o
CC [M] /home/cimcon/wfx-linux-driver-master/mbedtls/library/sha256.o
CC [M] /home/cimcon/wfx-linux-driver-master/mbedtls/library/sha512.o
LD [M] /home/cimcon/wfx-linux-driver-master/wfx.o
Building modules, stage 2.
MODPOST 1 modules
CC /home/cimcon/wfx-linux-driver-master/wfx.mod.o
LD [M] /home/cimcon/wfx-linux-driver-master/wfx.ko
make[1]: Leaving directory ‘/usr/src/linux-headers-4.9.253-tegra-ubuntu18.04_aarch64/kernel-4.9’
cimcon@cimcon-jetson:~/wfx-linux-driver-master$ ls
bh.c bus_spi.o data_tx.o fwio.o hif_tx.c hwio.h main.o nl80211_vendor.o scan.o traces.h
bh.h CHANGES debug.c hif_api_cmd.h hif_tx.h hwio.o Makefile queue.c secure_link.c wfx.h
bh.o data_rx.c debug.h hif_api_general.h hif_tx_mib.c key.c mbedtls queue.h secure_link.h wfx.ko
bus.h data_rx.h debug.o hif_api_mib.h hif_tx_mib.h key.h modules.order queue.o secure_link.o wfx.mod.c
bus_sdio.c data_rx.o dkms.conf hif_rx.c hif_tx_mib.o key.o Module.symvers README.md sta.c wfx.mod.o
bus_sdio.o data_tx.c fwio.c hif_rx.h hif_tx.o main.c nl80211_vendor.c scan.c sta.h wfx.o
bus_spi.c data_tx.h fwio.h hif_rx.o hwio.c main.h nl80211_vendor.h scan.h sta.o wfx_version.h
cimcon@cimcon-jetson:~/wfx-linux-driver-master$ modprobe wfx
modprobe: FATAL: Module wfx not found in directory /lib/modules/4.9.253-tegra
cimcon@cimcon-jetson:~/wfx-linux-driver-master$ sudo modprobe wfx
modprobe: FATAL: Module wfx not found in directory /lib/modules/4.9.253-tegra
cimcon@cimcon-jetson:~/wfx-linux-driver-master$ sudo insmod wfx.ko
insmod: ERROR: could not insert module wfx.ko: Unknown symbol in module
cimcon@cimcon-jetson:~/wfx-linux-driver-master$ file wfx.ko
wfx.ko: ELF 64-bit LSB relocatable, ARM aarch64, version 1 (SYSV), BuildID[sha1]=29e75d5c61eeb656e3c25f4710b64c1c8317e0cd, with debug_info, not stripped

Q2) I am getting error when cross build (Dynamic build)it on Ubuntu machine.
How can resolved it ?

imcon@cimcon:~/Downloads/wfx-linux-driver-master$ make KDIR=/home/cimcon/2-Nano-jetson/Kernel-source/Linux_for_Tegra/source/public/kernel/kernel-4.9/build
make -C /home/cimcon/2-Nano-jetson/Kernel-source/Linux_for_Tegra/source/public/kernel/kernel-4.9/build M=/home/cimcon/Downloads/wfx-linux-driver-master modules
make[1]: Entering directory ‘/home/cimcon/2-Nano-jetson/Kernel-source/Linux_for_Tegra/source/public/kernel/kernel-4.9/build’
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/bh.o
In file included from …/arch/x86/include/asm/pgtable_types.h:315,
from …/arch/x86/include/asm/processor.h:18,
from …/arch/x86/include/asm/cpufeature.h:4,
from …/arch/x86/include/asm/thread_info.h:52,
from …/include/linux/thread_info.h:25,
from …/arch/x86/include/asm/preempt.h:6,
from …/include/linux/preempt.h:59,
from …/include/linux/spinlock.h:50,
from …/include/linux/mm_types.h:8,
from …/include/linux/kmemcheck.h:4,
from …/include/linux/skbuff.h:18,
from …/include/linux/if_ether.h:23,
from …/include/net/mac80211.h:20,
from /home/cimcon/Downloads/wfx-linux-driver-master/bh.c:9:
…/include/asm-generic/pgtable-nopud.h:15: warning: “PUD_SHIFT” redefined
15 | #define PUD_SHIFT PGDIR_SHIFT
|
In file included from …/arch/x86/include/asm/pgtable_types.h:267,
from …/arch/x86/include/asm/processor.h:18,
from …/arch/x86/include/asm/cpufeature.h:4,
from …/arch/x86/include/asm/thread_info.h:52,
from …/include/linux/thread_info.h:25,
from …/arch/x86/include/asm/preempt.h:6,
from …/include/linux/preempt.h:59,
from …/include/linux/spinlock.h:50,
from …/include/linux/mm_types.h:8,
from …/include/linux/kmemcheck.h:4,
from …/include/linux/skbuff.h:18,
from …/include/linux/if_ether.h:23,
from …/include/net/mac80211.h:20,
from /home/cimcon/Downloads/wfx-linux-driver-master/bh.c:9:
…/arch/x86/include/asm/pgtable_64_types.h:34: note: this is the location of the previous definition
34 | #define PUD_SHIFT 30
|
In file included from …/arch/x86/include/asm/pgtable_types.h:315,
from …/arch/x86/include/asm/processor.h:18,
from …/arch/x86/include/asm/cpufeature.h:4,
from …/arch/x86/include/asm/thread_info.h:52,
from …/include/linux/thread_info.h:25,
from …/arch/x86/include/asm/preempt.h:6,
from …/include/linux/preempt.h:59,
from …/include/linux/spinlock.h:50,
from …/include/linux/mm_types.h:8,
from …/include/linux/kmemcheck.h:4,
from …/include/linux/skbuff.h:18,
from …/include/linux/if_ether.h:23,
from …/include/net/mac80211.h:20,
from /home/cimcon/Downloads/wfx-linux-driver-master/bh.c:9:
…/include/asm-generic/pgtable-nopud.h:16: warning: “PTRS_PER_PUD” redefined
16 | #define PTRS_PER_PUD 1
|
In file included from …/arch/x86/include/asm/pgtable_types.h:267,
from …/arch/x86/include/asm/processor.h:18,
from …/arch/x86/include/asm/cpufeature.h:4,
from …/arch/x86/include/asm/thread_info.h:52,
from …/include/linux/thread_info.h:25,
from …/arch/x86/include/asm/preempt.h:6,
from …/include/linux/preempt.h:59,
from …/include/linux/spinlock.h:50,
from …/include/linux/mm_types.h:8,
from …/include/linux/kmemcheck.h:4,
from …/include/linux/skbuff.h:18,
from …/include/linux/if_ether.h:23,
from …/include/net/mac80211.h:20,
from /home/cimcon/Downloads/wfx-linux-driver-master/bh.c:9:
…/arch/x86/include/asm/pgtable_64_types.h:35: note: this is the location of the previous definition
35 | #define PTRS_PER_PUD 512
|
In file included from …/arch/x86/include/asm/pgtable_types.h:315,
from …/arch/x86/include/asm/processor.h:18,
from …/arch/x86/include/asm/cpufeature.h:4,
from …/arch/x86/include/asm/thread_info.h:52,
from …/include/linux/thread_info.h:25,
from …/arch/x86/include/asm/preempt.h:6,
from …/include/linux/preempt.h:59,
from …/include/linux/spinlock.h:50,
from …/include/linux/mm_types.h:8,
from …/include/linux/kmemcheck.h:4,
from …/include/linux/skbuff.h:18,
from …/include/linux/if_ether.h:23,
from …/include/net/mac80211.h:20,
from /home/cimcon/Downloads/wfx-linux-driver-master/bh.c:9:
…/include/asm-generic/pgtable-nopud.h:17: warning: “PUD_SIZE” redefined
17 | #define PUD_SIZE (1UL << PUD_SHIFT)
|
In file included from …/arch/x86/include/asm/pgtable_types.h:267,
from …/arch/x86/include/asm/processor.h:18,
from …/arch/x86/include/asm/cpufeature.h:4,
from …/arch/x86/include/asm/thread_info.h:52,
from …/include/linux/thread_info.h:25,
from …/arch/x86/include/asm/preempt.h:6,
from …/include/linux/preempt.h:59,
from …/include/linux/spinlock.h:50,
from …/include/linux/mm_types.h:8,
from …/include/linux/kmemcheck.h:4,
from …/include/linux/skbuff.h:18,
from …/include/linux/if_ether.h:23,
from …/include/net/mac80211.h:20,
from /home/cimcon/Downloads/wfx-linux-driver-master/bh.c:9:
…/arch/x86/include/asm/pgtable_64_types.h:51: note: this is the location of the previous definition
51 | #define PUD_SIZE (_AC(1, UL) << PUD_SHIFT)
|
In file included from …/arch/x86/include/asm/pgtable_types.h:315,
from …/arch/x86/include/asm/processor.h:18,
from …/arch/x86/include/asm/cpufeature.h:4,
from …/arch/x86/include/asm/thread_info.h:52,
from …/include/linux/thread_info.h:25,
from …/arch/x86/include/asm/preempt.h:6,
from …/include/linux/preempt.h:59,
from …/include/linux/spinlock.h:50,
from …/include/linux/mm_types.h:8,
from …/include/linux/kmemcheck.h:4,
from …/include/linux/skbuff.h:18,
from …/include/linux/if_ether.h:23,
from …/include/net/mac80211.h:20,
from /home/cimcon/Downloads/wfx-linux-driver-master/bh.c:9:
…/include/asm-generic/pgtable-nopud.h:18: warning: “PUD_MASK” redefined
18 | #define PUD_MASK (~(PUD_SIZE-1))
|
In file included from …/arch/x86/include/asm/pgtable_types.h:267,
from …/arch/x86/include/asm/processor.h:18,
from …/arch/x86/include/asm/cpufeature.h:4,
from …/arch/x86/include/asm/thread_info.h:52,
from …/include/linux/thread_info.h:25,
from …/arch/x86/include/asm/preempt.h:6,
from …/include/linux/preempt.h:59,
from …/include/linux/spinlock.h:50,
from …/include/linux/mm_types.h:8,
from …/include/linux/kmemcheck.h:4,
from …/include/linux/skbuff.h:18,
from …/include/linux/if_ether.h:23,
from …/include/net/mac80211.h:20,
from /home/cimcon/Downloads/wfx-linux-driver-master/bh.c:9:
…/arch/x86/include/asm/pgtable_64_types.h:52: note: this is the location of the previous definition
52 | #define PUD_MASK (~(PUD_SIZE - 1))
|
In file included from …/include/linux/list.h:7,
from …/include/linux/mm_types.h:7,
from …/include/linux/kmemcheck.h:4,
from …/include/linux/skbuff.h:18,
from …/include/linux/if_ether.h:23,
from …/include/net/mac80211.h:20,
from /home/cimcon/Downloads/wfx-linux-driver-master/bh.c:9:
…/arch/x86/include/asm/processor.h: In function ‘load_cr3’:
…/arch/x86/include/asm/page_32_types.h:16:32: error: ‘CONFIG_PAGE_OFFSETUL’ undeclared (first use in this function)
16 | #define __PAGE_OFFSET_BASE _AC(CONFIG_PAGE_OFFSET, UL)
| ^~~~~~~~~~~~~~~~~~
…/include/uapi/linux/const.h:19:20: note: in definition of macro ‘__AC’
19 | #define __AC(X,Y) (X##Y)
| ^
…/arch/x86/include/asm/page_32_types.h:16:28: note: in expansion of macro ‘_AC’
16 | #define __PAGE_OFFSET_BASE _AC(CONFIG_PAGE_OFFSET, UL)
| ^~~
…/arch/x86/include/asm/page_32_types.h:17:24: note: in expansion of macro ‘__PAGE_OFFSET_BASE’
17 | #define __PAGE_OFFSET __PAGE_OFFSET_BASE
| ^~~~~~~~~~~~~~~~~~
…/arch/x86/include/asm/page_types.h:35:38: note: in expansion of macro ‘__PAGE_OFFSET’
35 | #define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET)
| ^~~~~~~~~~~~~
…/arch/x86/include/asm/page_32.h:8:39: note: in expansion of macro ‘PAGE_OFFSET’
8 | #define __phys_addr_nodebug(x) ((x) - PAGE_OFFSET)
| ^~~~~~~~~~~
…/arch/x86/include/asm/page_32.h:12:25: note: in expansion of macro ‘__phys_addr_nodebug’
12 | #define __phys_addr(x) __phys_addr_nodebug(x)
| ^~~~~~~~~~~~~~~~~~~
…/arch/x86/include/asm/page.h:41:18: note: in expansion of macro ‘__phys_addr’
41 | #define __pa(x) __phys_addr((unsigned long)(x))
| ^~~~~~~~~~~
…/arch/x86/include/asm/processor.h:218:12: note: in expansion of macro ‘__pa’
218 | write_cr3(__pa(pgdir));
| ^~~~
…/arch/x86/include/asm/page_32_types.h:16:32: note: each undeclared identifier is reported only once for each function it appears in
16 | #define __PAGE_OFFSET_BASE _AC(CONFIG_PAGE_OFFSET, UL)
| ^~~~~~~~~~~~~~~~~~
…/include/uapi/linux/const.h:19:20: note: in definition of macro ‘__AC’
19 | #define __AC(X,Y) (X##Y)
| ^
…/arch/x86/include/asm/page_32_types.h:16:28: note: in expansion of macro ‘_AC’
16 | #define __PAGE_OFFSET_BASE _AC(CONFIG_PAGE_OFFSET, UL)
| ^~~
…/arch/x86/include/asm/page_32_types.h:17:24: note: in expansion of macro ‘__PAGE_OFFSET_BASE’
17 | #define __PAGE_OFFSET __PAGE_OFFSET_BASE
| ^~~~~~~~~~~~~~~~~~
…/arch/x86/include/asm/page_types.h:35:38: note: in expansion of macro ‘__PAGE_OFFSET’
35 | #define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET)
| ^~~~~~~~~~~~~
…/arch/x86/include/asm/page_32.h:8:39: note: in expansion of macro ‘PAGE_OFFSET’
8 | #define __phys_addr_nodebug(x) ((x) - PAGE_OFFSET)
| ^~~~~~~~~~~
…/arch/x86/include/asm/page_32.h:12:25: note: in expansion of macro ‘__phys_addr_nodebug’
12 | #define __phys_addr(x) __phys_addr_nodebug(x)
| ^~~~~~~~~~~~~~~~~~~
…/arch/x86/include/asm/page.h:41:18: note: in expansion of macro ‘__phys_addr’
41 | #define __pa(x) __phys_addr((unsigned long)(x))
| ^~~~~~~~~~~
…/arch/x86/include/asm/processor.h:218:12: note: in expansion of macro ‘__pa’
218 | write_cr3(__pa(pgdir));
| ^~~~
In file included from …/include/linux/cache.h:5,
from …/include/linux/printk.h:8,
from …/include/linux/kernel.h:13,
from …/include/asm-generic/bug.h:13,
from …/arch/x86/include/asm/bug.h:35,
from …/include/linux/bug.h:4,
from …/include/linux/gpio/consumer.h:4,
from /home/cimcon/Downloads/wfx-linux-driver-master/bh.c:8:
…/arch/x86/include/asm/processor.h: At top level:
…/arch/x86/include/asm/cache.h:7:25: error: ‘CONFIG_X86_L1_CACHE_SHIFT’ undeclared here (not in a function); did you mean ‘CONFIG_ARM64_PAGE_SHIFT’?
7 | #define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
…/arch/x86/include/asm/cache.h:8:30: note: in expansion of macro ‘L1_CACHE_SHIFT’
8 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
| ^~~~~~~~~~~~~~
…/include/linux/cache.h:12:25: note: in expansion of macro ‘L1_CACHE_BYTES’
12 | #define SMP_CACHE_BYTES L1_CACHE_BYTES
| ^~~~~~~~~~~~~~
…/include/linux/cache.h:34:58: note: in expansion of macro ‘SMP_CACHE_BYTES’
34 | #define ____cacheline_aligned attribute((aligned(SMP_CACHE_BYTES)))
| ^~~~~~~~~~~~~~~
…/arch/x86/include/asm/processor.h:282:27: note: in expansion of macro ‘__cacheline_aligned’
282 | } attribute((packed)) ____cacheline_aligned;
| ^~~~~~~~~~~~~~~~~~~~~
In file included from …/arch/x86/include/asm/preempt.h:5,
from …/include/linux/preempt.h:59,
from …/include/linux/spinlock.h:50,
from …/include/linux/mm_types.h:8,
from …/include/linux/kmemcheck.h:4,
from …/include/linux/skbuff.h:18,
from …/include/linux/if_ether.h:23,
from …/include/net/mac80211.h:20,
from /home/cimcon/Downloads/wfx-linux-driver-master/bh.c:9:
…/arch/x86/include/asm/processor.h: In function ‘current_top_of_stack’:
…/arch/x86/include/asm/processor.h:500:30: error: ‘cpu_current_top_of_stack’ undeclared (first use in this function); did you mean ‘current_top_of_stack’?
500 | return this_cpu_read_stable(cpu_current_top_of_stack);
| ^~~~~~~~~~~~~~~~~~~~~~~~
…/arch/x86/include/asm/percpu.h:213:9: note: in definition of macro ‘percpu_stable_op’
213 | typeof(var) pfo_ret
;
| ^~~
…/arch/x86/include/asm/processor.h:500:9: note: in expansion of macro ‘this_cpu_read_stable’
500 | return this_cpu_read_stable(cpu_current_top_of_stack);
| ^~~~~~~~~~~~~~~~~~~~
In file included from …/arch/x86/include/asm/preempt.h:6,
from …/include/linux/preempt.h:59,
from …/include/linux/spinlock.h:50,
from …/include/linux/mm_types.h:8,
from …/include/linux/kmemcheck.h:4,
from …/include/linux/skbuff.h:18,
from …/include/linux/if_ether.h:23,
from …/include/net/mac80211.h:20,
from /home/cimcon/Downloads/wfx-linux-driver-master/bh.c:9:
…/include/linux/thread_info.h: At top level:
…/include/linux/thread_info.h:75:19: error: redefinition of ‘arch_within_stack_frames’
75 | static inline int arch_within_stack_frames(const void * const stack,
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from …/include/linux/thread_info.h:25,
from …/arch/x86/include/asm/preempt.h:6,
from …/include/linux/preempt.h:59,
from …/include/linux/spinlock.h:50,
from …/include/linux/mm_types.h:8,
from …/include/linux/kmemcheck.h:4,
from …/include/linux/skbuff.h:18,
from …/include/linux/if_ether.h:23,
from …/include/net/mac80211.h:20,
from /home/cimcon/Downloads/wfx-linux-driver-master/bh.c:9:
…/arch/x86/include/asm/thread_info.h:167:19: note: previous definition of ‘arch_within_stack_frames’ was here
167 | static inline int arch_within_stack_frames(const void * const stack,
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from …/include/linux/cache.h:5,
from …/include/linux/printk.h:8,
from …/include/linux/kernel.h:13,
from …/include/asm-generic/bug.h:13,
from …/arch/x86/include/asm/bug.h:35,
from …/include/linux/bug.h:4,
from …/include/linux/gpio/consumer.h:4,
from /home/cimcon/Downloads/wfx-linux-driver-master/bh.c:8:
…/arch/x86/include/asm/cache.h:12:31: error: ‘CONFIG_X86_INTERNODE_CACHE_SHIFT’ undeclared here (not in a function); did you mean ‘INTERNODE_CACHE_SHIFT’?
12 | #define INTERNODE_CACHE_SHIFT CONFIG_X86_INTERNODE_CACHE_SHIFT
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
…/include/linux/cache.h:71:35: note: in expansion of macro ‘INTERNODE_CACHE_SHIFT’
71 | attribute((aligned(1 << (INTERNODE_CACHE_SHIFT))))
| ^~~~~~~~~~~~~~~~~~~~~
…/include/linux/mmzone.h:106:3: note: in expansion of macro ‘____cacheline_internodealigned_in_smp’
106 | } ____cacheline_internodealigned_in_smp;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from …/include/linux/sched.h:32,
from …/include/linux/kasan.h:4,
from …/include/linux/slab.h:118,
from …/include/linux/textsearch.h:8,
from …/include/linux/skbuff.h:30,
from …/include/linux/if_ether.h:23,
from …/include/net/mac80211.h:20,
from /home/cimcon/Downloads/wfx-linux-driver-master/bh.c:9:
…/include/linux/cputime.h:4:10: fatal error: asm/cputime.h: No such file or directory
4 | #include <asm/cputime.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
make[4]: *** […/scripts/Makefile.build:336: /home/cimcon/Downloads/wfx-linux-driver-master/bh.o] Error 1
make[3]: *** [/home/cimcon/2-Nano-jetson/Kernel-source/Linux_for_Tegra/source/public/kernel/kernel-4.9/Makefile:1629: module/home/cimcon/Downloads/wfx-linux-driver-master] Error 2
make[2]: *** [Makefile:171: sub-make] Error 2
make[1]: *** [Makefile:24: __sub-make] Error 2
make[1]: Leaving directory ‘/home/cimcon/2-Nano-jetson/Kernel-source/Linux_for_Tegra/source/public/kernel/kernel-4.9/build’
make: *** [Makefile:20: modules] Error 2
cimcon@cimcon:~/Downloads/wfx-linux-driver-master$

Q3) I have try to static build ?
How can resolved it ?

Thanks,
Babbelal

Rather than looking at all of those individual errors, I’ll ask about the part which usually causes problems: Initial configuration prior to starting the build.

Note: You should always build the kernel Image target before building other targets even if you don’t need the Image. You could build just modules if you’ve propagated configuration with the “make prepare”. I say this because it is an “acid test” of sorts. If you can build “Image”, then you know build correctly propagated all configurations to each component. You’ll also see a number of configuration errors which might block building the Image which might not be as clear when building only modules.

Before you build any kernel you need to have a starting configuration which matches your running system. For a default system the make target of “tegra_defconfig” (described in the docs under kernel customization) creates a configuration which matches the configuration a Jetson ships with, with one exception. If you copy a running system’s “/proc/config.gz”, then gunzip the file and rename it as “.config”, and place it at the correct location, then this will match the running system’s configuration as a starting point (you wouldn’t use both the “/proc/config.gz” and “tegra_defconfig”…you’d use one or the other).

The exception is that you will (either way) need to set “CONFIG_LOCALVERSION”. There is more than one way to set this, but the gist is that it is based on the suffix to the command “uname -r” when run on the system you are configuring for. If for example you see “4.9.140-tegra”, then the suffix is “-tegra”. The config would be something like this:
CONFIG_LOCALVERSION="-tegra"

The reason for this is so that the existing kernel Image can find modules at:
/lib/modules/$(uname -r)/kernel
(and modules know they belong at that location)

Once you have this in place you can use your config editor, e.g., menuconfig, and make any change you are interested in.

Note that if you make a change by adding a module, then it is trivial to install a module. If you have to use “=y” to integrate a feature into the kernel, then things get more complicated. Can you elaborate on how you initially configured, and then if you built the “Image” target before any modules (which is the order it should go in)?

Hi ,

I have Cross build the driver in my Linux PC for jetson nano and create .ko file.
But i am getting error when load it in running board.

cimcon@cimcon:~/Downloads/wfx-linux-driver-master$ make ARCH=arm64 O=$TEGRA_KERNEL_OUT LOCALVERSION=-tegra CROSS_COMPILE=/home/cimcon/2-Nano-jetson/Jetson-tool-chain/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
make -C /home/cimcon/2-Nano-jetson/Kernel-source/Linux_for_Tegra/source/public/kernel/kernel-4.9-wifi/ M=/home/cimcon/Downloads/wfx-linux-driver-master modules
make[1]: Entering directory ‘/home/cimcon/2-Nano-jetson/Kernel-source/Linux_for_Tegra/source/public/kernel/kernel-4.9-wifi’
make[2]: Entering directory ‘/home/cimcon/3-Build_kernel/kernel_src/kernel/kernel-4.9/build’

WARNING: Symbol version dump ./Module.symvers
is missing; modules will have no dependencies and modversions.

CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/bh.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/hwio.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/fwio.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/data_rx.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/data_tx.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/main.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/queue.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/hif_tx_mib.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/hif_tx.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/hif_rx.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/key.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/nl80211_vendor.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/sta.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/scan.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/debug.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/bus_spi.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/bus_sdio.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/secure_link.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/mbedtls/library/aes.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/mbedtls/library/bignum.o
/home/cimcon/Downloads/wfx-linux-driver-master/mbedtls/library/bignum.c: In function ‘mbedtls_mpi_exp_mod’:
/home/cimcon/Downloads/wfx-linux-driver-master/mbedtls/library/bignum.c:2163:1: warning: the frame size of 3264 bytes is larger than 2048 bytes [-Wframe-larger-than=]
}
^
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/mbedtls/library/ccm.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/mbedtls/library/cipher.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/mbedtls/library/cipher_wrap.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/mbedtls/library/ecdh.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/mbedtls/library/ecp_curves.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/mbedtls/library/ecp.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/mbedtls/library/error.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/mbedtls/library/md.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/mbedtls/library/md_wrap.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/mbedtls/library/platform_util.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/mbedtls/library/sha256.o
CC [M] /home/cimcon/Downloads/wfx-linux-driver-master/mbedtls/library/sha512.o
LD [M] /home/cimcon/Downloads/wfx-linux-driver-master/wfx.o
Building modules, stage 2.
MODPOST 1 modules
CC /home/cimcon/Downloads/wfx-linux-driver-master/wfx.mod.o
LD [M] /home/cimcon/Downloads/wfx-linux-driver-master/wfx.ko
make[2]: Leaving directory ‘/home/cimcon/3-Build_kernel/kernel_src/kernel/kernel-4.9/build’
make[1]: Leaving directory ‘/home/cimcon/2-Nano-jetson/Kernel-source/Linux_for_Tegra/source/public/kernel/kernel-4.9-wifi’

cimcon@cimcon:~/Downloads/wfx-linux-driver-master$ **file wfx.ko **
wfx.ko: ELF 64-bit LSB relocatable, ARM aarch64, version 1 (SYSV), BuildID[sha1]=8d6c189a26595b4692cff1636263cb8bd306bb7d, with debug_info, not stripped
cimcon@cimcon:~/Downloads/wfx-linux-driver-master$

Target board:
cimcon@cimcon:~$ uname -r
4.9.140-tegra
cimcon@cimcon:~$ sudo modprobe wfx.ko
modprobe: FATAL: Module wfx.ko not found in directory /lib/modules/4.9.140-tegra
cimcon@cimcon:~$
cimcon@cimcon:~$ sudo insmod wfx.ko
insmod: ERROR: could not insert module wfx.ko: Unknown symbol in module

root@cimcon:/home/cimcon# dmesg -Tw
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol ieee80211_connection_loss (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol ieee80211_free_hw (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol ieee80211_probereq_get (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol ieee80211_beacon_loss (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol ieee80211_register_hw (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol cfg80211_find_ie_match (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol ieee80211_find_sta (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol ieee80211_stop_rx_ba_session_offl (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol ieee80211_get_key_rx_seq (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol ieee80211_tx_status_irqsafe (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol __cfg80211_alloc_reply_skb (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol cfg80211_put_bss (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol ieee80211_bss_get_ie (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol wiphy_to_ieee80211_hw (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol ieee80211_proberesp_get (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol ieee80211_wake_queues (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol ieee80211_alloc_hw_nm (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol cfg80211_get_bss (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol cfg80211_vendor_cmd_reply (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol ieee80211_stop_queues (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol ieee80211_scan_completed (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol ieee80211_channel_to_frequency (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol ieee80211_unregister_hw (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol ieee80211_beacon_get_tim (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol ieee80211_start_rx_ba_session_offl (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol ieee80211_cqm_rssi_notify (err 0)
[ඉ ජන 28 22:06:30 2018] wfx: Unknown symbol ieee80211_rx_irqsafe (err 0)

I am unable to load module.

regards,
Babbelal

The above error, combined with this, indicates a bad starting configuration, and perhaps an incorrect install:

This reinforces the probability that configuration or install was not valid:

Below is a long URL with extended information on configuration and install:
https://forums.developer.nvidia.com/t/problem-smb-jetson-nano/193640/11

In that URL it does offer a “recipe” for native compile, but this would also apply to cross-compile if arguments and environment setup for cross-compile is merged in.

Some tips about cross-compile versus native compile:

  • Cross-compile uses the “ARCH=arm64”, but never use this for native build.
  • If you need to know about “uname -r”, then always use the one from the Jetson, not the host PC.
  • The “CROSS_COMPILE” environment variable is only used for cross-compile…don’t use this in native build, but do add this to each build line for cross-compile.
  • If you use the “/boot/config.gz”, then this is the one from the Jetson.
  • In both cases it is a very common mistake to fail to correctly set the “CONFIG_LOCALVERSION” to “-tegra”. This will lead to 100% failure of modules in most cases.

Note that if you just added a module (the “.ko” file), then I would not expect all of the other modules to fail. It is possible that if you added a module which was missing its own chain of dependencies, then this would occur, but I see this, which indicates “wxo.ko” was never added (and thus could not trigger a chain of dependencies):

Look carefully at that URL for how to configure prior to starting the build. Something in the configuration was incomplete before you started the build.

Here is a URL with further explaination related to build and install of kernels:
https://forums.developer.nvidia.com/t/jetson-nano-board-setup/163668/6

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