SPI in Beaglebone

2,109 views
Skip to first unread message

Rai32

unread,
May 18, 2012, 3:12:01 AM5/18/12
to beagl...@googlegroups.com
Hi, I'm trying to communicate an ADC with the "beaglebone" using SPI communication protocol, and I only find documentation about beagleboard.
Could I use the "beagleboard" docs about how to setup the kernel and the SPI for the beaglebone??
This the link I've red about the SPI in the beagleboard.

Thanks in advance.

Koen Kooi

unread,
May 18, 2012, 8:26:57 AM5/18/12
to beagl...@googlegroups.com
spidev is enabled by default in angstrom images for beaglebone.

Rai32

unread,
May 18, 2012, 11:54:02 AM5/18/12
to beagl...@googlegroups.com
I searched the spidev in 02 14 12 date SD Card received from beaglebone and I can't find nothing about SPI.
I tried to download the Angstrom-Cloud9-IDE-GNOME-eglibc-ipk-v2012.05-beaglebone-2012.05.09.img.xz, but the system doesn't run.
Is spidev present on 2012.05.09 image?

Koen Kooi

unread,
May 18, 2012, 12:53:51 PM5/18/12
to beagl...@googlegroups.com

Op 18 mei 2012, om 17:54 heeft Rai32 het volgende geschreven:

> I searched the spidev in 02 14 12 date SD Card received from beaglebone and I can't find nothing about SPI.
> I tried to download the Angstrom-Cloud9-IDE-GNOME-eglibc-ipk-v2012.05-beaglebone-2012.05.09.img.xz, but the system doesn't run.
> Is spidev present on 2012.05.09 image?

yes

Jan Szymanski

unread,
May 21, 2012, 12:40:40 AM5/21/12
to beagl...@googlegroups.com
Hi Koen,

I have the latest image
root@beaglebone:~# uname -a
Linux beaglebone 3.2.16 #1 Wed May 9 11:28:21 CEST 2012 armv7l GNU/Linux

but I have no spidev under /dev
root@beaglebone:~# ls /dev | grep spi
root@beaglebone:~#

root@beaglebone:~# find / -name 'spidev*'
/lib/modules/3.2.16/kernel/drivers/spi/spidev.ko
/usr/include/linux/spi/spidev.h
root@beaglebone:~#

How to enable the spidevx.y node?

Jan

Brian Adams

unread,
May 21, 2012, 9:39:26 PM5/21/12
to beagl...@googlegroups.com
Jan,

User space spi is a kernel module that is not included by default. Make sure that you have the spidev kernel module loaded. 

root@beaglebone:~/spi# lsmod
Module                  Size  Used by
r8712u                119262  0 
spidev                  3888  0 
...

If you don't have it, you can 'opkg install kernel-module-spidev'. Once that module is loaded, you should see /dev/spidev1.0.

-- To join: http://beagleboard.org/discuss
To unsubscribe from this group, send email to:
beagleboard...@googlegroups.com
Frequently asked questions: http://beagleboard.org/faq

Jan Szymanski

unread,
May 22, 2012, 1:17:14 AM5/22/12
to beagl...@googlegroups.com
Brian,

 Still no luck, I must be missing something.

I did:
root@beaglebone:~# opkg install kernel-module-spidev
Package kernel-module-spidev (3.2.16-r11n+gitr720e07b4c1f687b61b147b31c698cb6816
d72f01) installed in root is up to date.

root@beaglebone:~# modprobe spidev
root@beaglebone:~# lsmod
Module                  Size  Used by
spidev                  3888  0
ip_tables               7830  0
x_tables               14348  1 ip_tables
g_mass_storage         24018  0
rfcomm                 24259  0
ircomm_tty             14073  0
ircomm                  8407  1 ircomm_tty
irda                   85557  2 ircomm_tty,ircomm
hidp                   10152  0
bluetooth             109714  4 rfcomm,hidp
rfkill                 14605  2 bluetooth
ipv6                  210442  14
root@beaglebone:~#

root@beaglebone:~# update-modules

root@beaglebone:~# find / -name 'spidev*'
/lib/modules/3.2.16/kernel/drivers/spi/spidev.ko
/sys/bus/spi/drivers/spidev
/sys/class/spidev
/sys/module/spidev
/usr/include/linux/spi/spidev.h
root@beaglebone:~# ls /dev/spi*
ls: cannot access /dev/spi*: No such file or directory
root@beaglebone:~#

so still no /dev/spidev1.0. ...

Thanks for your help

Jan

Koen Kooi

unread,
May 22, 2012, 5:02:25 AM5/22/12
to beagl...@googlegroups.com
It would be spidev2.0, but let me guess: you have a cape connected with an 0x57 I2c address. Could you past the output of:

dmesg | grep -i cape

regards

Koen

Jan Szymanski

unread,
May 22, 2012, 6:48:37 PM5/22/12
to beagl...@googlegroups.com
Hi Koen,

 I have no cape connected

root@beaglebone:~# dmesg | grep -i cape
[    0.306881] BeagleBone cape EEPROM: could not read eeprom at address 0x54
[    0.366877] BeagleBone cape EEPROM: could not read eeprom at address 0x55
[    0.426876] BeagleBone cape EEPROM: could not read eeprom at address 0x56
[    0.486877] BeagleBone cape EEPROM: could not read eeprom at address 0x57
[    0.486894] BeagleBone cape: exporting ADC pins to sysfs
root@beaglebone:~#

BTW,
I tried the previous image and had no luck either
root@beaglebone:~# uname -a
Linux beaglebone 3.2.14 #1 Mon Apr 9 12:21:19 CEST 2012 armv7l GNU/Linux

root@beaglebone:~# opkg install kernel-module-spidev
Package kernel-module-spidev (3.2-r10d+gitre8004dad869568692ca2a45c04e8464ce48cc
4d7) installed in root is up to date.
root@beaglebone:~# modprobe spidev
FATAL: Error inserting spidev (/lib/modules/3.2.14/kernel/drivers/spi/spidev.ko)
: Invalid module format
root@beaglebone:~#

Thanks

Jan

Ramon Benavent

unread,
May 25, 2012, 4:42:36 AM5/25/12
to beagl...@googlegroups.com
I have the same problem:

root@beaglebone:/# uname -a
Linux beaglebone 3.2.16 #1 Wed May 9 11:28:21 CEST 2012 armv7l GNU/Linux

root@beaglebone:/# opkg install kernel-module-spidev
Package kernel-module-spidev (3.2-r11f+gitr31944a82681a0e7ab6cc3e069c30eddc5042e3e8) install.

root@beaglebone:/# modprobe spidev
root@beaglebone:/# lsmod
Module                  Size  Used by
spidev                  3888  0 
ip_tables               7830  0 
x_tables               14348  1 ip_tables
g_mass_storage         24018  0 
rfcomm                 24259  0 
ircomm_tty             14073  0 
ircomm                  8407  1 ircomm_tty
irda                   85557  2 ircomm_tty,ircomm
hidp                   10152  0 
bluetooth             109714  4 rfcomm,hidp
rfkill                 14605 

But I haven't /dev/spi nor spidev.*

Thanks foryour time.



2012/5/23 Jan Szymanski <jan.sz...@uts.edu.au>

To unsubscribe from this group, send email to:

Jorgen

unread,
May 25, 2012, 5:14:56 AM5/25/12
to beagl...@googlegroups.com
I had the same problem, but after a "opkg update ; opkg upgrade" and a reboot, it seems to work fine.
2012/5/23 Jan Szymanski <jan.sz...@uts.edu.au>

Christopher De Vries

unread,
May 26, 2012, 2:01:16 AM5/26/12
to beagl...@googlegroups.com
I have been having this same trouble. It looks like this blog: http://waxpraxis.tumblr.com/post/19277633509/ubuntu-on-the-beaglebone-with-userland-spi has a solution a disk image which you can load directly onto the SD card. I am going to try downloading it now.

Koen Kooi

unread,
May 29, 2012, 3:51:06 AM5/29/12
to beagl...@googlegroups.com

Op 26 mei 2012, om 08:01 heeft Christopher De Vries het volgende geschreven:

> I have been having this same trouble. It looks like this blog: http://waxpraxis.tumblr.com/post/19277633509/ubuntu-on-the-beaglebone-with-userland-spi has a solution a disk image which you can load directly onto the SD card. I am going to try downloading it now.

Or you can just opkg upgrade to the new kernel in angstrom

Dhiraj

unread,
May 30, 2012, 9:10:18 PM5/30/12
to beagl...@googlegroups.com
Hi, even i have the same problem. 
i even did the opkg update  and opkg upgrade but it ran out of space.
 did anyone got the spi device working ? or even the kernel image the has a working spi device driver.
thank you all

Steve

unread,
May 30, 2012, 11:43:45 PM5/30/12
to beagl...@googlegroups.com
  1. setup an 8gb sdcard using the images from may 09
  2. use gparted to resize the Angstrom partition to fill the rest of the card
  3. then do the upgrade...

Steve

unread,
May 31, 2012, 12:46:28 AM5/31/12
to beagl...@googlegroups.com
Also...I've found that dd if=/dev/zero of=/dev/"insert sdcard value"
 mine is mmcblk0 

any sdcard before you image it. Tends to be a more reliable image

Janek

unread,
May 31, 2012, 3:55:25 AM5/31/12
to beagl...@googlegroups.com
check the post here: https://groups.google.com/forum/?fromgroups#!searchin/beagleboard/Frank/beagleboard/7xRo7ovknhs/JO2xYlc2DdoJ

The tmpfs is very small. It's better to use the tmp-dir option, e.g.

  opkg --tmp-dir ~ update
  opkg --tmp-dir ~ upgrade
  opkg --tmp-dir ~ install something

Jan

Dhiraj

unread,
May 31, 2012, 3:25:32 PM5/31/12
to beagl...@googlegroups.com
hi Janek,
            thank you for the valuable information. the trick worked i am able to see the spidev2.0 in my /dev list.
regards
Dhiraj
Reply all
Reply to author
Forward
0 new messages