Hello everybody!
I'm working with Omapl-138 processor; using code composer studio v 3.3.82.13, dsp/bios 5.41.02.14 and psp 01.30.01.
I'm trying transmit data from first omap to second via SPI interface. For that purposes i'm using psp functions: GIO_create, GIO_read, GIO_write.
I have no problems with transmitting data(creating gio channel and writing data to it), but have some troubles with receiving.
On receiver side i use GIO_create to create channel, it's ok, and GIO_read to get data from channel. But GIO_read returns error code -1 (generic failure).
I can see memory map of SPI1 and correct data in receive buffer, but i can't understand how to receive it via psp streaming functions...
There is my settings for spi:
spiParams_inp = Spi_PARAMS;
spiParams_inp.hwiNumber = 8;
spiParams_inp.spiHWCfgData.intrLevel = TRUE;
spiParams_inp.spiHWCfgData.masterOrSlave = Spi_CommMode_SLAVE;
spiParams_inp.spiHWCfgData.pinOpModes = Spi_PinOpMode_SPISCS_4PIN;
spiParams_inp.spiHWCfgData.clkInternal = FALSE;
spiParams_inp.opMode = Spi_OpMode_INTERRUPT;
spiParams_inp.loopbackEnabled = FALSE;
spiParams_inp.edmaHandle = NULL;
spiParams_inp.spiHWCfgData.configDatafmt[0].charLength = 16;
spiParams_inp.spiHWCfgData.configDatafmt[0].clkHigh = FALSE;
spiParams_inp.spiHWCfgData.configDatafmt[0].lsbFirst = FALSE;
spiParams_inp.spiHWCfgData.configDatafmt[0].oddParity = FALSE;
spiParams_inp.spiHWCfgData.configDatafmt[0].parityEnable = FALSE;
spiParams_inp.spiHWCfgData.configDatafmt[0].phaseIn = TRUE;
spiParams_inp.spiHWCfgData.configDatafmt[0].waitEnable = FALSE;
spiParams_inp.spiHWCfgData.csDefault = 0x1;
Creating GIO channel this way:
chanParams.hEdma = NULL;
spiHandle_inp = GIO_create("/Spi1",IOM_INPUT,NULL,&chanParams,NULL);
if (NULL != spiHandle_inp)
{
LOG_printf(&trace,"GIO_create OK! \n");
}
else
{
LOG_printf(&trace,"GIO_create ERROR! \n");
}
and trying to read data:
size = sizeof(buf_dest)/sizeof(uint16_t);
devStatus = GIO_read(spiHandle_inp, &buf_dest, &size);
if (IOM_COMPLETED == devStatus)
{
LOG_printf(&trace,"GIO_read OK! \n");
}
else
{
LOG_printf(&trace,"GIO_read ERROR! \n");
}
If everybody solved such problem - please help! Thanks in advance!