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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
1,500 Views
170026459
Contributor I

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");
}

Labels (1)
0 Kudos
1 Solution
1,399 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi t t ,

  楼主你好!

  你把第15个字节放大,给我截个图,还有第16个字节放大也截个图给我看看。

  另外,你这个问题,你有没有试过不使用freertos, 你直接使用我们的的SDK driver lpspi 工程去发送同样的数据,是否能复现问题? 我现在有点怀疑是第16个字节的时候,被其他更高优先级的代码打断了,然后回来接着运行导致的。

  你这样, 把两个放大波形给我看看,然后再试下SDK里面裸机的代码,看看是否有问题。如果裸机没有问题,我们要一起看看freertos的配置情况了。

If you still have issues about it, please kindly let me know.

Wish it helps you!

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
2 Replies
1,400 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi t t ,

  楼主你好!

  你把第15个字节放大,给我截个图,还有第16个字节放大也截个图给我看看。

  另外,你这个问题,你有没有试过不使用freertos, 你直接使用我们的的SDK driver lpspi 工程去发送同样的数据,是否能复现问题? 我现在有点怀疑是第16个字节的时候,被其他更高优先级的代码打断了,然后回来接着运行导致的。

  你这样, 把两个放大波形给我看看,然后再试下SDK里面裸机的代码,看看是否有问题。如果裸机没有问题,我们要一起看看freertos的配置情况了。

If you still have issues about it, please kindly let me know.

Wish it helps you!

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
1,399 Views
170026459
Contributor I

谢谢,用裸机的驱动测试确实没有打断的情况,RTOS可能是被中断了!

0 Kudos