LPSPI0 communication between S32K144 and S32K142 not working

cancel
Showing results for 
Search instead for 
Did you mean: 

LPSPI0 communication between S32K144 and S32K142 not working

265 Views
akshaykul89
Contributor III

Hello,

I am working with 2 EVBs, S32K144 as a SPI master and S32K142 as SPI slave. LPSPI0 is selected. Pins are properly connected. Both Tx and Rx buffers are configured (not NULL). PCS0 <--> PCS0 both configured as Input and output, CLOCK<---> CLOCK both conf. as Input and Output, MISO->MOSI and MOSI->MISO.

(Intention is behind PCS0 and clock as Input and output is I want to work Viceversa in next iteration by changing roles.)
My test scenario is as below:
1. S32K144 as a Master and S32K142 as a Slave on LPSPI0.
2. I am sending an instance of a structure from S32K144 to S32K142. 
[I loop MasterBlocking on S32K144 for array of 10 instances]
Observation is,
Slave reception IRQ is called only on first reception on S32K142 and it returns with Transmit buffer underrun error. On master side I get Success and Garbage data is received on master.
On next iterations on Master, it keeps on returning success with reception of garbage data from Slave. 
Slave[S32K142] do not get any callback second time onwards.
Can someone please help me on this. 
Thank you.

Regards,
Akshay K.

2 Replies

151 Views
razva_tilimpea
NXP Employee
NXP Employee

Hi,

What is the speed used by your spi communication? If it is to fast slave doesn't have enough time to put data in TX buffer.

Razvan

151 Views
akshaykul89
Contributor III

Hello Razvan,

Apologies for delayed response. 

The problem is solved now. Actually , this was a sporadic behavior. Let's say , if I am passing an array of structures one after another then only few of them were receiving on the other side(meaning that, slave callback was getting called for few of the master transfer blocking calls and not for all)

Problem was MCU voltage jumper configured on both EVBs. for one of them it was 3.3v and another 5v. As a replication , I was able to properly transmit from once side to another but vice versa it was giving problem.When both were kept at 5v MCU voltage, it started working properly.

I really appreciate your reply though. Thank you. 

Regards,

Akshay K.

0 Kudos