ltib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ltib] Read from /dev/spi


From: Peter Barada
Subject: Re: [Ltib] Read from /dev/spi
Date: Wed, 03 Nov 2010 10:33:21 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.15) Gecko/20101027 Thunderbird/3.0.10

On 11/03/2010 09:31 AM, elex S wrote:
Hello Peter,

Thanks for your inputs.
I checked 'linux/Documentation/spi' directory. It has sample program 'spidev_fdx.c'. I have tried it on my setup.
I have following observations:
1. Function 'do_msg(int fd, int len)'  works well.
  This function uses 'ioctl(SPI_IOC_MESSAGE)' mechanism to talk with slave.

2. Function 'do_read(int fd, int len)' always returns '0xff'.
  This function uses 'read()' call to get the data.

>From #1, it seems that my kernel is configured with 'spidev'. However, #2 shows weird behaviour.

Would it be possible to provide more inputs so that I can dig into it?

Elex,

The spidev_fdx.c program mentioned is an example SPI program; a quick look at that code makes me think its not setup to talk to a SPI EEPROM.  You'll have to analyze the SPI messages the program sends/expects and modify the code to conform to what your SPI EEPROM sends/expects. 

I've attached a better starting point; its a program that uses spidev to talk to an Atmel AT25080A SPI EEPROM on a Logic OMAP35x Torpedo board; you'll have to compare the program and datasheet (in the link above) to that for your EEPROM and modify accordingly.

Hope it helps.

-- 
Peter Barada
address@hidden

Attachment: spi-test.c
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]