Trying to compile adxl345 as a module in bbb but get error

Hi all,

I have downloaded a debian image

Debian 8.7 2017-03-19 4GB SD LXQT

I have attached a adxl345 accelerometer, and with user space tools its working fine.
Now I am trying to attach a kernel driver i.e in adxl345. I put the source files in

and issued make.
I get this error

root@beaglebone:/home/debian/Desktop/adxl345# make
make -C /lib/modules/4.4.54-ti-r93/build M=/home/debian/Desktop/adxl345 modules
make[1]: *** /lib/modules/4.4.54-ti-r93/build: No such file or directory. Stop.
Makefile:13: recipe for target ‘default’ failed
make: *** [default] Error 2

I checked

root@beaglebone:/lib/modules/4.4.54-ti-r93# ls
extra modules.builtin modules.devname modules.symbols.bin
kernel modules.builtin.bin modules.order
modules.alias modules.dep modules.softdep
modules.alias.bin modules.dep.bin modules.symbols

there is no build directory. I tried to update kernel headers

sudo apt-get install linux-headers-linux-headers-4.4.54-ti-r93

but it says

E: Unable to locate package linux-headers-linux-headers-4.4.54-ti-r93

How I am going to build the drivers?

Oh, it's there, run "sudo apt update" first to update your apt cache..


I have the same problem

在 2017年10月7日星期六 UTC-5上午3:33:51,Mrigendra Chaubey写道: