Beaglebone Kernel 3.14 with Universal Overlay

165 views
Skip to first unread message

Ray Madigan

unread,
Mar 19, 2015, 12:49:00 AM3/19/15
to libbu...@googlegroups.com
I haven't looked into it deep enough so I apologize if I could easily figure this out myself.

I am trying to find a way to write a driver for the ds18b20 temperature sensor in a newer kernel(3.14) that uses universal overlays.

I need the new kernel, and there are no drivers for the sensor, so I figured I would write myown :).  Short of writing my own pru application, I thought I would try this out first.  I looked at a few examples, the Memory Mapped example is missing, and saw how the pins are written and wondered what technique you use to find the pin from the name.

Any help would be appreciated.

Ray Madigan

unread,
Mar 20, 2015, 12:11:57 AM3/20/15
to libbu...@googlegroups.com
Well that didn't work, I tried it on a simple case and it uses sysfs capeManager which doesn't exist in the newer kernels.


Ray Madigan

unread,
Mar 20, 2015, 12:27:34 AM3/20/15
to libbu...@googlegroups.com
I had read this and thought it might be possible. 


I am not an expert in this area, does this even look right?  

Datenheld

unread,
Mar 22, 2015, 7:25:09 AM3/22/15
to libbu...@googlegroups.com
Hi Ray,

I do think that it is possible.

Here, have a look at how the raspberry pi api uses memory mapping: 

libbulldog uses BBBIOLib internally, which itself controls most of the pins via memory mapping:

Of course, you can just use the java wrapper like in BCM2835.java

HTH

Ray Madigan

unread,
Mar 22, 2015, 7:12:36 PM3/22/15
to libbu...@googlegroups.com
Thanks for your reply.

I am going to work on my project it two stages.  I only need to access the pins in two ways.  I need to access a set of pins as basic gpio output pins turning them on and off.  Then I need to use I2C to communicate with a device that will do some of the work I can't figure out how to do with the beaglebone yet.  For the I2C part I can use ioctl calls from java via the jna library and address this in a faster way when I know more.

I will you your library to access the basic gpio pins.  What would you suggest as the best plan of attack?  I thought I would get the BBBiolib.c to work for the gpio pins and test it with c tests until I have it correct, then plug it back into libbulldog.  If you have a better idea, any assistance would be useful.

Ray Madigan

unread,
Mar 24, 2015, 12:29:55 AM3/24/15
to libbu...@googlegroups.com
After looking in the code for a while I thought I could do the following:

{
NativeGpio gpio = new NativeGpio();

gpio.pinMode(9, 12, 1);
gpio.digitalWrite(9, 12, 1);
}

It compiles fine but when I attempt to run it I get
java.Lang.UnsatisfiedLinkError: org.bulldog.beagleboneblack.jni.NatieGpio.setup()Z

I will try to track down, I think it can't find the BBBlibio .

I have the ...hardfp.jar and the libbulldog-linux.so on my classpath.

Ray Madigan

unread,
Mar 24, 2015, 11:20:33 AM3/24/15
to libbu...@googlegroups.com
I checked the java versions on both sides to be sure they were compatible
on the bbb i am using OpenJava 1.7.0_75 and on my linux host I am using OpenJava 1.7.0

Then I wanted to see that the so format is correct so I
nm -D /home/me/jars/libbulldog-linux.so and I could see all of the entry points

so something else is wrong.

I am building a jni lib at work, but on windows and there somewhere some piece of code has to call

System.loadLibrary("bulldog-linux");  so I add this to my java program and then try to run it.

java tells me 
... UnsatisfiedLinkError: no bulldog.linux in java.library.path

then I ran

java -Djava.library.path=/home/me/jars LedControl

and java finds the library and tries to execute it

i get the mesage

iolib_init: CM_PER mmap failure!, error :Bad file descriptor

java dumped a log file which I will have to read later, 

I owe, I owe so off to work I go!

Datenheld

unread,
Apr 18, 2015, 4:09:05 AM4/18/15
to libbu...@googlegroups.com
Sorry for the late replay -> common error, you probably need to run your application as root.
Reply all
Reply to author
Forward
0 new messages