LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 07-27-2010, 03:19 AM   #1
prathyusha.kh
LQ Newbie
 
Registered: Jul 2010
Posts: 1

Rep: Reputation: 0
SPI test application fails


Hi,

I am working on spi driver for freescale mxc board.My issue is with the test application.Its not working properly for bits per word option other than 8,16,32.The spi test logs follows.

Test Application for SPI driver *********
*******************************************************
* This test sends bytes of the last parameter to *
* a specific SPI device. The maximum transfer *
* bytes are 4096 bytes for bits per word less than *
* 8(including 8), 2048 bytes for bits per word *
* between 9 and 16, 1024 bytes for bits per word *
* larger than 17(including 17). SPI writes data *
* received data from the user into Tx FIFO and *
* waits for the data in the Rx FIFO. Once the data *
* is ready in the Rx FIFO, it is read and sent to *
* user. Test is considered successful if data *
* received = data sent. *
* *
* NOTE: As this test is intended to test the SPI *
* device,it is always configured in loopback mode *
* reasons is that it is dangerous to send ramdom *
* data to SPI slave devices. *
* *
* Options : ./mxc_spi_test1
[-D spi_no] [-s speed]
[-b bits_per_word]
[-H] [-O] [-C] <value>
* *
* <spi_no> - CSPI Module number in [0] *
* <speed> - Max transfer speed *
* <bits_per_word> - bits per word *
* -H - Phase 1 operation of clock *
* -O - Active low polarity of clock *
* -C - Active high for chip select *
* <value> - Actual values to be sent *
*******************************************************

root@freescale ~$ ./mxc_spi_test1 -D 0 -s 100 -b 32 -H -O -C hema
Execute data transfer test: 0 4 hema
spi mode: 7
bits per word: 32
max speed: 100 Hz (0 KHz)
Data sent : hema
Data received : hema
Test PASSED.
root@freescale ~$ ./mxc_spi_test1 -D 0 -s 100 -b 64 -H -O -C hema
Execute data transfer test: 0 4 hema
spi mode: 7
bits per word: 64
max speed: 100 Hz (0 KHz)
Data sent : hema
Data received : hema
Test PASSED.
root@freescale ~$ ./mxc_spi_test1 -D 0 -s 100 -b 10 -H -O -C hema
Execute data transfer test: 0 4 hema
spi mode: 7
bits per word: 10
max speed: 100 Hz (0 KHz)
Data sent : hema
Data received : hm
Test PASSED.
root@freescale ~$ ./mxc_spi_test1 -D 0 -s 100 -b 20 -H -O -C hema
Execute data transfer test: 0 4 hema
spi mode: 7
bits per word: 20
max speed: 100 Hz (0 KHz)
Data sent : hema
Data received : he
Test PASSED.
root@freescale ~$ ./mxc_spi_test1 -D 0 -s 100 -b 24 -H -O -C hema
Execute data transfer test: 0 4 hema
spi mode: 7
bits per word: 24
max speed: 100 Hz (0 KHz)
Data sent : hema
Data received : hem
Test PASSED.
root@freescale ~$ ./mxc_spi_test1 -D 0 -s 100 -b 24 -H -O -C 123456789
Execute data transfer test: 0 9 123456789
spi mode: 7
bits per word: 24
max speed: 100 Hz (0 KHz)
Data sent : 123456789
Data received : 123
Test PASSED.
root@freescale ~$ ./mxc_spi_test1 -D 0 -s 100 -b 20 -H -O -C 123456789
Execute data transfer test: 0 9 123456789
spi mode: 7
bits per word: 20
max speed: 100 Hz (0 KHz)
Data sent : 123456789
Data received : 12
Test PASSED.
root@freescale ~$ ./mxc_spi_test1 -D 0 -s 100 -b 9 -H -O -C 123456789
Execute data transfer test: 0 9 123456789
spi mode: 7
bits per word: 9
max speed: 100 Hz (0 KHz)
Data sent : 123456789
Data received : 1
Test PASSED.


The issue is for example if i select bits per word option as 10 and transfer hema(data), i am receiving hm(data).I am not receiving hema(data).

Please help me with the above issue.

Thanks in advance.

Regards,
Prathyusha.kh
 
Old 07-28-2010, 02:41 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Look into the SPI controller documentation to see if it really supports something different than n*8 (12 bits are also possible). Devices rarely (if ever) use different lengths.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LFS 6.4: a coreutils test fails ReyJavikVI Linux From Scratch 3 06-21-2009 02:09 PM
Test and application. opnine Linux - Newbie 2 04-27-2009 11:07 AM
ISO Fails Test p2pfire Fedora 3 01-07-2007 05:05 PM
SPI Test application for PXA255 SBC jasdeep_js Linux - Kernel 0 09-20-2006 01:51 AM
TEST fails bato Linux - Networking 1 11-08-2004 02:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 02:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration