BeagleBone alive! Where is s/w doc?

UPS blessed me with a package from Digi-Key today... containing a BeagleBone! Yay!
BeagleBone came up straight away! Yay!
My hello.py program says "Hello, world!" Yay!
My hello.c program says "Hello, world!" Yay!
Bonescript demo binks an LED. Yay!

After spending some time poking around and otherwise exploring, I thought it would be interesting to try writing a C program to blink the user LEDs... this is where things slowed down.

I've looked around the BeagleBoard web site, and Google'd, and I can't find any software reference documentation. Am I just not seeing it? Where is it hiding?

I also grep'ed around in /usr/include, but I can't find anything that looks like BeagleBone specific include files that define things like I/O pins and registers and such, although I'm sure such stuff must exist. Clues would be most welcome here.

So far, I'm very pleased with the completeness of the Angstrom build, and how easily everything all came up. Much better Out-of-Box-Experience than either the Beagle or the Panda, at least in terms of instant gratification.

-dave

Hi Dave,
I'm afraid there isn't too much in the way of software info available right now. For some of the basic stuff take a look at this link. Although it is for the Beagleboard, it also applies to the bone.

http://elinux.org/index.php?title=Category:ECE497

Mark

<snip>

I've looked around the BeagleBoard web site, and Google'd, and I can't find any software reference documentation. Am I just not seeing it? Where is it hiding?

I also grep'ed around in /usr/include, but I can't find anything that looks like BeagleBone specific include files that define things like I/O pins and registers and such, although I'm sure such stuff must exist. Clues would be most welcome here.

<snip>

-dave

Hi Dave,
I'm afraid there isn't too much in the way of software info available right now. For some of the basic stuff take a look at this link. Although it is for the Beagleboard, it also applies to the bone.

http://elinux.org/index.php?title=Category:ECE497

Mark

I started looking around in the bonescript sources here:
https://github.com/jadonk/bonescript/blob/master/bonescript/index.js
and it has code to talk to the GPIO.

It looks like the Bone has virtual devices for setting the direction and value. Unfortunately, I'm not too swift at Javascript, so reading/understanding it will be slow going. I was able to blink an LED from the command line, though.

It seems like the Bone's GPIO interface is very different from the BeagleBoard. So... I guess best bet for understanding the virtual devices would be to look at the kernel code that implements them? Anyone have a clue where that lives in the source tree?

Also, the devices are only writable by root -- which makes some sense but I'd really like to have code running as a normal user be able to talk to I/O. Any thoughts on how to accomplish that?

In any case, if the Bone GPIO can be completely controlled by read/writes to virtual devices that is a big improvement over the Good Old Days -- and really cries out for a Python module, which I would love to start working on as soon as I can sort out how it all works.

-dave

<snip>

I've looked around the BeagleBoard web site, and Google'd, and I can't find any software reference documentation. Am I just not seeing it? Where is it hiding?

I think that is something we will pull together over time, but the
starting point is the README.htm. [1]

[1] http://beagleboard.org/static/beaglebone/a3/README.htm

I also grep'ed around in /usr/include, but I can't find anything that looks like BeagleBone specific include files that define things like I/O pins and registers and such, although I'm sure such stuff must exist. Clues would be most welcome here.

There's currently not much BeagleBone specific include stuff built
yet. Linux provides sufficient abstractions for the peripherals with
the exception of the pinmux currently--and even that is mostly covered
by the OMAP pinmux documentation, though it is in the process of being
reworked.

<snip>

-dave

Hi Dave,
I'm afraid there isn't too much in the way of software info available right now. For some of the basic stuff take a look at this link. Although it is for the Beagleboard, it also applies to the bone.

http://elinux.org/index.php?title=Category:ECE497

That's a pretty good place to start. I'm open to moving some more
BealgeBone specific information from that into the BeagleBone101
presentation referenced in the README.htm, based on priorities of the
questions being asked.

Mark

I started looking around in the bonescript sources here:
https://github.com/jadonk/bonescript/blob/master/bonescript/index.js
and it has code to talk to the GPIO.

It looks like the Bone has virtual devices for setting the direction and value. Unfortunately, I'm not too swift at Javascript, so reading/understanding it will be slow going. I was able to blink an LED from the command line, though.

It seems like the Bone's GPIO interface is very different from the BeagleBoard.

It is pretty much identical. Both simply handled by the Linux GPIO abstraction.

So... I guess best bet for understanding the virtual devices would be to look at the kernel code that implements them? Anyone have a clue where that lives in the source tree?

I think the gpio.txt file in the kernel tree might be the first place
for you to start. [2] For other interfaces, I recommend looking
through the ABI documentation first. [3] I'll take a look around and
come back with the location for the GPIO kernel sources, but I doubt
that is what you really need right now.

