Where is the SpiDev test program?

1,282 views
Skip to first unread message

Brendan Merna

unread,
Jun 17, 2015, 2:45:53 PM6/17/15
to beagl...@googlegroups.com
I have shored out my data pins on P9 and I keep seeing tutorials and code running SpiDev test program? I've tried to run and it says no files exists. Where are people getting this file?

Bill Traynor

unread,
Jun 17, 2015, 3:26:39 PM6/17/15
to beagl...@googlegroups.com
spidev_test.c is available from kernel.org

https://www.kernel.org/doc/Documentation/spi/spidev_test.c

There's also a version for the BBB that can be found in Derek Molloy's
repository for his book:

git clone https://github.com/derekmolloy/exploringBB.git
then look for ../exploringBB/chp08/spi/spidev_test.c


>
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> 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.
> For more options, visit https://groups.google.com/d/optout.

Brendan Merna

unread,
Jun 17, 2015, 3:35:47 PM6/17/15
to beagl...@googlegroups.com
Thanks Bill! What about the header files below? I'm getting errors on some of the global variables and I think its because I don't have these header files.

#include <linux/types.h>
#include <linux/spi/spidev.h>

Bill Traynor

unread,
Jun 17, 2015, 3:40:09 PM6/17/15
to beagl...@googlegroups.com
On Wed, Jun 17, 2015 at 3:35 PM, Brendan Merna <bmer...@gmail.com> wrote:
> Thanks Bill! What about the header files below? I'm getting errors on some
> of the global variables and I think its because I don't have these header
> files.
>
> #include <linux/types.h>
>
> #include <linux/spi/spidev.h>
>

http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Installing_kernel_headers

Brendan Merna

unread,
Jun 18, 2015, 10:37:54 AM6/18/15
to beagl...@googlegroups.com
I'm running the command to install the header files, but I'm coming up with errors.
sudo apt-get install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree
Reading stat information... Done
E: Unable to locate package linux-headers-3.8.13-bone72
E: Couldn't find any package by regex 'linux-headers-3.8.13-bone72'
I ran the kernel upgrade before this too. Any ideas?

Robert Nelson

unread,
Jun 18, 2015, 10:43:04 AM6/18/15
to Beagle Board
On Thu, Jun 18, 2015 at 9:37 AM, Brendan Merna <bmer...@gmail.com> wrote:
> I'm running the command to install the header files, but I'm coming up with
> errors.
>
> sudo apt-get install linux-headers-$(uname -r)
>
> Reading package lists... Done
> Building dependency tree
> Reading stat information... Done
> E: Unable to locate package linux-headers-3.8.13-bone72
> E: Couldn't find any package by regex 'linux-headers-3.8.13-bone72'

What's your base rootfs?

cat /etc/dogtag

debian@beaglebone:~$ sudo apt-cache search linux-headers-3.8.13-bone72
linux-headers-3.8.13-bone72 - Linux kernel headers for 3.8.13-bone72 on armhf

Regards,

--
Robert Nelson
https://rcn-ee.com/

Brendan Merna

unread,
Jun 18, 2015, 10:49:43 AM6/18/15
to beagl...@googlegroups.com
BeagleBoard.org BeagleBone Debian Image 2014-04-23

I ran the search and nothing happened.

Robert Nelson

unread,
Jun 18, 2015, 10:53:30 AM6/18/15
to Beagle Board
On Thu, Jun 18, 2015 at 9:49 AM, Brendan Merna <bmer...@gmail.com> wrote:
> BeagleBoard.org BeagleBone Debian Image 2014-04-23
>
> I ran the search and nothing happened.

Sorry, that apt repo was initially setup July of 2014, so it's not
enabled in the original May 2014 image.

wget http://repos.rcn-ee.com/debian/pool/main/l/linux-upstream/linux-headers-3.8.13-bone72_1wheezy_armhf.deb
sudo dpkg -i linux-headers-3.8.13-bone72_1wheezy_armhf.deb

or update the rootfs:

http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#2015-03-01

Brendan Merna

unread,
Jun 18, 2015, 11:19:18 AM6/18/15
to beagl...@googlegroups.com
Thank you! That worked perfectly. I'm still having trouble compiling my spidev_test.c program though. There is a lot of undeclared variables like SPI_TX_DUAL and SPI_RX_DUAL. I thought these would be included when I downloaded the header file, but I'm not seeing the directory for this in my beaglebone. According to the code it should be </linux/types.h> and </linux/spi/spidev.h>.
Reply all
Reply to author
Forward
0 new messages