Hi all,
I'm using the last RTOS release and I have a problem with the SPI: I'm using CC1310 as SPI Slave in callback mode, if I try to enable the SPICC26XXDMA_RETURN_PARTIAL_ENABLE to have variable payload len, it goes in loop into the callback function (verified by putting a UART_write).
If I don't use this function, all work right, if I don't remember wrong, with previous RTOS versions this function works right, can you give me some information?
my code:
void mainFnx()
{
// Inizializzazione SPI //
SPI_Params_init(¶ms);
params.bitRate = 2000000;
params.frameFormat = SPI_POL0_PHA1;
params.mode = SPI_SLAVE;
params.transferMode = SPI_MODE_CALLBACK;
params.transferCallbackFxn = transferCallback;
transaction.count = 70;
transaction.txBuf = txBuf;
transaction.rxBuf = rxBuf;
handle = SPI_open(Board_SPI0, ¶ms);
SPI_control(handle, SPICC26XXDMA_RETURN_PARTIAL_ENABLE, NULL);
SPI_transfer(handle, &transaction);
.......the code continues
}
void transferCallback(SPI_Handle handle, SPI_Transaction *transaction)
{
spi_command = rxBuf[0];
if (spi_command == SPI_COMM_PACKET_SOURCE_ADDRESS) memcpy(packetSourceAddress,&rxBuf[1],8); // in caso di comando indirizzo sorgente, lo copia nella variabile
else if (spi_command == SPI_COMM_POWER_MODE) powerMode = rxBuf[1];
else if (spi_command == SPI_COMM_CHANNEL_STOP_ADV) spi_command = SPI_COMM_NONE;
else if (spi_command == SPI_COMM_READ_OPERATION) PIN_setOutputValue(PinHandle, SPI_RTS, 0);
else if (spi_command == SPI_COMM_CHANNEL_START_ADV) Semaphore_post(mainSemHandle);
else if (spi_command == SPI_COMM_AUTO_CHANNEL_SELECT) Semaphore_post(mainSemHandle);
// Start another transfer
transaction->count = 70;
SPI_transfer(handle, transaction);
// strcpy(echoPrompt,"Hello Radio SPI callback.....\n\r");
// UART_write(uart, echoPrompt, strlen(echoPrompt));
}