Other Parts Discussed in Thread: OMAP-L138, OMAPL138
Tool/software: TI-RTOS
Hi All,
I am trying to communicate my device with spi with Edma by configuring SPI as below but facing transaction issue. So, I started spi edma in loopback mode.
My configurations are as follows...
SPI_INSTANCE = 1
SPI_socGetInitCfg(SPI_INSTANCE, &spi_cfg);
hEdma[0] = edma3init(0, &edmaResult);
if (edmaResult != EDMA3_DRV_SOK)
{
goto err;
}
spi_cfg.edmaHandle = hEdma[0];
spi_cfg.dmaMode = true;
SPI_socSetInitCfg(SPI_INSTANCE, &spi_cfg);
SPI_Params_init(&spiParams);
spiParams.frameFormat = SPI_POL0_PHA1;
SPI_init();
hwHandle = (SPI_Handle)SPI_open(SPI_INSTANCE, &spiParams);
SPI_control(hwHandle,SPI_V0_CMD_LOOPBACK,(void *) &loop);
if (!hwHandle)
{
while(1);
}
xferEnable = 1;
SPI_control(hwHandle, SPI_V0_CMD_XFER_ACTIVATE, (void *)&xferEnable);
txBuffer = (uint8_t *)Osal_local2Global(txBuf);
RxBuffer = (uint8_t *)Osal_local2Global(rxBuf);
while(1)
{
memcpy(txBuffer, "hello\n", 6);
len = 6;
CacheP_wb((void *)RxBuffer, 128);
transaction.txBuf = (uint32_t *)txBuffer;
transaction.rxBuf = (uint8_t *) RxBuffer;
transaction.count = len;
transaction.arg = (void *)&terminateXfer;
retVal = SPI_transfer(hwHandle, &transaction);
if (retVal == false)
{
testPassed = false;
while(1);
}
CacheP_Inv((void *)RxBuffer, 128);
memset(rxBuf, 0, 4);
udelay(1000);
}
SPI_close(hwHandle);
I took mcbsp as a reference to configure spi in edma mode but couldn't make it work.
I am receiving dma interrupt Once with rx data as 0xB5B5B5B5B5B5 after that control getting exit from the task after keeping it in while(1) also.
Can anyone help me, where I am going wrong?
Thanks,
Bhargavi Ale.