AnsweredAssumed Answered

i.max rt1021evm board lpspi连续读写多字节,第16个时钟输出异常问题

Question asked by t t on May 28, 2020
Latest reply on Jun 24, 2020 by t t

1 i.max rt1021evm board lpspi 基于free rtos 单任务: 我的需求是发出4个字节地址头,再读取从16个字节。

连续读写多字节,第16个时钟输出异常问题。如附件,请帮忙分析下,谢谢。

2 排查了,发送不超过16个字节就不会有这个问题,超过了就会必现。

code:

memset(masterSendBuffer,0,sizeof(masterSendBuffer));
memset(masterReceiveBuffer,0,sizeof(masterReceiveBuffer));

masterSendBuffer[0] = 1;
masterSendBuffer[1] = 2;
masterSendBuffer[2] = 3;
masterSendBuffer[3] = 4;

masterXfer.txData = masterSendBuffer;
masterXfer.rxData = masterReceiveBuffer;
masterXfer.rxIndex = 0;
masterXfer.dataSize = 20;
masterXfer.configFlags = EXAMPLE_LPSPI_MASTER_PCS_FOR_TRANSFER | kLPSPI_MasterPcsContinuous | kLPSPI_SlaveByteSwap;

master_rtos_handle.drv_handle.isPcsContinuous = 1;

status = LPSPI_RTOS_Transfer(&master_rtos_handle, &masterXfer);
if (status == kStatus_Success)
{
// PRINTF(" AHB_READ_BURST_START successfully rx[0]=0x%x,rx[1]=0x%x,remainRdNum=%d \r\n",
// masterXfer.rxData[0],masterXfer.rxData[1],master_rtos_handle.drv_handle.rxRemainingByteCount);
}else{
PRINTF(" AHB_READ_BURST_START with error.\r\n");
}

Attachments

Outcomes