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
|