[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

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!

main.cpp (523 Bytes)

Spi.cpp (2.79 KB)

Spi.h (736 Bytes)

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