Lpspi_Half_Duplex example code for S32K344/358

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

Lpspi_Half_Duplex example code for S32K344/358

18,869 Views
abdul_rahman
Contributor IV

Hi team,

I'm very new to this controller and I need help in seeing the RxSlaveBuffer data in the Lpspi_Half_Duplex example code given in the IDE. The screenshots of the issues I'm facing are shown below,

abdul_rahman_0-1727330044246.jpeg

The RxSlaveBuffer array isn't receiving data from TxMasterBuffer but it is showing the exact hex, dec, bin values of the master.

abdul_rahman_1-1727330130162.png

I'm not understanding the errors in the Expressions tab of Debug mode. 

It would be really helpful in helping me with detailed explanation of the problems and solutions needed. 

S32DS-S32PLATFORM S32K344-WB #S32K358 #Lpspi_HalfDuplex

0 Kudos
Reply
25 Replies

16,996 Views
abdul_rahman
Contributor IV

Hi @Julián_AragónM 

Can you help me in this also? The entire problem I've explained in the whole query thread. Let me know if you need anything more to understand the problem.

0 Kudos
Reply

16,985 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @abdul_rahman,

As my colleague @VaneB has shared in the previous replies, it seems this is a hardware issue related to your board, since we are unable to reproduce it. That specific header or pin may be damaged. It is very difficult to pinpoint a hardware issue through this support channel, so it may be best to contact your distributor or salesperson.

Unfortunately, the only general guidelines I can give you is to follow the Getting Started with the S32K3X4EVB-T172 Evaluation Board and check all the configured jumpers and to confirm if the correct supply voltage and current is being used. You may also try and configure another board or MCU to discard a faulty product.

If possible, it would be helpful to provide a picture where you show the full connections between the pins, so we can discard the connections as a probable cause.

Also, it seems that the S32K3X4EVB-T172-HW-UM is indeed wrong. J10 is not the VDD_HV_A jumper for the S32K344, it is jumper J427:

Julin_AragnM_0-1728510654175.png

I apologize for the inconveniences. 

Best regards,
Julián

 

0 Kudos
Reply

17,608 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @abdul_rahman 

Which version of RTD are you using? Did you make any changes to the example code? Are you using a custom board or an EVB?

 

BR, VaneB

0 Kudos
Reply

17,595 Views
abdul_rahman
Contributor IV

Hi @VaneB 

Which version of RTD are you using? Version 4

Did you make any changes to the example code? No

Are you using a custom board or an EVB? I'm running the code in evaluation board S32K3X4EVB

Can we personal chat on this?

0 Kudos
Reply

17,578 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @abdul_rahman 

What is the maskset of the MCU? 0P55A pre-prodution or  1P55A production. There seems to be an issue with the PTB3 0P55A 172HDQFP pin.

0 Kudos
Reply

17,574 Views
abdul_rahman
Contributor IV

Hi @VaneB 

How do I see this maskset in the S32DS IDE? What does a maskset mean? Why is it important in pin configuration?

0 Kudos
Reply

17,571 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @abdul_rahman 

The mask set is identified by a 5-character code consisting of a version number, a letter, two numerical digits, and a letter. This is printed in the MCU.

0 Kudos
Reply

17,488 Views
abdul_rahman
Contributor IV

Hi @VaneB 

Please reply to this. I really need your help as no one around me knows about the controller, let alone operating it!!

P.S.- The master clock (PTB29) and CS (PTB25) pins are showing a continuous pulse of 3.3V when seen on the oscilloscope. Why is the clock pin not working?

0 Kudos
Reply

17,472 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @abdul_rahman 

I have tested the example code from my side and it works as expected, make sure you have connected the master and slave pins as mentioned in the description.txt file.

0 Kudos
Reply

17,465 Views
abdul_rahman
Contributor IV

Hi @VaneB 

I have connected the pins according to the description.txt file as well as from the pins tool. What else could be the problem?? Is it because I'm observing the RxSlave array when I "suspend" the program??

I'm also observing constant DC voltage of 3.3V in the Master's CLK and CS pins. What could this mean??

0 Kudos
Reply

17,450 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @abdul_rahman 

Could you clarify where in the code you "suspend" the program?

0 Kudos
Reply

17,379 Views
abdul_rahman
Contributor IV

Hi @VaneB 

Have you looked into the screen recording video? What could be the issue during debugging the code?

0 Kudos
Reply

17,359 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @abdul_rahman 

I do not see any issues while debugging, but as you mentioned, it seems that the slave is not receiving the information from the master. Please use a breakpoint at Exit_Example(Passed) to not let the program terminate and check the buffers. Also, could you share a picture of the three LPSPI signals? Lastly, make sure you have the jumper set correctly.

0 Kudos
Reply

17,337 Views
abdul_rahman
Contributor IV

Hi @VaneB 

"Please use a breakpoint at Exit_Example(Passed) to not let the program terminate and check the buffers.": I have attached a video in a .zip file to show how I've run the program. The master data is still not seen in the slave buffer as shown in the video. What could be the problem now?

"Also, could you share a picture of the three LPSPI signals?": The CLK, CS and data pins are showing the same 3.3 V as shown in the below picture. 

abdul_rahman_0-1727945658481.jpeg

 

0 Kudos
Reply

17,321 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @abdul_rahman 

Sorry for the inconvenience, as I have not been able to reproduce your problem, I would like to confirm one thing.

PTB3 has output to two ARDUINO headers, J38.18 (DNP) and J37.14, did you connect a jumper from PTE0 (J37.9) to J37.14 or J38.18?

0 Kudos
Reply

17,317 Views
abdul_rahman
Contributor IV

Hi @VaneB 

I am aware that PTB3 has 2 arduino ports. I've tried connecting both ports. But none of them give the SPI data.

Tags (3)
0 Kudos
Reply

17,309 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @abdul_rahman 

Could you create a simple example code where you configure all the pins used for the Lpspi_Half_Duplex example as GPIO and toggle their state from high to low? I want to check if there is any issue in the functionality of any of the pins that does not allow the example to work correctly.

0 Kudos
Reply

17,245 Views
abdul_rahman
Contributor IV

Hi @VaneB 

I made a new code toggling the gpio pins, which I have attached below. The waveforms of the all the pins used in the Lpspi_Half_Duplex code are also attached below. PTB3 pin was showing 0V in the scope. Please look into the other pin results and let me know what could be the problem.

0 Kudos
Reply

17,238 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @abdul_rahman 

I have run the code shared above and all signals change from high to low as expected.

VaneB_0-1728063656590.png

Since it is not a software issue, please check your hardware like connections or if you see anything strange on your board.

0 Kudos
Reply

17,092 Views
abdul_rahman
Contributor IV

Hi @VaneB 

As per the user manual of the S32K3X4EVB-T172 evaluation board, the J10 jumper is said as,abdul_rahman_0-1728208778149.png

But my evaluation board doesn't have the J10 jumper as shown in the below picture,

abdul_rahman_1-1728208833498.png

Is this strange according to you? I have operated the board throughout without this J10 jumper and I didn't face any problem. 

0 Kudos
Reply