Home > Project > Progress! SPI is working on the BeagleBoard-xM

Progress! SPI is working on the BeagleBoard-xM

As a first step to writing a Linux SPI device driver for the Maxim 7221 LED display driver chip I decided to at least prove that I can get SPI working on the BeagleBoard-xM with the BeagleBoard-xM Trainer Expansion Board which provides level translated SPI and GPIO pins.

To get this to work I had to do the following:

  1. Patch the Linux Kernel 2.6.32 BeagleBoard board specific arch/arm/mach-omap2/board-omap3beagle.c so that the SPI pins get configured correctly and the SPIDEV driver is made aware of the SPI devices on the board. For the patch information see this page.
  2. Once the kernel was patched I used the Angstrom distribution OpenEmbedded build environment to re-build the kernel.
  3. Build the spidev_test.c program that is part of the Documentation/spi tree in the linux kernel source using a cross compiler built using the crosstool-ng cross compiler build system.
  4. Load the spidev_test executable onto the Beagleboard-xM

With everything set up and ready to go it was time to boot BeagleBoard-xM and verify that the required SPI devices appeared in the /dev directory. Upon booting I was very happy to see the following:

root@beagleboard:/# ls /dev/spi*
/dev/spidev3.0 /dev/spidev3.1 /dev/spidev4.0

With the spidev devices being present it was time to see if they actually worked! So I hooked up my USBee SX logic analyzer to the Trainer boards McSPI4 pins and ran the spidev_test program. What the logic analyzer saw was exactly what the spidev_test program was sending! I’ve now verified that I can communicate with SPI devices using the kernels SPIDEV driver.

The spidev_test program sends the following data:

uint8_t tx[] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x40, 0x00, 0x00, 0x00, 0x00, 0x95,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xDE, 0xAD, 0xBE, 0xEF, 0xBA, 0xAD,
0xF0, 0x0D,

You can see from the following screen shot that the data was properly transmitted via the SPI:

Click the image to view full size.

And here are some images of the BeagleBoard-xM set up with the Trainer card and the USBee logic analyzer attached:

Click on image to see full size.


Click on image to see full size.


The next step is to write some code to put the SPI LED display through it’s paces.


  1. November 24th, 2011 at 08:24 | #1

    Does this verify both MOSI and MISO? I am having trouble with MISO on my master device. spidev_test returns zeros when I tie MOSI and MISO together.

  2. murathan
    January 12th, 2012 at 14:42 | #2

    I did all the steps and ran spidev. However, the data could not see Usbee. Is it relevant to the CLK input is set? Do I need to give the CLK outside?.

  3. January 28th, 2012 at 22:10 | #3

    I’ve been to your website before. The extra I study, the extra I maintain coming once more!

  4. murathan
    February 13th, 2012 at 15:50 | #4

    Hi Jim,

    I think I’ve tried everythink but it haven’t worked.http://www.veriyolu.net/murathan/ it’s what i saw
    If possible, can you send me u-boot and uImage that you use. If not, do you give name of kernel you use.

  5. February 21st, 2012 at 01:45 | #5

    It’s appropriate time to make some plans for the future and it’s time to be happy. I have read this post and if I could I desire to suggest you few interesting things or suggestions. Perhaps you could write next articles referring to this article. I want to read more things about it!

  6. March 1st, 2012 at 03:00 | #6

    I am transient on scenario now, accordingly proclivity to cede your straightforward invisible cable concrete till solve. However seems to be rocking. Your writing adorableness is largely ego trip.I had nearly inclined progress my search, at-final I trigger the break. here. Thx character that the nice enlargement playmate.

  7. March 12th, 2012 at 06:14 | #7

    Superior setup, thanks for the help. This helped me huge time with my decision.

  8. March 14th, 2012 at 00:10 | #8

    Magnificent beat ! I would like to apprentice while you amend your website, how can i subscribe for a blog website? The account helped me a acceptable deal. I had been tiny bit acquainted of this your broadcast provided bright clear idea

  9. March 14th, 2012 at 22:41 | #9

    Just desire to say your article is as amazing. The clarity in your post is simply cool and i can assume you’re an expert on this subject. Well with your permission let me to grab your RSS feed to keep up to date with forthcoming post. Thanks a million and please continue the gratifying work.

  10. November 13th, 2012 at 20:33 | #10

    Aw, this was a really nice post. In concept I would like to put in writing like this additionally – taking time and actual effort to make an excellent article… but what can I say… I procrastinate alot and in no way appear to get one thing done.

  11. November 17th, 2014 at 11:26 | #11


    No you shouldn’t need to use an external clock.

  12. March 10th, 2015 at 23:47 | #12

    It can be nearly extremely difficult to see well-educated parties on this niche, regrettably you look like you understand what exactly you’re writing on! Many Thanks

  13. March 11th, 2015 at 11:22 | #13

    It’s actually practically impossible to find well-aware men and women on this matter, unfortunately you look like you know what exactly you’re raving about! Thanks

  14. March 12th, 2015 at 00:44 | #14

    You’ll find it mostly not possible to see well-updated parties on this issue, still, you come across as like you comprehend which you’re talking about! Excellent

  15. March 12th, 2015 at 03:11 | #15

    It’s actually near impossible to find well-informed individual on this matter, although you seem like you realize exactly what you’re indicating! Thanks A Lot

  16. March 13th, 2015 at 02:15 | #16

    It really is mostly not possible to come across well-updated parties on this area, although you appear like you fully grasp the things that you’re posting on! Thank You

  17. March 16th, 2015 at 01:34 | #17

    It is actually practically unattainable to encounter well-qualified americans on this theme, regrettably you seem like you know exactly what you’re talking about! Many Thanks

  18. March 17th, 2015 at 14:08 | #18

    It’s actually almost extremely difficult to encounter well-advised individuals on this area, fortunately you look like you realize the things you’re indicating! Regards

  19. March 17th, 2015 at 14:48 | #19

    It truly is mostly unattainable to see well-aware users on this niche, however, you look like you fully grasp whatever you’re posting on! Thanks

  20. March 19th, 2015 at 05:27 | #20

    I just desire to show you that I’m really fresh to putting up a blog and thoroughly enjoyed your work. Probably I am going to remember your blog post . You definitely have fabulous article content. Love it for discussing with us your website document.

  21. March 20th, 2015 at 06:00 | #21

    We simply need to show you the fact that I’m just beginner to having a blog and incredibly admired your review. Very possible I am inclined to remember your webpage post . You really have magnificent article topic. Admire it for expressing with us your blog webpage.

  22. March 22nd, 2015 at 00:53 | #22

    I just wish to reveal to you the fact that I’m just fresh to posting and extremely adored your information. Most likely I am most likely to remember your blog post . You seriously have excellent article subject. Be Grateful For it for share-out with us your internet site page.

  23. March 22nd, 2015 at 14:22 | #23

    I just have to notify you that I am novice to writing a blog and completely adored your article. More than likely I am going to save your post post . You really have fantastic article subject. Like it for expressing with us your site article.

  24. March 24th, 2015 at 00:39 | #24

    We simply hope to show you which I’m really beginner to wordpress blogging and incredibly adored your webpage. More than likely I am going to remember your article post . You definitely have memorable article stuff. Truly Appreciate it for sharing with us your web webpage.

  25. April 17th, 2015 at 02:40 | #25

    Would adore to constantly get updated good blog ! .

  26. November 4th, 2015 at 03:47 | #26

    Check out the new message posted, I have the same problem as you in relation with the spi, did you solve it? David Calero

  1. February 25th, 2015 at 05:32 | #1
  2. September 1st, 2015 at 01:10 | #2