AnsweredAssumed Answered

WF111 Driver Build against FSL Yocto

Question asked by Sam Musso on Jan 18, 2017
Latest reply on Apr 24, 2017 by Abdulaziz Aydoğmuş

Hello we are attempting to get the WF111 WiFi module running on our IMX6ULEVK board. I'm fairly new to yocto, with first exposure about six weeks ago so I apologize if this is something obvious. 


I've downloaded the driver source from silabs and am following the instructions in to build the driver. I'm getting caught up when the instructions refer to the kernel source directory. Looking through the build directory in yocto I found $BUILD_DIR/tmp/work-shared/imx6ulevk/kernel-source/ but I've run into a number of issues passing that directory as KDIR to make. Here are my notes outlining everything I've tried so far. 


External Build:
1) Enable the following with "bitbake menuconfig virtual/kernel" as per AN996: WF111 LINUX DRIVER INSTALLATION
cfg80211 - wireless configuration API
Generic IEEE 802.11 Networking Stack (mac80211)
IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP)

2) Build target with "bitbake fsl-image-machine-test"

3) cd $BUILD_DIR/tmp/work-shared/imx6ulevk/kernel-source/; make modules_prepare ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi-

NOTE: cat include/generated/utsrelease.h outputs: #define UTS_RELEASE "3.14.52+"
On my target the kernel version is: 3.14.52-1.1.1_ga+gdb1bcba

4) Change directory to wf111 driver source root.
run: make install_static KDIR=${KERNEL_SRC} ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-

NOTE: I get "WARNING: Symbol version dump Module.symvers is missing"

5) scp all files to target in proper location.

NOTE: insmod / modprobe fail with "modprobe: ERROR: could not insert 'unifi_sdio': Exec format error" with dmesg showing "unifi_sdio: no symbol version for module_layout"

6) cp Module.symvers from $BUILD_DIR/tmp/work-shared/imx6ulevk/kernel-build-artifacts/ to $BUILD_DIR/tmp/work- shared/imx6ulevk/kernel-source/

7) repeat step 4

NOTE: I get several warnings about undefined symbols. They are __gnu_mcount_nc, wireless_send_event, __stack_chk_fail, kmem_cache_alloc_trace, and __stack_chk_guard

8) repeat step 5

NOTE: insmod / modprobe fail, dmesg showing "unifi_sdio: version magic '3.14.52+ mod_unload modversions ARMv7 p2v8 ' should be '3.14.52-1.1.1_ga+gdb1bcba SMP preempt mod_unload modversions ARMv7 p2v8 '"

9) modify $BUILD_DIR/tmp/work-shared/imx6ulevk/kernel-source/include/generated/utsrelease.h to be:
#define UTS_RELEASE "3.14.52-1.1.1_+gdb1bcba SMP preempt"

NOTE: yes, I realize this is a poor idea, but I'm out of other ideas.

10) repeat step 4 - get same warnings on undefined symbols

11) repeat step 5 - modprobe: ERROR: could not insert 'unifi_sdio': Unknown symbol in module, or unknown parameter (see dmesg)

NOTE: dmesg shows:
unifi_sdio: Unknown symbol __stack_chk_guard (err 0)
unifi_sdio: Unknown symbol kmem_cache_alloc_trace (err 0)
unifi_sdio: Unknown symbol __stack_chk_fail (err 0)
unifi_sdio: Unknown symbol wireless_send_event (err 0)
unifi_sdio: Unknown symbol __gnu_mcount_nc (err 0)

Integrated Build:
Found a .bb recipe on github for building the wf111 driver source and integrating it into the targets rootfs directly (this is ideal). However it has the same issues as the external build.

In the target filesystem unifi_sdio.ko is located at /lib/modules/3.14.52+/extra/ instead of /lib/modules/3.14.52-1.1.1_ga+gdb1bcba/extra/.

Running insmod on that .ko yields the same "ERROR: could not insert 'unifi_sdio': Exec format error"
The .bb recipe is pasted below:
DESCRIPTION = "WF111 driver and bin utils"
SECTION = "wireless driver"

INSANE_SKIP_${PN} = "already-stripped"

DEPENDS += "imx-test"

SRC_URI = " \
file://wf111-linux-driver_5.2.2-r1_armv7-a.tar.gz \

do_compile () {
cd ${WORKDIR}/wf111-linux-driver_5.2.2-r1_armv7-a
unset LDFLAG
make install_static KDIR=${STAGING_KERNEL_DIR} ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-

do_install (){
install -d ${D}
cp -rf ${WORKDIR}/wf111-linux-driver_5.2.2-r1_armv7-a/output/* ${D}

FILES_${PN} = "/usr/* \
/lib* "