2008-07-24 20:48:01     Blackfin 548 SPI DMA read operation fails

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

2008-07-24 20:48:01     Blackfin 548 SPI DMA read operation fails

Ram K (UNITED STATES)

Message: 59364   

 

When attempting to perform a DMA of say 16 bytes from the slave device (blackfin is the master), the 1st 16 bytes of data is read correctly, but there continue to be 26 bytes of SPISEL and SCK transitions before the completion of the operation.In effect there are 42 bytes read from the SPI slave device as opposed to the 16 requested. Checked the dma x_count and it seems to be programmed to 16.

 

Tried the experiment with different clock rates and seems to cause the same problem. Using byte wide transfers as well.

 

 

 

If test is performed without enabling dma, it seems to work reliably. Any ideas as to what can be the cause of the problem - looked at spi_bfin5xx.c and have yet to find something obvious.

 

 

 

 

 

Thanks

 

 

 

Mark

 

PS: The driver is based on the bfin_spi_adc.c with out the continuous dma operation

 

 

QuoteReplyEditDelete

 

 

2008-07-24 23:11:34     Re: Blackfin 548 SPI DMA read operation fails

Sonic Zhang (CHINA)

Message: 59371   

 

Don't usd DMA mode in SPI driver. Current SPI DMA controller transfer extra bits on the SPI line in addition to the buffer len given.

 

 

QuoteReplyEditDelete

 

 

2008-07-25 00:03:03     Re: Blackfin 548 SPI DMA read operation fails

Ram K (UNITED STATES)

Message: 59373   

 

Thank you very much for the prompt response. 

 

In that case, is it better to use the SPORT connected to the SPI slave device and use DMA? We need to have DMA (chain of descriptors - up to 8) to transfer (read mostly) very frequently. If we connect the TFS to RFS and SPISEL, TCLK to RCLK and SPICLK,  the PRITX to MOSI and PRIRX to MISO, do you think we will be able to achieve a fair rate and reliable transfer. Currently we are running the SPICLK as SCLK/4 (~32 MHz) and intend to use the same rate on the SPORT.

 

 

 

Thanks

QuoteReplyEditDelete

 

 

2008-07-25 01:44:48     Re: Blackfin 548 SPI DMA read operation fails

Wei Jiang (CHINA)

Message: 59375   

 

Dear sonic,

 

I wonder to do the same thing in uClinux -- emulate SPI DMA interface via SPORT.

 

According to EE-304, this seems to be feasible. Isn't it?

 

Can you give me some kindly suggestion? Thanks a lot..

 

                                 Wei Jiang

QuoteReplyEditDelete

 

 

2008-07-25 01:54:03     Re: Blackfin 548 SPI DMA read operation fails

Sonic Zhang (CHINA)

Message: 59376   

 

We have no experience on emulating SPI over SPORT.  If you are intereted, either do it by yourself, or submit a feature request with detail description to our feature request tracker. We will evaluate your request and may do it in future.

 

 

QuoteReplyEditDelete

 

 

2008-07-25 06:20:24     Re: Blackfin 548 SPI DMA read operation fails

Yi Li (CHINA)

Message: 59391   

 

I've add a feature request to add "emulate SPI using SPORT" in linux: http://blackfin.uclinux.org/gf/project/uclinux-dist/tracker/?action=TrackerItemEdit&tracker_item_id=4280

QuoteReplyEditDelete

 

 

2008-07-25 08:01:31     Re: Blackfin 548 SPI DMA read operation fails

Robin Getz (UNITED STATES)

Message: 59403   

 

Wei:

 

The best thing to do when using Linux on Blackfin is not to look at any of the EE notes on the analog.com site, unless you find them specifically pointed to in the docs.blackfin.uclinux.org site. Many have information that is just not possible in Linux, or is just plain wrong in Linux, or is not going to work with gcc. All three are bad.

 

Reading them, and expecting them to work will just cause problems.

 

-Robin

QuoteReplyEditDelete

 

 

2008-07-25 12:02:07     Re: Blackfin 548 SPI DMA read operation fails

Wei Jiang (CHINA)

Message: 59411   

 

Hi guys, take it easy. Let's forget it. I also think it's stupid to this thing as we already have a SPI interface.

 

PS: for fuse in uClinux, I mean the lib not kernel. This should be a easy thing. I will try to finish it. And I am so suprised that there is an "linux/fuse.h" in the toolchains..

 

Thx to all..

QuoteReplyEditDelete

 

 

2008-07-26 01:22:36     Re: Blackfin 548 SPI DMA read operation fails

Mike Frysinger (UNITED STATES)

Message: 59430   

 

the stuff under linux/ and asm*/ come from the kernel ... we just install there from the kernel

 

the kernel portion of FUSE has been merged which is why linux/fuse.h exists

Attachments

    Outcomes