[2] http://www.kernel.org/doc/Documentation/gpio.txt
[3] http://www.kernel.org/doc/Documentation/ABI/README

Also, the devices are only writable by root -- which makes some sense but I'd really like to have code running as a normal user be able to talk to I/O. Any thoughts on how to accomplish that?

You can change permissions on the files as one option.

In any case, if the Bone GPIO can be completely controlled by read/writes to virtual devices that is a big improvement over the Good Old Days -- and really cries out for a Python module, which I would love to start working on as soon as I can sort out how it all works.

Great! In addition to the JavaScript library I'm working up
(bonescript), there is also a C++ library and set of tools to build
Arduino sketches that Dave Anders has been working on that I'm looking
forward to him sharing with the community and enabling us to
complete/extend.

All,

I've put up a new tutorial showing how to use Eclipse to cross-compile applications for the BeagleBoard:

http://www.lvr.com/eclipse1.htm

Comments welcome.

Jan

Hi Jason,

<snip>

I've looked around the BeagleBoard web site, and Google'd, and I can't find any software reference documentation. Am I just not seeing it? Where is it hiding?

I think that is something we will pull together over time, but the
starting point is the README.htm. [1]

[1] http://beagleboard.org/static/beaglebone/a3/README.htm

Yes, well, that's a quick read :slight_smile:

Under "known issues" it lists two that are speed bumps for my projects:

* Need completed CAN drivers
* Need improved PWM support

If you can point to the relevant parts of the source tree I'd like to take a look to see if I can contribute to flattening those particular speed bumps.

<snip>

I started looking around in the bonescript sources here:
https://github.com/jadonk/bonescript/blob/master/bonescript/index.js
and it has code to talk to the GPIO.

It looks like the Bone has virtual devices for setting the direction and value. Unfortunately, I'm not too swift at Javascript, so reading/understanding it will be slow going. I was able to blink an LED from the command line, though.

It seems like the Bone's GPIO interface is very different from the BeagleBoard.

It is pretty much identical. Both simply handled by the Linux GPIO abstraction.

Hmmm... OK, so I need to educate myself on that.

So... I guess best bet for understanding the virtual devices would be to look at the kernel code that implements them? Anyone have a clue where that lives in the source tree?

I think the gpio.txt file in the kernel tree might be the first place
for you to start. [2] For other interfaces, I recommend looking
through the ABI documentation first. [3] I'll take a look around and
come back with the location for the GPIO kernel sources, but I doubt
that is what you really need right now.

[2] http://www.kernel.org/doc/Documentation/gpio.txt
[3] http://www.kernel.org/doc/Documentation/ABI/README

Thanks, I'll check those out.

Also, the devices are only writable by root -- which makes some sense but I'd really like to have code running as a normal user be able to talk to I/O. Any thoughts on how to accomplish that?

You can change permissions on the files as one option.

OK, I was wondering if it was a simple as that. Like setting up a gpio group and changing the permissions to be group writeable. Maybe leave the mux and direction as root-only, but set up a more permissive group for data writes.

In any case, if the Bone GPIO can be completely controlled by read/writes to virtual devices that is a big improvement over the Good Old Days -- and really cries out for a Python module, which I would love to start working on as soon as I can sort out how it all works.

Great! In addition to the JavaScript library I'm working up
(bonescript), there is also a C++ library and set of tools to build
Arduino sketches that Dave Anders has been working on that I'm looking
forward to him sharing with the community and enabling us to
complete/extend.

So, I guess Dave A's source isn't posted anywhere in it's current state? It would be good to make the C++ and Python versions somewhat philosophically similar if possible.

-dave

Dave,

check out kernel LED class and its corresponding sysfs entries.

You should find a bunch directories in /sys/class/leds/. Each
directory represent a LED driven by a LED driver in kernel. In each of
these directories, there is a file named "brightness". You can turn
them writing a value between 0-100 to it. you can also connect a
"trigger" to each of these LEDs, such as mmc activity. That's how the
two on-board LEDs flash. google around "led class" and you can find
lots docs.

I guess you would also like to toggle some GPIO for fun. check out
"Documentation/gpio.txt" in kernel tree.

have fun.

kel

See the “Paths in Sysfs” section of this document for the non-LED GPIO pins. This method allows users pace access to the GPIO pins.

http://kernel.org/doc/Documentation/gpio.txt

An Arduino was my introduction to microcontrollers and physical computing. The documentation provided by that project surely spoiled me now that I’ve seen a few other platforms and their (lack of) documentation.

Patches to the README.txt and bonescript projects are welcome!