Quantcast

SPI problem on Overo

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

SPI problem on Overo

stone8936
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Hi,

I use Overo Earth with Tobi board. The system is Angstrom, and kernel version is 3.2.0. I want to enable the SPI port.
I didn't change anything in board-overo.c.
I built spidev in the kernel, and excluded the ADS7846 and LGPHILIPS LB035Q02.
I hook up the pin5(MOSI) and pin7(MISO).

Then I compile and run the spidev_test.c from the kenel source.
There results are all FF, which I think is not right.
root@overo:~# ./spitest -D /dev/spidev1.1
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz)

FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF


And if I wan to use the loopback, there is some problem like this.
root@overo:~# ./spitest -D /dev/spidev1.1 -l
spidev spi1.1: setup: unsupported mode bits 20
can't set spi mode: Invalid argument


I am really new on driver stuffs.
How to solve this problem? How could I know my spi driver can work well?
My final target is to connect Gumstix with a MSP430 board via SPI.

Thank you,
Zhaohan Jia
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SPI problem on Overo

stone8936
This post was updated on .
And more, I tried another way.
Following http://www.jumpnowtek.com/index.php?option=com_content&view=article&id=57&Itemid=62.
to build a customized SPI driver using OE.

When I do part 2, the result shows the loopback information doesn't received neither:
root@overo:~#cat /dev/spike
Status: 0
TX: 0 1 2 3
RX: 0 0 0 0


I definitely jumper pin5 (MOSI) to the pin7 (MISO).

I thought there may be some problems with the cable or board.
I changed cable, but nothing happened.
Then I change another Gumstix Overo Earth board with Tobi.
The result changes, but is still not right.
root@overo:~#cat /dev/spike
Status: 0
TX: 0 1 2 3
RX: 255 255 255 255
.

I think there should be some one successfully enable spi on Overo. Could any one give some hints?

Sincerely,
Zhaohan Jia
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SPI problem on Overo

Scott Ellis
I just tried a quick test of spike (part2) from github and it worked for me.

root@overo:~# insmod spike.ko
[   86.327667] Disabling lock debugging due to kernel taint

root@overo:~# cat /dev/spike
Status: 0
TX: 0 1 2 3
RX: 0 1 2 3

root@overo:~# cat /dev/spike
Status: 0
TX: 4 5 6 7
RX: 4 5 6 7

root@overo:~# cat /dev/spike
Status: 0
TX: 8 9 10 11
RX: 8 9 10 11

root@overo:~# uname -a
Linux overo 3.2.0 #1 PREEMPT Wed Jan 23 10:59:47 EST 2013 armv7l GNU/Linux

root@overo:~# lsmod
Module                  Size  Used by
spike                   2927  0
ipv6                  240002  10

Tobi board, pins 5 and 7 jumpered.
SPIDEV, ADS7846 and the LB035Q02 all disabled in the kernel config.

I can provide the kernel config if you want, but it's stripped down quite
a bit for work on another project. Let me know if you want it.

Scott
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SPI problem on Overo

stone8936
Oh, that will be very nice. Thank you very much!
Is that possible share the your uImage at the same time?

Best Regards,
Zhaohan Jia
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SPI problem on Overo

Scott Ellis
ftp://www.pansenti.com/overo-test/

I added the spike.ko module and a console root image.

I wouldn't use it to do anything but test your hardware.

It's from a hardfp build so any userland code needs to have
-mfloat-abi=hard -mfpu=vfp  as linker options.

It also has the gpio 144-147 pins mux'd for McBSP use which
you probably don't want.

It should work to validate your hardware though.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SPI problem on Overo

stone8936
This post was updated on .
Hi,

First, thank you very much!
So your system is Yocto?
I used your uImage, rootfs and spike.ko. But same problem comes.
And also tried your  with above.

I thought there may be something about the pin multiplex, and add multiplexing code in the board-overo.c and rebuild kernel.  Still the same problem, on both of my two Overo boards. The information is below:
root@overo:~# insmod spike.ko 
Disabling lock debugging due to kernel taint

root@overo:~# cat /dev/spike 
Status: 0
TX: 0 1 2 3
RX: 255 255 255 255

root@overo:~# lsmod
Module                  Size  Used by
spike                   2899  0
rfcomm                 55180  0
ipv6                  244760  14
hidp                   16651  0
bluetooth             218428  4 rfcomm,hidp
rfkill                 17575  1 bluetooth

root@overo:~# uname -a
Linux overo 3.2.0 #1 PREEMPT Thu Jan 24 16:59:30 CET 2013 armv7l GNU/Linux


Is there some possibility problem of  u-boot ? I have no experience on u-boot.
BTW, I don't know how to use your MLO and u-boot.img.

Or there probably be some hardware problem...?

Anyway, thank you very much for you help!!

Zhaohan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SPI problem on Overo

Scott Ellis
Yes I used Yocto to build the binaries.

I don't think you are using my kernel though.

Only one module should show up - ipv6

There should be no bluetooth modules. As I said, it's a very stripped kernel.

Can you post the boot log? It should start similar to this

U-Boot SPL 2012.10-00007-g2d44b29-dirty (Jan 23 2013 - 05:32:58)
OMAP SD/MMC: 0
reading u-boot.img
reading u-boot.img


U-Boot 2012.10-00007-g2d44b29-dirty (Jan 23 2013 - 05:32:58)

OMAP3530-GP ES3.1, CPU-OPP2, L3-165MHz, Max CPU Clock 720 mHz
Gumstix Overo board + LPDDR/NAND
I2C:   ready
DRAM:  512 MiB
NAND:  0 MiB
MMC:   OMAP SD/MMC: 0
*** Warning - readenv() failed, using default environment

In:    serial
Out:   serial
Err:   serial
Board revision: 1
Direct connection on mmc2
No EEPROM on expansion board
Die ID #6d1800040000000004039f2203011014
Net:   smc911x-0
Warning: smc911x-0 using MAC address from net device

Hit any key to stop autoboot:  0
reading boot.scr

251 bytes read
Running bootscript from mmc ...
## Executing script at 82000000
reading uImage

2669904 bytes read
## Booting kernel from Legacy Image at 82000000 ...
   Image Name:   Linux-3.2.0
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2669840 Bytes = 2.5 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 3.2.0 (scott@hex) (gcc version 4.6.4 20120303 (prerelease) (GCC) ) #1 PREEMPT Wed Jan 23 10:59:47 EST 2013
[    0.000000] CPU: ARMv7 Processor [411fc083] revision 3 (ARMv7), cr=10c53c7d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[    0.000000] Machine: Gumstix Overo
...



Are you booting off an SD card?

I provided all of the binaries you should need for a test.

MLO, u-boot.img and uImage for your boot partition.

fit-console-image for your rootfs

And the spike.ko module to load and test.

The default gumstix u-boots mux the SPI1 pins for use as SPI.

The u-boot I posted did not modify those pins.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SPI problem on Overo

stone8936
This post was updated on .
Oh, the information printed is  used in my kernel.

I boot from SD card. I try your kernel again.
However, I cannot load your u-boot.img. I copy MLO, u-boot.img and uImage to my first partition.

The booting log:
Texas Instruments X-Loader 1.5.0 (Sep 16 2011 - 12:10:02)
OMAP3503-GP ES3.1.2
Board revision: 1
Reading boot sector
Loading u-boot.bin from nand

U-Boot 2010.09-00000-g2894204-dirty (Jan 17 2013 - 13:52:57)

OMAP3503-GP ES3.1.2, CPU-OPP2, L3-165MHz, Max CPU Clock 600 mHz
Gumstix Overo board + LPDDR/NAND
I2C:   ready
DRAM:  512 MiB
NAND:  512 MiB
*** Warning - bad CRC or NAND, using default environment

In:    serial
Out:   serial
Err:   serial
Board revision: 1
Direct connection on mmc2
Die ID #72e4000700000000015154780d01f006
Net:   smc911x-0
Hit any key to stop autoboot:  1  0
mmc1 is available
reading boot.scr

** Unable to read "boot.scr" from mmc 0:1 **
reading uImage

2669904 bytes read
Booting from mmc ...
## Booting kernel from Legacy Image at 82000000 ...
   Image Name:   Linux-3.2.0
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2669840 Bytes = 2.5 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 3.2.0 (scott@hex) (gcc version 4.6.4 20120303 (prerelease) (GCC) ) #1 PREEMPT Wed Jan 23 10:59:47 EST 2013
[    0.000000] CPU: ARMv7 Processor [411fc087] revision 7 (ARMv7), cr=10c53c7d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[    0.000000] Machine: Gumstix Overo
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] OMAP3503 ES3.1.2 (l2cache neon isp )
[    0.000000] Clocking rate (Crystal/Core/MPU): 26.0/332/500 MHz
......
[    7.821075] smsc911x smsc911x.0: eth0: SMSC911x/921x identified at 0xe0816000, IRQ: 336



And the module and spike test, does not work:
Yocto (Built by Poky 7.0.2) 1.2.2 overo ttyO2

overo login: root

root@overo:~# uname -a
Linux overo 3.2.0 #1 PREEMPT Wed Jan 23 10:59:47 EST 2013 armv7l GNU/Linux

root@overo:~# insmod spike.ko
[   56.704772] Disabling lock debugging due to kernel taint
root@overo:~# cat /dev/s spike
Status: 0
TX: 0 1 2 3
RX: 255 255 255 255

root@overo:~# lsmod       
Module                  Size  Used by
spike                   2927  0
ipv6                  240002  10


I try to change your u-boot name u-boot.img to u-boot.bin, I don't know the difference, seems a stupid try....
stop at Loading u-boot.bin from mmc.

I jumper the pins like this, I hope these two are the right pins.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SPI problem on Overo

Philipp Lutz
The difference is, that newer MLO / X-Loader versions (end 2012 /
beginning 2013) seem to boot "u-boot.img" instead of "u-boot.bin".
That's also one thing I only discovered recently.
Maybe you also should use a more up-to-date MLO version together with a
recent u-boot version. Your MLO version 1.5.0 (Sep 16 2011) seems quite old.
You might get your precompiled versions here:
http://feeds.sakoman.com/feeds/yocto-1.3/images/overo/current/


-------- Original Message  --------
Subject: Re: [Gumstix-users] SPI problem on Overo
From: stone8936 <[hidden email]>
To: [hidden email]
Date: 01/25/2013 11:10 AM
> I try to change your u-boot name u-boot.img to u-boot.bin, I don't know the
> difference.
> stop at *Loading u-boot.bin from mmc*.
>


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SPI problem on Overo

Scott Ellis
In reply to this post by stone8936
You jumpered the wrong pins.

You are on pins 34 and 36.

Pin 1 is in the lower left in your picture.

Happens ;-)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SPI problem on Overo

Scott Ellis
Philip is right though, you are still booting an old u-boot from NAND.
It's not using the SD card.

---
Texas Instruments X-Loader 1.5.0 (Sep 16 2011 - 12:10:02)
OMAP3503-GP ES3.1.2
Board revision: 1
Reading boot sector
Loading u-boot.bin from nand

U-Boot 2010.09-00000-g2894204-dirty (Jan 17 2013 - 13:52:57)
---

You probably want to fix that as well.

You might try repartitioning and reformatting the SD card before copying
the binaries.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SPI problem on Overo

stone8936
In reply to this post by Philipp Lutz
Hi Philipp

I change the MLO you provided.
X-Loader is still 1.5.0, and it still try to load the u-boot.bin in the nand.
I guess may be the previous X-Loader is in the nand. So the MLO in the mmc is not used.
How to let it start from mmc ?

Thank you!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SPI problem on Overo

stone8936
In reply to this post by Scott Ellis
You are right! I jumper the wrong pins. Finally...I should post the jumper picture at the beginning. Sorry for bring trouble for you guys.
I actually looked at the pin map of this picture, and followed the SV1 side before.


Now the spike loopback test works!  Thank you for your nice reply!!!


BTW, could you tell me the steps to boot the u-boot from the mmc.
To try boot from the mmc, I actually erase the u-boot.bin in the nand on one board.
But the board still tries to load u-boot.bin from the nand. So it cannot boot and hang at:
u-boot.bin not found or blank nand contents -  attempting searial boot...
## Ready for binary (kermit) download to 0x80008000 at 115200...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SPI problem on Overo

Scott Ellis
The system should always boot from the SD card first if it finds one
with the proper files.

If your system isn't doing that I would try repartitioning/reformatting
your SD card before copying the binaries.

If that doesn't work, then maybe look into trying another SD card.

Loading...