AnsweredAssumed Answered

BF70x SPI Slave DMA mode

Question asked by selportion on Aug 4, 2016
Latest reply on Oct 27, 2016 by oldfoxsoftware

I am trying to configure a BF70x DSP as SPI Slave receiver with DMA by setting its registers, but after following the HardwareReference's steps and descriptions I still could not manage to get it to work.

I hope this question is not a duplicate, as I do NOT want to use abstraction functions with SPI Handles, adi_spi_Open() etc due to their overhead and complexity that I cannot afford on that application.

 

Using SPI0 so all DMA channels and TRU mapping are set accordingly.

 

1) Pin muxing done (SPI works without DMA)

 

2) Configure DMA
static uint16_t RX_buffer[RX_BUFFER_SIZE] = {0};

*(pREG_DMA5_ADDRSTART) = RX_buffer;    //Destination address

*(pREG_DMA5_XCNT) = RX_BUFFER_SIZE;    //Circular buffer implementation

*(pREG_DMA5_XMOD) = 0x2;            //Single word increment

*(pREG_DMA5_CFG) = 0x9113;            //Wait for trigger, AutoBuffer Mode, 16bit Mem WordSize, 16bit Periph WordSize, Receive Direction, Enable

 

3) DMA should trigger on SPI having available data on the RX buffer. Configure the Trigger Routing Unit

*(pREG_TRU0_GCTL) = 0x1;      //Enable in Trigger Routing Unit the propagation of signals

*(pREG_TRU0_SSR29) = 19;     //SPI0 RX DMA Channel

 

4) SPI Configuration and enable:

*(pREG_SPI0_RXCTL) = 0x1; //Receive enable

*(pREG_SPI0_TXCTL) = 0x0; //Transmit disable

*(pREG_SPI0_CTL) = 0x331; //SPI Slave, EMISO, 16bit 'word', CPHA=1, CPOL=1, Enable

 

But still I can see the data on bus, I can read them from *(pREG_SPI0_RFIFO) without DMA, but my RX_buffer[] stays empty. Am I missing something? Any help is appreciated.

Outcomes