S32k142 spi: LPSPI_DRV_MasterTransfer() problem

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

S32k142 spi: LPSPI_DRV_MasterTransfer() problem

Jump to solution
1,311 Views
nanjun
Contributor III

Hi,

The example lpspi_transfer_s32k142 works properly on the eval-board, where the slave transfers date to master by LPSPI_DRV_SlaveTransfer() and LPSPI_DRV_MasterTransferBlocking().

However, I exchanged the direction of data transfering and the master shall send the data to slave with the following lines:

masterDataSend = (uint8_t)adcRead;
LPSPI_DRV_MasterTransfer(SEND,&masterDataSend, &masterDataReceive, BUFFER_SIZE);
LPSPI_DRV_SlaveTransferBlocking(RECEIVE, &slaveDataSend, &slaveDataReceive, BUFFER_SIZE, TIMEOUT);
FTM_DRV_UpdatePwmChannel(INST_FLEXTIMER_PWM1, 0U, FTM_PWM_UPDATE_IN_DUTY_CYCLE, slaveDataReceive<<8, 0U, true);

where slaveDataReceive is always 0.

Is there anything shall be reconfigured as well to make it operate properly?

Attached is the entire project. Thank you!

Kind regards,

Nanjun

 

 

 

0 Kudos
Reply
1 Solution
1,299 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Nanjun,

This won't work, the SlaveTransfer must be ready before the Master starts the transfer.

danielmartynek_0-1635865837113.png

 

Regards,

Daniel

View solution in original post

0 Kudos
Reply
1 Reply
1,300 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Nanjun,

This won't work, the SlaveTransfer must be ready before the Master starts the transfer.

danielmartynek_0-1635865837113.png

 

Regards,

Daniel

0 Kudos
Reply