S32K144 LPSPI communication error

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

S32K144 LPSPI communication error

2,549 次查看
lijz821
Contributor I

when I use S32K144 LPSPI module to setup communication in S32DS environment,there is some issues as the following.

1.if LPSPI_DRV_MasterTransfer(instance,sendBuffer,receiveBuffer,transferByteCount); there is no receive data in RDR.

2. if LPSPI_DRV_MasterTransferBlocking(instance,sendBuffer,receiveBuffer,transferByteCount,100);after several frames, it is pended in OSif_wait().

function as:

 LPSPI_DRV_MasterInit(LPSPICOM1,&lpspiCom1State,&lpspiCom1_MasterConfig0);

status_t error = STATUS_ERROR;
uint16_t remaincnt=0;
uint8 txdatabuf[5]={0x55,0x55,0x55,0x55,0x55};
uint8 rxdatabuf[5]={0x00};
txdatabuf[0].=IMU_READ_SID0;
txdatabuf[1].Imufrm_U32=IMU_READ_SID1;
if(LPSPI_DRV_MasterGetTransferStatus(LPSPICOM1,&remaincnt)==STATUS_SUCCESS)
{
 //error=LPSPI_DRV_MasterTransfer(LPSPICOM1,txdatabuf,rxdatabuf,transferByteCount);
 error=LPSPI_DRV_MasterTransferBlocking(LPSPICOM1,txdatabuf,rxdatabuf,transferByteCount,5);
}

project configuration as below:

lpspiconfig.pnglpspiconfig2.png

标签 (1)
标记 (1)
0 项奖励
回复
2 回复数

2,188 次查看
razva_tilimpea
NXP Employee
NXP Employee

Hi,

Based on the details provided in your post I see just one issue: data is stored as uint8_t, but your frame size is 32.

Can you share here the project to reproduce the same setup as on your side?

Razvan

0 项奖励
回复

1,928 次查看
KARTHKSARODE
Contributor III

Hi @razva_tilimpea 

I'm using frame size of 16 bits , data is stored as uint8_t (Given array )

please try to answer the query posted here (https://community.nxp.com/t5/S32K/Implementing-Non-SDK-example-in-SDK-LPSPI-S32K144-Project-LPSPI/m-...)

 

Best Regards
KARTHIK SV
0 项奖励
回复