Accessing SPI on beagle board from userspace

351 views
Skip to first unread message

Ganny

unread,
Jan 1, 2010, 4:16:51 AM1/1/10
to Beagle Board, ganesh...@manipal.net
Hi all,
Linux Version : 2.6.29
I am trying to access the SPI from user space, by running spidev_test.c
(provided in SPI documentation). This to work,kernel pinmux settings
has to be done to use McSPI3 and McSPI4 on Beagleboard expansion
connector. As suggested in link: http://www.mail-archive.com/linux...@vger.kernel.org/msg14673.html
Along with the changes mentioned in above link, I had added few debug
messages when initializing MUX for different architectures(OMAP24XX &
OMAP34XX)

Next,
Step 1) I build the kernel, while compiling I observed some weird
behaviour like, spi related files were not compiled(files in ~/
beagledroid/kernel/drivers/spi/)
Then I copied the uImage[beagledroid/kernel/arch/arm/boot/uImage] file
to SD card and attached to beagle board. Tried to boot from the SD
card. Though boot was successful, there were some issues like:
a. spi device was not created at /dev/
[Note: Not confirm whether it should create or not, but in case of
i2c, a device by name i2cX is created after boot]

Next step is to test with spidev_test.c
Note: I don't think spidev_test.c will be successful until 'spi' is
created in /dev/ as we try to read/write data to that device in
spidev_test.c , but thought of trying it

Step 2) I created the executable for the spidev_test.c[which is
provided in Documentation/spi] by following the link:
http://www.aton.com/android-native-development-using-the-android-open-source-project/
[Note: By following the steps mentioned in above link for
'my_ping' application]
Later I copied the spidev_test.c executable(say spidev_test) to /bin
folder in SD card[/media/linux/system/bin]
[Note: My SD card has two partitions 'dos' and 'linux', suggested
by some developer for beagle on some Google links]

Later I booted using SD card on beagle board, my observations were:
1. As stated above, SPI device wasn't listed in path /dev/ after
booting
2. upon execution of spidev_test, it gave an error stating that it
cannot find the device
Note: By default it considers spidev1.1 as the device at path /dev/

I appreciate the suggestions and corrections for/in my changes.

Ganny

unread,
Jan 4, 2010, 12:27:06 AM1/4/10
to Beagle Board
Hi all,
I could solve the compilation problem of SPI driver related code. Now
the SPI driver code gets compiled successfully and a device gets
created in /dev/.
Now when I execute the spidev_test.c executable, I wont get any change
in MOSI, CLK, CS signals through logic analyser. Through cutecom I
could get that the information sent was successful! What could be
wrong?

On Jan 1, 2:16 pm, Ganny <ganeshkkum...@gmail.com> wrote:
> Hi all,
> Linux Version : 2.6.29
> I am trying to access theSPIfromuserspace, by running spidev_test.c

> (provided inSPIdocumentation). This to work,kernel pinmux settings


> has to be done to use McSPI3 and McSPI4 onBeagleboardexpansion

> connector. As suggested in link: http://www.mail-archive.com/linux-o...@vger.kernel.org/msg14673.html


> Along with the changes mentioned in above link, I had added few debug
> messages when initializing MUX for different architectures(OMAP24XX &
> OMAP34XX)
>
> Next,
> Step 1) I build the kernel, while compiling I observed some weird

> behaviour like,spirelated files were not compiled(files in ~/


> beagledroid/kernel/drivers/spi/)
> Then I copied the uImage[beagledroid/kernel/arch/arm/boot/uImage] file
> to SD card and attached to beagle board. Tried to boot from the SD
> card. Though boot was successful, there were some issues like:

> a.spidevice was not created at /dev/


>     [Note: Not confirm whether it should create or not, but in case of
> i2c, a device by name i2cX is created after boot]
>
> Next step is to test with spidev_test.c
> Note: I don't think spidev_test.c will be successful until 'spi' is
> created in /dev/ as we try to read/write data to that device in
> spidev_test.c , but thought of trying it
>
> Step 2) I created the executable for the spidev_test.c[which is

> provided in Documentation/spi] by following the link:http://www.aton.com/android-native-development-using-the-android-open...


>     [Note: By following the steps mentioned in above link for
> 'my_ping' application]
> Later I copied the spidev_test.c executable(say spidev_test) to /bin
> folder in SD card[/media/linux/system/bin]
>     [Note: My SD card has two partitions 'dos' and 'linux', suggested
> by some developer for beagle on some Google links]
>
> Later I booted using SD card on beagle board, my observations were:

> 1. As stated above,SPIdevice wasn't listed in path /dev/ after

Reply all
Reply to author
Forward
0 new messages