Re: [beagleboard] Re: SPI with DMA

828 views
Skip to first unread message
Message has been deleted
Message has been deleted

Robert Nelson

unread,
Aug 19, 2014, 12:05:06 PM8/19/14
to Beagle Board
On Tue, Aug 19, 2014 at 11:02 AM, Siddarth Sharma
<ss1...@my.bristol.ac.uk> wrote:
> I'm using BeagleBone with AM3517 and Linux kernel version: 2.6.37

are you sure?

Regards,

--
Robert Nelson
http://www.rcn-ee.com/
Message has been deleted

John Syn

unread,
Aug 19, 2014, 12:20:08 PM8/19/14
to beagl...@googlegroups.com

From: Siddarth Sharma <ss1...@my.bristol.ac.uk>
Reply-To: "beagl...@googlegroups.com" <beagl...@googlegroups.com>
Date: Tuesday, August 19, 2014 at 9:02 AM
To: "beagl...@googlegroups.com" <beagl...@googlegroups.com>
Subject: [beagleboard] Re: SPI with DMA

I'm using BeagleBone with AM3517  and Linux kernel version: 2.6.37
BeagleBone use AM3359 or AM3358 processors. When using the mcspi driver, DMA is automatically invoked when the size of your transfer exceeds a defined threshold which you will find in the mcspi driver. If you want to see how this is done, look at examples of SPI drivers in the /drivers/iio or /drivers/staging/iio folder. BTW, you don’t invoke the mcspi driver functions directly. Instead you use the generic linux SPI functions which in turn call the mcspi functions. Read the /Documentation/spi docs.

Regards,
John


On Tuesday, August 19, 2014 5:00:24 PM UTC+1, Siddarth Sharma wrote:
Hi Folks,

I have recently decided to learn embedded linux development and I am currently working on a project to use the SPI on Beagle Bone to transfer 64+bytes of data as one block in one write cycle to an Atmel SAM 32 bit uC. I would like to use DMA with the SPI and I have read online that this is not possible from user space with spidev. I came across omap2_mcspi.c driver and I noticed that this has dma functions in it. I would like to enable two DMA channels(tx and rx) to provide and receive data from the respective registers on the SPI. Could someone guide as to how I am to go about using omap2_mcspi? Would i need to make a module?

Thanks!

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Siddarth Sharma

unread,
Aug 19, 2014, 3:45:41 PM8/19/14
to beagl...@googlegroups.com
Hi John,

Attached is my user space code to transmit 1 byte of data stored in buffer - data using spidev. Would this then call dma controller automatically if i increase the size of my buffer data to 64 bytes? Also, I want to setup a interrupt handler that gets called when data is received or transmitted by the dma. How do i do this?

Thanks!


You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/ZtfEPoACcXE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
main.cpp
Spi.cpp
Spi.h

John Syn

unread,
Aug 19, 2014, 7:32:28 PM8/19/14
to beagl...@googlegroups.com

From: Siddarth Sharma <siddharth_...@my.bristol.ac.uk>
Reply-To: "beagl...@googlegroups.com" <beagl...@googlegroups.com>
Date: Tuesday, August 19, 2014 at 9:31 AM
To: "beagl...@googlegroups.com" <beagl...@googlegroups.com>
Subject: Re: [beagleboard] Re: SPI with DMA

Hi John,

Attached is my user space code to transmit 1 byte of data stored in buffer - data using spidev. Would this then call dma controller automatically if i increase the size of my buffer data to 64 bytes? Also, I want to setup a interrupt handler that gets called when data is received or transmitted by the dma. How do i do this?
You cannot service interrupts from user space. If you want to service interrupts, then you have to create a kernel module or device driver. I recommend your follow the IIO examples as a template. 

Regards,
John
Reply all
Reply to author
Forward
0 new messages