Search code examples
beagleboardspi

SPI for Beagleboard Xm


I am trying to get the spi interface working on a BeagleBoard Xm. I have reconfigured the kernel (2.6.32) to allow access to spidev drivers in userspace (spidev3.0 and 3.1 show up under /dev) and I have compiled the spidev_test.c program given under Documentation/spi. When I run the program I get the following output:

# ./spi_test -D /dev/spidev3.0 spi mode: 3 bits per word: 8 max speed: 5[ 186.539611] spidev spi3.0: DMA RX last word empty00000 Hz (500 KHz)

 00 00 00 00 00 00  00 00 00 00 00 00  00 00 00 00 00 00  00 00 00 00
 00 00  00 00 00 00 00 00  00 00 00 00 00 00  00 0D

I am transmitting the following and would expect to see that back on the receive buffer: 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

I have a jumper between SIMO and SOMI on the board and am not seeing any activity on any of the pins when probing the CLK or CS0 pins with an o-scope. This leads me to believe that I do not have something configured properly in either the kernel or u-boot. The DMA error might also be a clue to a configuration problem.

Has anyone run into this problem? Or have any insight on what problem I may be running into?

My next possible solutions are to use an updated kernel and dig into u-boot to see if u-boot is overriding my pin muxing.

Thanks in advance for your replies.


Solution

  • I was able to figure out my problem. I was enabling spidev and the pin muxing in the kernel but had not updated u-boot. Finally, after upgrading to 2.6.39-rc7 kernel and making the correct adjustments to the beagle.h file in u-boot, my loopback test seems to be working.