building a out-of-tree module on Beagle Bone Black

385 views
Skip to first unread message

Shyam D

unread,
Mar 23, 2015, 3:17:00 AM3/23/15
to beagl...@googlegroups.com
Machine Details :

Linux beaglebone 3.8.13-bone47 armv7l GNU/Linux

Problem Details: 

In a attempt to write out-of-tree modules on beagle bone black(as intree modules require me to compile/flash them again and again ), i have logged in to beagle bone black revc through ssh client, which gives me a command line interface via putty, as in general out-of-tree module development, i have tried to compile module with the following make file 

ifneq ($(KERNELRELEASE),)
# kbuild part of makefile
        obj-m  := module.o

        #module-objs := module.o
else
# normal makefile
        KDIR ?= /lib/modules/$(shell uname -r)/build
        PWD  := $(shell pwd)
default:
        $(MAKE) -C $(KDIR) M=$(PWD) modules

endif

resulting an error 

root@beaglebone:~/lddgeek# make
make -C /lib/modules/3.8.13-bone47/build M=/root/lddgeek modules
make: *** /lib/modules/3.8.13-bone47/build: No such file or directory.  Stop.
make: *** [default] Error 2

but when i parse to the path of KDIR i did not find build folder as we find it in an normal ubuntu installed on x86 

if i have to develop drivers/modules out-of-tree on a Beagle how could i do that? 

Thank you 
Shyam

Frank Agius

unread,
Mar 23, 2015, 8:31:28 AM3/23/15
to beagl...@googlegroups.com

You need to install the kernel headers, then run "make scripts" in the headers directory: 

root@beaglebone:/#  apt-get install linux-headers-`uname -r`
root@beaglebone:/#  cd /lib/modules/`uname -r`/build
root@beaglebone:/#  make scripts

Once competed, your make of the out of source kernel module should get past that initial error.

frank

Shyam D

unread,
Mar 23, 2015, 8:35:21 AM3/23/15
to beagl...@googlegroups.com
when you say initial error :) will i get any build errors further, like during insmod, rmmod , can you please tell me what i should make ready for out-of-tree kernel module development

Frank Agius

unread,
Mar 23, 2015, 8:48:13 AM3/23/15
to beagl...@googlegroups.com
 
I said "get past that initial error" because I have no idea what code you are compiling.   There could be a multitude of other reasons why your kernel module could not compile once the header issue is resolved.  I can only comment on the errors you list, not the infinite number of unknowable potential problems.   Please try what I suggested and then post your progress. 

frank

Shyam D

unread,
Mar 23, 2015, 11:37:21 AM3/23/15
to beagl...@googlegroups.com
I was not able to do that why so ???

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-headers-3.8.13-bone47
E: Couldn't find any package by regex 'linux-headers-3.8.13-bone47'


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/E9bS5pzCamo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
-----Regards & Thanks
Shyam Sunder Daram
Mobile:- +91 95-6082-143-8
View My Profile @ LinkedIn @ Indeed

Robert Nelson

unread,
Mar 23, 2015, 11:54:44 AM3/23/15
to Beagle Board

Sorry, bone47 is way 'before' the repo was enabled.  Start with the latest image.

> You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.

Shyam D

unread,
Mar 23, 2015, 12:13:10 PM3/23/15
to beagl...@googlegroups.com
you meant to say `flash a latest image on beagle bone black`

Shyam D

unread,
Mar 23, 2015, 12:32:38 PM3/23/15
to beagl...@googlegroups.com
dont know whether i can go with this bone47 distro , but i have done below things and my module got inserted and i am happy :p

#wget --no-check-certificate https://raw.github.com/gkaindl/beaglebone-ubuntu-scripts/master/bb-get-rcn-kernel-source.sh
#chmod +x bb-get-rcn-kernel-source.sh
#./bb-get-rcn-kernel-source.sh

Shyam D

