S32K144 LPSPI communication error

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

S32K144 LPSPI communication error

1,328 Views
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

Labels (1)
Tags (1)
0 Kudos
2 Replies

967 Views
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 Kudos

707 Views
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 Kudos