This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I am using OMAP-L137 DSP, non BIOS.
I need transfer a bulky data array through the SPI1 interface of DSP. I instantiate an DMA channel of EMDA3 engine to transfer the data array to the SPI1 tx buffer. I follow the steps to setup my DMA channel presented in page 143 of SPRUFL1C.
However, there is no any data transferring out from SPI. Could you help me check where is the bug? I post the setup steps below.
////////////////////////////////////////
Step (1): Write EMCR, CCEERCLR, ECR registers to clear the EMR, CCERR, ER
EMCR = 0xFFFFFFFF;
CCERRCLR = 0xFFFFFFFF;
ECR = 0xFFFFFFFF;
Step (2): Set DMA channel's event enable register (EESR). We choose Event 2.
EESR = 4;
Step (3): Set PaRAM entry for DMA. As we choose Event 2 to enable, we setup the PaRAM set 2. PaRAM_Set2_BASE = 0x01C04040.
OPT = 0x100000; // enable Transfer complete interrupt
SRC address is the data array address;
DST address is SPI1_DAT1 address;
BCNT = 5;
ACNT = 2;
DSTBIDX = 0; // as DST is SPI1 tx buffer
SRCBIDX = 2;
LINK = 0xFFFF;
BCNTRLD = 0;
CNT = 1;
DSTCIDX = 0;
SRCCIDX = 0;
Step (4): Set DMA event 2's interrupt register. We enable interrupt of Event 2.
IESR = 4;
Step (5): Write to event set register (ESR) to manually initiate DMA transfer request for Event 2
ESR = 4;
////////////////////////////////////////
My second question is whether we manually set the ESR in order to initiate the DMA TR for the SPI? I thought it should be automatically to initiate the DMA TR once we setup the event 2.
Thank you.
Eugene,
To test/debug the basic setup of the EDMA, I would recommend starting with a memory to memory transfer. That way you can eliminate any interactions w/ the SPI as part of your debug.
One observation is that you enable Interrupts on Event2, both in the IESR and in the OPT.TCINTEN field. You also need to set the OPT.TCC (transfer completion code) to 2.
Re: manual triggering (ESR) vs event triggering (by the SPI). You're right that in most cases you would use the DMA Event provided by the SPI. Note also that the SPI module is connected to EDMA Events 14 and 15 for SPI0 RX and TX; vs Events 18 and 19 for SPI1. That means you should use EDMA Channel 15 (not channel 2) if you want to directly trigger the EDMA event by the SPI module.
You may also consider using the recently released Startereware software package.
www.ti.com/starterware
This gives non-OS set of drivers and examples to perform some of the basic peripheral interactions, including using edma to service the SPI peripheral. The package is fully supported on OMAPL138 (as well as AM1808, and C6748). However, the OMAPL137 is VERY close to the OMAPL138. Based on quick inspection of the user guides, the SPI0 integration is the same on both parts (they use the same address in the memory map, and they connect to the same event to the EDMA) SPI1 is at a different base address on OMAPL137, so if you're using SPI1, you would have to modify the starterware base address accordingly.
Regards
Kyle