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.

TMS320C6746: SPI edma tms320c6746 example

Part Number: TMS320C6746

hello TI,

 i am having issue while using edma with spi , for below examples i have some questions

I) if i want to transfer data continuosly, do we need to call   RequestEDMA3Channels(); every time we initiate a dma transfer,and do we need to call 

some function to free dma channel after every transfer


/*
** Main function.
*/
int main(void)
{
volatile char originalData[260] = {0};
volatile char readFlash[260] = {0};
unsigned int retVal = 0;
unsigned char choice;

/* Initializes the UART Instance for serial communication. */
UARTStdioInit();

UARTPuts("Welcome to SPI EDMA application.\r\n", -1);
UARTPuts("Here the SPI controller on the SoC communicates with", -1);
UARTPuts(" the SPI Flash present on the SoM.\r\n\r\n", -1);

/* Initializes the EDMA3 Instance. */
EDMA3Initialize();

/* Initializes the SPI1 Instance. */
SPIInitialize();

/* Request EDMA3CC for Tx and Rx channels for SPI1. */
RequestEDMA3Channels();

/* Enable SPI communication. */
SPIEnable(SOC_SPI_1_REGS);

/* Enable the SPI Flash for writing to it. */
WriteEnable();

UARTPuts("Do you want to erase a sector of the flash before writing to it ?.", -1);
UARTPuts("\r\nInput y(Y)/n(N) to proceed.\r\n", -1);

choice = UARTGetc();
UARTPutc(choice);

if(('y' == choice) || ('Y' == choice))
{
/* Erasing the specified sector of SPI Flash. */
FlashSectorErase();
}

WriteEnable();

/* Program a specified Page of the SPI Flash. */
FlashPageProgram(originalData);

/* Read the contents of the page that was previously written to. */
ReadFromFlash(readFlash);

/* Verify whether the written and the read contents are equal. */
retVal = verifyData(&originalData[4], &readFlash[4], 256);

if(TRUE == retVal)
{
UARTPuts("\r\nThe data in the Flash and the one written ", -1);
UARTPuts("to it are equal.\r\n", -1);
}
else
{
UARTPuts("\r\n\r\nThe data in the Flash and the one written to it", -1);
UARTPuts(" are not equal.\r\n", -1);
}

while(1);
}