SPI in Beaglebone

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.
http://www.brianhensley.net/2012/02/spi-working-on-beagleboard-xm-rev-c.html

Thanks in advance.

spidev is enabled by default in angstrom images for beaglebone.

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

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

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.

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

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

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

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.szymanski@uts.edu.au>

I had the same problem, but after a “opkg update ; opkg upgrade” and a reboot, it seems to work fine.

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

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

  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…

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

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

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