unread,
Mar 23, 2015, 9:42:08 PM3/23/15
to beagl...@googlegroups.com
No, the first time it succedded but dont know why the second time it started saying 

make -C /lib/modules/3.8.13-bone47/build M=/root/lddgeek modules
make[1]: Entering directory `/usr/src/linux-3.8.13-bone47'
make[1]: Warning: File `/usr/src/linux-3.8.13-bone47/arch/arm/Makefile' has modification time 1.2e+03 s in the future
make[2]: Warning: File `scripts/Makefile.lib' has modification time 1.2e+03 s in the future
  CC [M]  /root/lddgeek/module.o
/root/lddgeek/module.c: In function 'module_start':
/root/lddgeek/module.c:7:1: warning: control reaches end of non-void function [-Wreturn-type]
  LD [M]  /root/lddgeek/Module.o
make[2]: warning:  Clock skew detected.  Your build may be incomplete.
  Building modules, stage 2.
make[2]: Warning: File `scripts/Makefile.lib' has modification time 1.2e+03 s in the future
  MODPOST 1 modules
  CC      /root/lddgeek/Module.mod.o
  LD [M]  /root/lddgeek/Module.ko
make[2]: warning:  Clock skew detected.  Your build may be incomplete.
make[1]: warning:  Clock skew detected.  Your build may be incomplete.
make[1]: Leaving directory `/usr/src/linux-3.8.13-bone47'

Shyam D

unread,
Mar 25, 2015, 12:59:42 AM3/25/15
to beagl...@googlegroups.com
i simply decided to update my eMMC with latest flash will update after it, by the way i am facing some issues while flashing the on board eMMC , help me in the tread named:Unable to Flash the internal eMMC of BBB Rev C

Frank Agius

unread,
Mar 25, 2015, 7:09:39 AM3/25/15
to beagl...@googlegroups.com


On Monday, March 23, 2015 at 9:42:08 PM UTC-4, Shyam D wrote:
No, the first time it succedded but dont know why the second time it started saying 

make -C /lib/modules/3.8.13-bone47/build M=/root/lddgeek modules
make[1]: Entering directory `/usr/src/linux-3.8.13-bone47'
make[1]: Warning: File `/usr/src/linux-3.8.13-bone47/arch/arm/Makefile' has modification time 1.2e+03 s in the future
make[2]: Warning: File `scripts/Makefile.lib' has modification time 1.2e+03 s in the future
  CC [M]  /root/lddgeek/module.o
/root/lddgeek/module.c: In function 'module_start':
/root/lddgeek/module.c:7:1: warning: control reaches end of non-void function [-Wreturn-type]
  LD [M]  /root/lddgeek/Module.o
make[2]: warning:  Clock skew detected.  Your build may be incomplete.
  Building modules, stage 2.
make[2]: Warning: File `scripts/Makefile.lib' has modification time 1.2e+03 s in the future
  MODPOST 1 modules
  CC      /root/lddgeek/Module.mod.o
  LD [M]  /root/lddgeek/Module.ko
make[2]: warning:  Clock skew detected.  Your build may be incomplete.
make[1]: warning:  Clock skew detected.  Your build may be incomplete.
make[1]: Leaving directory `/usr/src/linux-3.8.13-bone47'

You should look more closely at the results.  Your module built successfully and should be usable.  The messages regarding "clock skew detected"  are warnings only.  They are usually caused when during separate compilation attempts (usually across system boots) the system clock has changed.  You can usually eliminate those type of warnings by first running "make clean" then your normal make.

frank

Shyam D

unread,
Mar 25, 2015, 7:19:27 AM3/25/15
to beagl...@googlegroups.com
Thank you very much for the repeated support, but any ways i have tried to flash my eMMC with latest image via SD (in middle i failed )after which i was not able to login to, may be my eMMC is corrupted now , i am trying to flash a new latest image on to my board in which i am facing many problems please answer some of my quires at thread named Unable to Flash the internal eMMC of BBB Rev C 

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/E9bS5pzCamo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages