2011-03-21 06:01:45 Sport SPI driver question
Richard Aldrich (UNITED KINGDOM)
Message: 99089
I have the requirement to use the BF537 as a SPI slave device, using the SPORT1.
I have enabled the enable the "Blackfin SPORT driver for direct raw access", which gives me the device in /dev/sport0 and /dev/sport1.
I have also enabled "emulate SPI bus with Blackfin SPORT" under SPI.
Firstly, is the correct approach? Does any have experience using these drivers? And example test code?
I get various crashes when I try to open, read or write to the sport, I suspect I am doing something wrong. Often the board will silently restart when I attempt to write to the SPORT.
I will post with some of the errors shortly, but wondered if anyone has any thoughts before I dig deeper in to it.
I'm using 2010R10RC5.
QuoteReplyEditDelete
2011-03-21 08:07:44 Re: Sport SPI driver question
Mike Frysinger (UNITED STATES)
Message: 99091
if you want to use the SPORT as a SPI bus, do not use the "Blackfin SPORT driver for direct raw access". that is only for what its description says -- raw access.
writing to the SPORT without properly configuring it probably will hang and cause the watchdog to reset the part. this is "normal" behavior.
QuoteReplyEditDelete
2011-03-21 08:22:36 Re: Sport SPI driver question
Richard Aldrich (UNITED KINGDOM)
Message: 99092
Ok thanks Mike, that is what I wanted to establish first.
So if I enable "emulate SPI bus with Blackfin SPORT", I then want to read and write to the device from my application. However I do not see the device in /dev, so I can not open it as I would a normal character device.
So my next question would be, how do I use the driver and are there any examples? What would the next step be?
QuoteReplyEditDelete
2011-03-21 08:33:48 Re: Sport SPI driver question
Mike Frysinger (UNITED STATES)
Message: 99093
please read the SPI documentation:
docs.blackfin.uclinux.org/doku.php?id=spi
the fact that it's running over a SPORT has no bearing at all to the SPI API
QuoteReplyEditDelete
2011-03-21 08:39:59 Re: Sport SPI driver question
Richard Aldrich (UNITED KINGDOM)
Message: 99094
Excellent, thanks Mike, I will look at it this afternoon and see how far I get!
By the way, I also currently use "Blackfin ADSP SPI ADC Support" driver, for communicating with another device on SPI, is that likely to cause problems running along side this, or is it just a case of getting the device ID / bus number correct on the config file?
QuoteReplyEditDelete
2011-03-21 08:51:23 Re: Sport SPI driver question
Mike Frysinger (UNITED STATES)
Message: 99095
SPI clients are indexed by bus number, so you should only have to make sure that it is updated to use the number assigned to the SPORT/SPI bus
QuoteReplyEditDelete
2011-03-21 10:39:47 Re: Sport SPI driver question
Richard Aldrich (UNITED KINGDOM)
Message: 99097
Hi Mike,
The doc mentions the spidev Userspace Driver, which is basically what I want to use but on SPORT SPI. Is that possible? I want to gain userspace access to the emulated SPI over sport driver.
QuoteReplyEditDelete
2011-03-21 10:49:41 Re: Sport SPI driver question
Mike Frysinger (UNITED STATES)
Message: 99099
spidev should not care what spi bus it is actually operating on
QuoteReplyEditDelete
2011-03-21 12:05:40 Re: Sport SPI driver question
Richard Aldrich (UNITED KINGDOM)
Message: 99102
Thanks Mike, I have now got the driver working, and can see data on a scope that looks correct.
Am I right in thinking that the SPORT SPI driver can only run in Master mode? I will be experiementing with running it as an SPI slave, as that is ideally how I want to use it.
QuoteReplyEditDelete
2011-03-21 12:54:34 Re: Sport SPI driver question
Mike Frysinger (UNITED STATES)
Message: 99104
there is no support at all in Linux today for running as a SPI slave. there is talk of implementing this, but it's a ways off.