2008-05-28 05:10:19     SPIDEV CS problems

Document created by Aaronwu Employee on Aug 6, 2013
Version 1Show Document
  • View in full screen mode

2008-05-28 05:10:19     SPIDEV CS problems

Nico van Leeuwen (NETHERLANDS)

Message: 56338   

 

I have a problem with the spidev driver. I created two devices with different CS pin allocations in my board file.

My board is a BF533 stamp. The devices created by spidev in the /dev directory are:

spidev0.4 and spidev0.5. I use uclinux release 2008R1-RC2.

 

I've also created a simple program which opens both SPI devices, read from them and then close the devices.

When I run this program for the first time it's a success it first reads spidev0.4 and then spidev0.5, CS4 and CS5 are behaving normally. When I run the program for the second time the CS pins behave wrong. Even if I'm just reading from one device simultanously both CS pins are going low, then the MISO contains just garbage because both SPI devices (AD7467) are trying to answer at the same time.

 

Who of you have encountered the same problem, and I wish, solved it? I think it's just simple mistake on my side?

 

Best regards and thanks in advance,

 

Nico van Leeuwen

 

 

TranslateQuoteReplyEditDelete

 

 

2008-05-28 11:11:18     Re: SPIDEV CS problems

Mike Frysinger (UNITED STATES)

Message: 56351   

 

RC2 is not the latest RC ... please use the latest and retest

QuoteReplyEditDelete

 

 

2008-05-29 02:50:32     Re: SPIDEV CS problems

Nico van Leeuwen (NETHERLANDS)

Message: 56388   

 

Where can I find that the problems are solved in RC8? Switching to another distro brings risks for me, but if it is necessary it has to be done..

TranslateQuoteReplyEditDelete

 

 

2008-05-29 16:47:43     Re: SPIDEV CS problems

Mike Frysinger (UNITED STATES)

Message: 56430   

 

we really dont keep track of the issues we fix in the branch beyond the SCM log.  you can compare the versions by hand and review the svn log.

 

i'd poiint out that upgrading from rc2 to rc8 is really quite trivial considering the only thing there are bug fixes, and that nothing before rc8 should have been used other than for testing as we never announced 2008R1 for release before that.

QuoteReplyEditDelete

 

 

2008-05-30 03:31:08     Re: SPIDEV CS problems

Nico van Leeuwen (NETHERLANDS)

Message: 56448   

 

Thank you for help.

Next week I will try the SPIDEV driver in the RC8 release.

TranslateQuoteReplyEditDelete

 

 

2008-06-02 07:17:14     Re: SPIDEV CS problems

Nico van Leeuwen (NETHERLANDS)

Message: 56560   

 

Tested it today with the RC8 release, still have the same problems with SPIDEV.

 

I need help on this, because SPI is useless for me now. I can't use the SPI ADC driver because it's designed for just one adc device, and SPIDEV won't help me out yet.

 

Anyone facing the same troubles?

TranslateQuoteReplyEditDelete

 

 

2008-06-02 12:17:07     Re: SPIDEV CS problems

Mike Frysinger (UNITED STATES)

Message: 56574   

 

post the spi resources you've declared for the devices

 

try making sure the spi mode is the same for them

QuoteReplyEditDelete

 

 

2008-06-02 13:42:42     Re: SPIDEV CS problems

Rob D (UNITED STATES)

Message: 56576   

 

Hi Nico.

 

I've had similar issues, the fix I'm currently using was posted in this forum a while ago and I'm shocked it hasn't made it to mainline yet.  SPI has been totally broken for me for a while.

 

http://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?action=ForumBrowse&forum_id=39&thread_id=24178&_forum_action=ForumMessageBrowse

 

I also had to add pull-up resistors on the CS lines as they went into open-drain state.  Which might mean that the above patch is incorrect.

 

Mike, any thoughts?  My spi devices are both mode 0 on a bf548.

 

-Rob

QuoteReplyEditDelete

 

 

2008-06-02 14:55:55     Re: SPIDEV CS problems

Mike Frysinger (UNITED STATES)

Message: 56580   

 

there is an open tracker item for the SPI maintainer to review

QuoteReplyEditDelete

 

 

2008-06-05 05:31:38     Re: SPIDEV CS problems

Nico van Leeuwen (NETHERLANDS)

Message: 56727   

 

Thanks Rob you pointed me to the solution! I can confirm that those changes to the spi_bfin5xx work. I've monitored the CS with my oscilloscope.

 

CS is behaving normally now, I still have some problems with SPI but I believe that has nothing to do with CS.

 

I found out that the search engine here works bad, otherwise I should have found the same post as Rob pointed me to after ages of searching...

 

Anyway thank you all for helping me out!

 

Regards,

 

Nico van Leeuwen

Attachments

    Outcomes