S32K311_SPI_INIT_ISSUE

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

S32K311_SPI_INIT_ISSUE

1,230 Views
nirmal_masilamani
Contributor III

Hello,

I am trying use SPI 0 for communication purpose, but whenever i try to init SPI 0 channel, controller resetting itself continuously.

But SPI 1 and SPI 2 are working fine, without any issue.

Tags (1)
0 Kudos
Reply
11 Replies

1,214 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @nirmal_masilamani 

Are you using a custom board or the S32K31XEVB-Q100? Could you please share your configurations?

 

BR, VaneB

0 Kudos
Reply

1,191 Views
nirmal_masilamani
Contributor III

Hello @VaneB ,

Below images are my SPI 0 configuration.

I am using Custom board. 

Note: we have external SBC, which resetting our controller whenever i try to INIT SPI - 0. Issue is only with SPI 0.

nirmal_masilamani_0-1743418762295.png

nirmal_masilamani_1-1743418787365.png

 

Tags (1)
0 Kudos
Reply

1,174 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @nirmal_masilamani 

If possible, could you try changing the configured pins to ones that are not connected to the SBC and verify if the behavior changes? This is to determine whether the issue persists within the MCU or if it is caused by some interference with the SBC.

0 Kudos
Reply

1,079 Views
nirmal_masilamani
Contributor III

Hi @VaneB ,

After analyzing, SBC and Pressure sensor connected in LPSPI0.

SBC -> PTB5 (PCS0)

Pressure sensor - > PTA7 (PCS1).

Whenever I configure both CS pins, SBC resetting MCU continuously.

Is there any restriction to use both pin as SPI at same time? Because if i configure PTA7 as GPIO, there is no issue.

 

Tags (2)
0 Kudos
Reply

1,062 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @nirmal_masilamani,

There should be no restriction to both PCS. If you configure PTB5 as GPIO, does the issue happen as well? Also, if you try to configure PCS1 as another pin, does it keep resetting? 

Julin_AragnM_0-1744922901315.png

If you have an EVB available, it would be helpful to test your code in it to see if the issue persists. Just to discard a HW issue.

Best regards,
Julián

0 Kudos
Reply

1,024 Views
nirmal_masilamani
Contributor III

Hi @Julián_AragónM ,

No we don't have S32K311 eval board with us.

 

I tried 2 suggestions.

If i configure different pin as PCS1 ( PTC6 OR PTD5  ), no issue. Working fine. Issue is only with PTA7 pin as SPI 0 PCS1.

Even if i configure PTB5 pin as GPIO and PTA7 as SPI 0 PCS2, same issue. SBC resetting MCU.

0 Kudos
Reply

984 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @nirmal_masilamani 

I have tested the behavior of SPI instance 0 with PSC1 using PTA7 on an S32K31XEVB-Q100 from my side and have not been able to reproduce your issue. I am attaching a simple example code. Could you please test it on your side and let me know if you observe any changes in your device's behavior?

Please note that the example was developed using S32 Design Studio (S32DS) version 3.6 and Real-Time Drivers (RTD) version 5.0.0.

0 Kudos
Reply

924 Views
nirmal_masilamani
Contributor III

Hi @VaneB ,

Sorry for late reply, unfortunately unable to flash your code in my board using segger in DS 3.6.

So i tried to do the same configuration and everything and tested. Same issue, controller resetting continuously.

I have attached my code with this message.

Tags (1)
0 Kudos
Reply

910 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @nirmal_masilamani 

Your project configurations seem correct. I have one observation: according to the data you are transmitting, you need to change the SpiDataWidth parameter in ConfigTools from 1 to 8.

As I am unable to reproduce your issue, the most likely root cause might be related to hardware. Unfortunately, it is complex to determine the specific cause since you are working on a custom board, while I am working on an S32K31XEVB-Q100.

For hardware recommendations that might be useful, you can refer to the Hardware Design Guidelines for S32K3xx Microcontrollers and the S32K31XEVB-Q100 schematic.

0 Kudos
Reply

758 Views
nirmal_masilamani
Contributor III

Hi @VaneB ,

i have attached our schematic details for SBC and Pressure sensor.

Please let us know if there is some wrong connection in the schematic.

image_1.png

ps_circuit.png

sbc_circuit.png

   

Tags (1)
0 Kudos
Reply

729 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @nirmal_masilamani 

Regarding your request to review the schematic, I wanted to let you know that, unfortunately, I am not an FS23 expert. To ensure you get the best assistance, could you please create a new post or submit a support ticket for this review? Please note that submitting a support ticket might be the best option if your schematic contains confidential information.

As previously mentioned, the references I can provide are the Hardware Design Guidelines for S32K3xx Microcontrollers and the S32K31XEVB-Q100 schematic.

Thanks a lot for your understanding.

0 Kudos
Reply