Other Parts Discussed in Thread: AWR1642, SYSBIOS
Tool/software: TI-RTOS
I'm trying to implement SPI communication on the Traffic Monitoring lab. I achieved successful communication with Master mode, but when I configure Slave mode and I run SPI_transfer(), I get the following command lines:
{module#8}: "../dss_main.c", line 212: error {id:0x10000, args:[0x814364, 0x814364]}
[Cortex_R4_0] xdc.runtime.Main: "platform/mmwave_xwr16xx.c", line 1342: assertion failure
xdc.runtime.Error.raise: terminating execution
My configuration code for the SPI driver is:
SPI_Params_init(¶ms);
params.mode = SPI_SLAVE;
params.frameFormat = SPI_POL0_PHA0;
params.pinMode = SPI_PINMODE_4PIN_CS;
params.shiftFormat = SPI_MSB_FIRST;
params.dmaEnable = 1;
params.dmaHandle = dmaHandle;
params.u.slaveParams.dmaCfg.txDmaChanNum =1U;
params.u.slaveParams.dmaCfg.rxDmaChanNum =0U;
params.transferMode = SPI_MODE_BLOCKING;
params.dataSize = 8U;
params.u.slaveParams.chipSelect=0;
My code to call the transaction function is:
uint16_t a = 2;
char r;
SPI_Transaction spiTransaction;
spiTransaction.count = sizeof(uint16_t); //COUNT= number of frames for this transaction
spiTransaction.txBuf = (void *)&a; //void * to a buffer with data to be transmitted
spiTransaction.rxBuf = NULL; //receive
spiTransaction.slaveIndex=0;
int ret = SPI_transfer(SPIhandle, &spiTransaction); //llamo a la funcion
if (!ret) {
System_printf("Unsuccessful SPI transfer");
}
I've already checked the SPI test files in the driver folder and got no information for this problem. Could you help me solving it?