Error trying to compile kernel module: mach/timex.h not found

I am trying to compile a kernel module on my BBB for the RFM12B transceiver chip from the code I “git cloned” from here

When trying to compile this from the instructions on that page on the BBB itself, I get:

root@arm:~/rfm12b-linux# make
make -C /lib/modules/3.8.13-bone28/build M=/root/rfm12b-linux modules
make[1]: Entering directory /usr/src/linux-headers-3.8.13-bone28' CC [M] /root/rfm12b-linux/rfm12b.o In file included from include/linux/timex.h:65:0, from include/linux/jiffies.h:8, from include/linux/ktime.h:25, from include/linux/timer.h:5, from include/linux/workqueue.h:8, from include/linux/srcu.h:34, from include/linux/notifier.h:15, from include/linux/memory_hotplug.h:6, from include/linux/mmzone.h:761, from include/linux/gfp.h:4, from include/linux/kmod.h:22, from include/linux/module.h:13, from /root/rfm12b-linux/rfm12b.c:20: /usr/src/linux-headers-3.8.13-bone28/arch/arm/include/asm/timex.h:18:24: fatal error: mach/timex.h: No such file or directory compilation terminated. make[2]: *** [/root/rfm12b-linux/rfm12b.o] Error 1 make[1]: *** [_module_/root/rfm12b-linux] Error 2 make[1]: Leaving directory /usr/src/linux-headers-3.8.13-bone28’
make: *** [all] Error 2

I am running Debian bone28 wheezy from and I have the corresponding kernel headers installed.

I found this link ( for someone running Ubuntu on the BBB but his fix for the missing arch type doesn’t work as there is no armv7l directory to softlink to.

There is also this link (!topic/beagleboard/5xMAyFxQbdE) on the 3.2 kernel from a year ago with a solution that required a compile of the kernel from sources. But then I looked at the 3.8.13 sources on and mach/timex.h doesn’t exist in there either.

Any help greatly appreciated. Thanks!

I reread the blog at and tried the edit of the timex.h header he describes there and now I can at least get the compile to work. I think his fix is basically a noop because he seems to be including timex.h within timex.h!

Now dmesg shows this which might make sense (or might not) as the RFM12b is not yet connected. Haven’t dug into this at all yet, but at least it seems to be progress. I think I just need to run this script ( but it is getting late :slight_smile:
[ 230.466576] rfm12b : no spi_master found for busnum 1.
[ 230.473506] rfm12b : driver failed to load: -19.
[ 266.681721] No module found in object

It’s also possible to:


cd arch/arm/include/
mkdir mach
touch mach/timex.h

To avoid modifying the header file itself.