AnsweredAssumed Answered

S32K144 LPSPI communication error

Question asked by Li JOY on Mar 11, 2019
Latest reply on Mar 13, 2019 by Razvan-nicolae Tilimpea

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:

LPSPI config

Outcomes