Other Parts Discussed in Thread: CC1310
Hi Team,
At present, I am using the SPI Master mode of CC1310. What I need is that 256 bytes can be sent at a time in SPI MASTER mode. According to the routine in the API, Hello World can be sent normally. However, after I assigned 100 bytes to the array that needs to be sent and ran it, I found that only the first 28 bytes could be printed.
According to the API description, SPI TX can send up to 1024 bytes each time.
At present, I suspect that the timeout period has not been set properly. Might this be the cause of the issue?
Transfer Size Limit
The UDMA controller only supports data transfers of up to 1024 data frames. A transfer with more than 1024 frames will be transmitted/received in multiple 1024 sized portions until all data has been transmitted/received. A data frame can be 4 to 16 bits in length.
Timeout
Timeout can occur in SPI_MODE_BLOCKING, there's no timeout in SPI_MODE_CALLBACK. When in SPI_MODE_CALLBACK, the transfer must be canceled by calling SPI_transferCancel().
If a timeout happens in either SPI_SLAVE or SPI_MASTER mode, the receive buffer will contain the bytes received up until the timeout occurred. The SPI transaction status will be set to SPI_TRANSFER_FAILED. The SPI transaction count will be set to the number of bytes sent/received before timeout. The remaining bytes will be flushed from the TX FIFO so that the subsequent transfer can be executed correctly. Note that specifying a timeout prevents the driver from performing a polling transfer when in slave mode.
The code is as follows.
void *mainThread(void *arg0) { GPIO_init(); SPI_init(); uint8_t x; SPI_Handle handle; SPI_Params params; SPI_Transaction transaction; uint8_t txBufdata[100]; uint8_t rxBuf[11]; SPI_Params_init(¶ms); params.bitRate = 4000000; params.frameFormat = SPI_POL1_PHA1; params.mode = SPI_MASTER; transaction.count = sizeof(txBufdata); transaction.txBuf = txBufdata; transaction.rxBuf = rxBuf; handle = SPI_open(Board_SPI_MASTER, ¶ms); while(1) { for(x=0;x<100;x++) { txBufdata[x]=x; } SPI_transfer(handle, &transaction); } }
Could you have a look at my issue or provide any routine available? Thank you in advance.
Kind regards,
Katherine