I'm struggling to get spidev work properly on a Beagleboard rev. C4
running Android 2.3, Android Linux kernel 2.6.32.
So far I've patched the omap3_beagle_android_defconfig wih:
and activated spidev in board-omap3beagle.c (configured spi clk as
input!)
spidev3.0, spidev3.1 , spidev4.0 show up in /dev/spi* so far so good.
I have written a minor C program to test the spi functionality using
spidev and ioctl. I'm using write() and read() to write and read to
the spi device. write() works like a charm, but the problem is read().
Every one and then I'm getting a error message from the driver saying
"spidev spi4.0: RXS timed out". I can provoke the error by reading
several times in row, like
This does show the error message every time I run the program
Further more I've been looking into the driver to see what causes this
error message, and it seems to be something to do with the driver
reading a status bit on the spi device, which indicates if the receive
buffer is full or empty. I have NO clue why this happens.
I was hoping someone could help me get pass this barrier?
I've used TI Android Gingerbread 2.3 DevKit 1.0 - based on rowboat
My pinmux'ing is done in the kernel like this:
[,]
Well, this seems to me as if it were correct. In fact I'm doing the very same thing. The only point where I stumbeled was, that my Pinmux settings for SPI3 were overwritten by another piece of board-init code [1]. But that resulted in "no SCK in any case". I found this by checking pinmux settings after start of the kernel.
As your problems came by SPI4 I don't think it's the same issue. Do you get some SCK output during an SPI action?
What I not tried yet was reading from a C program (I was unable to find out how to compile a native application for android in a fast and easy way if you have me some pointers, I'd try it that way too). I just tested it for writing using spidev and the echo-command.
SCK is working as supposed for SPI operation. Both when reading and
writing.
Regarding native C programs for Android, it took me a minor struggle
to compile when tools needed
and setup the build environment. If you would like to try yourself,
here's a link http://source.android.com/source/initializing.html
The first tip for success building the environment is to run your host
system on Ubuntu 10.04 64 bit. I never got it working with Ubuntu 11.
To spare you the trouble for compiling a native c program, I can send
you the same C program i'm running on the beagleboard, of your
interested?
The CLK signal output works fine, both when writing and sometimes
reading.
I'd had a minor struggle getting the Android build environment working
properly, but after trying again in Ubuntu 10.04 64bit (first try
Ubuntu 11 32bit without success) it worked. If you're interested
follow this link: http://source.android.com/source/initializing.html
If you'd like to try I can send you my precompiled native c program,
to see how your SPI is operating?