recompile rootfs SPI on BeagleBoard-xM

Hi,
Thank you for the reply.
I tried :
. /home/mum/.oe/environment-angstromv2012.05
bitbake linux-mainline-3.2.18 -c menuconfig

Then I actived SPI has shown in your link.
And I recompiled the Kernel :
bitbake -f -c compile linux-mainline-3.2.18
bitbake -f -c deploy linux-mainline-3.2.18

But just the uImage file was changed in the deploy directory.
The rootfs image qrchive is still the old one which has been created when I ran first time : MACHINE=beagleboard ./oebb.sh bitbake console-image

Maybe I should run the menuconfig before running MACHINE=beagleboard ./oebb.sh bitbake console-image
for the first time ?

Jerome

There’s no need, normally, to change the root file system for enabling spi. SPI is only kernel-related and if you enable it at kernel level correctly, the /dev/spiX.X devices should come up automatically. So I think it’s correct the only your uImage was modified. Once the kernel is compiled, you should put the uImage in the Angstrom partition, more precisely in the /boot directory. This is the only change (adding the re-compiled kernel in the proper path) you should do in the rootfs.

Hope this helps!

Regards

Thank you !
No I can see the spidevs in /dev
I compiled spidev_test.c and I launched it :

$./spitest -D /dev/spidev4.0
And I had :
spi mode : 0
bits per word : 8
max speed : 500000 Hz (500 KHz) // Weird, because in board-omap3beagle.c I said that maxspeed was 48 MHz

After I had just a bunch of 00 in hexadecimal
but in all the example I read I should have some 0xFF

Do you have an idea ?

Kind regards,
Jerome

PS : I used http://www.kernel.org/doc/Documentation/spi/spidev_test.c

Hi Jerome, have you got MOSI and MISO bridged for the correct spi device to create a loopback?

Hi Chris,
Yes I bridged them. I bridged McSPI4_SIMO (12) et McSPI4_SOMI (18).
The thinks which is weird is that I should have some 0xFF and not only 0x00 even if the bridge is not there.

What do you think about the code I added to board-omap3beagle.c ?

Jerome

Hi Jerome,

Hi Chris,
Yes I bridged them. I bridged McSPI4_SIMO (12) et McSPI4_SOMI (18).
The thinks which is weird is that I should have some 0xFF and not only 0x00 even if the bridge is not there.

You will receive 0x00 if bridge is not there or there is an issue elsewhere. If everything setup/works correctly you will receive what you sent out McSPI4_SIMO. You can add a led to McSPI4_SIMO (if you don’t have a scope) and loop over the send in the test code to confirm you are able to send.

What do you think about the code I added to board-omap3beagle.c ?

Looks ok but I’m unable to confirm as only have a beaglebone.Have you tried mode 3? This is what I’m currently using to talk to a slave device.

I also initially used the spi test code from:

http://armbedded.eu/node/318

to test the spi device.

Cheers Chris

It’s working now,
thanks for your help
Jerome