Topic: Novena-RF - recompiling the kernel driver

I'm working through the Novena-RF_Driver instructions on the MyriadRF wiki which point to a pre-compiled Linux 3.19 driver which naturally won't run on my 4.4 kernel. Those same instructions (a) claim a requirement for a kernel build (rather than just the linux-headers-novena package) and (b) the use of a cross-compiler, rather than simply compiling on the Novena.

Has anyone actually worked through this? Are either of these things actually true? It's been close to (more than?) two decades since I compiled a Linux kernel. The prospect does not excite me.

Re: Novena-RF - recompiling the kernel driver

I haven't tried this, but you shouldn't have to cross-compile.

They request you do this:

export PATH=/opt/toolchains/gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux/bin/:$PATH
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabi-
make novena_defconfig
make zImage modules
cd kernel
make ARCH=arm KDIR=path/to/novena-linux
ls novena_rf.ko #output

Something along these lines should work on the Novena itself:

make novena_defconfig
make -j5 zImage
make -j5 modules
cd kernel
make KDIR=path/to/novena-linux
ls novena_rf.ko #output

Note the removal of all of the "export" commands- that's just for cross-compiling. I also added "-j5" to the "make" commands to make it build faster- the Novena has 4 cores, might as well use them!


Building a Linux kernel isn't so bad- just following the directions there should get you far enough. You MIGHT need another step- I think it's "make dtbs" or some such- to create the .dtb file for uBoot. I'm not 100% sure about that, though, and I think the existing .dtb file should work with the new kernel. I don't know if you HAVE to compile it- it's possible just configuring the kernel is good enough. I'm not familiar enough with out-of-tree modules to know.

Hope that helps!

Re: Novena-RF - recompiling the kernel driver

I'll certainly try it that way; for the sake of a few commands and an hour or two's execution, not that much is saved by switching to the headers package approach.

I did get a response on the MyriadRF forums - admittedly speculative - that the cross compilation requirement was likely to be about speed of compilation on an x86 host, rather than anything peculiar about the code.

Re: Novena-RF - recompiling the kernel driver

Hello,

It is actually a lot simpler than that. All I had to do was build an out of tree module, and the command is

make -C /lib/modules/`uname -r`/build M=$PWD

You do that in the "Novena-RF/driver" if I remember doing this right. It will build you the module you need. No need for any recompiling.