S32K344 CAN Trans Error

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

S32K344 CAN Trans Error

Jump to solution
1,831 Views
RegulusCheng
Contributor III

Hi, NXP friends

I am working with S32K3X4EVB-Q172(Part of MCSPTE1AK344), using simulink in matlab 2021b.

I have problem trying CAN trans Demo of MBDT:

I use CAN FD transmit EBT example, the board's CAN0H/CAN0L is connected to an USB-CAN device. After build and download, the RED_LED lights up, which shows there is an can error.

I have set the board config to S32K344-172,and other demos like Dio is working right. I wonder if the TJA1153_init is not set correctly. I am sure the EN/STB/ERRN pins are right, but I am not sure what should be write into the canExdHwId.  I have tried 6 (default value), and 4(Interrupt/CanObjectId - 4 ), 3 (Polling/CanObjectId - 3 ) accoring to this thread:how to use MBDT to initialize the TJA1153 CAN on ... - NXP Community  ,but still not work.

Considering the reply speed,  I ask this question in case someone know the reason and can give me some suggestion. Tomorrow I will try to get error Info through the FreeMaster (Sometimes the  Software just can not open, and may need rebot the computer)

Hope someone can give me some suggestions, thanks!

RegulusCheng_0-1705407631057.pngRegulusCheng_1-1705407663502.png

RegulusCheng_2-1705407696285.png

 

 

Regulus Cheng

0 Kudos
Reply
1 Solution
1,813 Views
RegulusCheng
Contributor III

After one-day rest, the problem solved ifself: the bule LED blinks and I can receive the message board sent.

It's wired because I didn't change anything today, just power up the board and then receive the message correctly (I tried to shut down and power up the board yesterday, too). 

It shows that my configuration yesterday is right: the canExdHwId should be set to 3, whitch is the "Polling/CanObjectId - 3" in configuration file. But I don't know why should be this because I chose "CanHardwareObject_Can0_Tx_Interrupt" in CAN write model, not "CanHardwareObject_Can0_Tx_Polling". Why canExdHwId should be 3, not 4 (Interrupt/CanObjectId - 4)?

 

View solution in original post

0 Kudos
Reply
8 Replies
1,814 Views
RegulusCheng
Contributor III

After one-day rest, the problem solved ifself: the bule LED blinks and I can receive the message board sent.

It's wired because I didn't change anything today, just power up the board and then receive the message correctly (I tried to shut down and power up the board yesterday, too). 

It shows that my configuration yesterday is right: the canExdHwId should be set to 3, whitch is the "Polling/CanObjectId - 3" in configuration file. But I don't know why should be this because I chose "CanHardwareObject_Can0_Tx_Interrupt" in CAN write model, not "CanHardwareObject_Can0_Tx_Polling". Why canExdHwId should be 3, not 4 (Interrupt/CanObjectId - 4)?

 

0 Kudos
Reply
1,799 Views
robertv
NXP Employee
NXP Employee

Hello @RegulusCheng ,

The TJA_1153 requires a complete disconnection from power supply and reconnection and it definitely seems unusual that it did not work the first time you tried it. I must mention that a reset using the button on the board is not enough to get the TJA_1153 to switch to the normal operating mode.   

To answer the second question, the mechanism of sending CAN messages is based on interruptions, thus the hardware object chosen for the Can_Write block is the one that is enabled for interrupts.

As for the other hardware object, it is used to communicate with the TJA_1153 transceiver with the purpose of selecting the operating mode. 

Regards,
Robert V

0 Kudos
Reply
1,105 Views
RegulusCheng
Contributor III

Hi Robert, @robertv 

I met this problem again with my second S32K3X4EVB-T172, the red LED is on, which shows that there is an error in Initialization. Unfortunately, this time it didn't solve itself after 2 days of power off.

I noticed the can phy on this board is TJA1443, but the function I used is TJA1153_Init, is this universal? I didn't remember what phy was on my last board.

hope for getting your reply, 

 

Thanks,

Regulus

0 Kudos
Reply
1,071 Views
robertv
NXP Employee
NXP Employee

Hello @RegulusCheng ,

The TJA1443 does not use the same initialization sequence as the TJA1153. In fact, it has a simpler initialization process. It requires setting the STB and EN pins of the CAN instance you are going to use to High.

You can use the Dio block, and the WriteChannel function to set the STB and EN pins to High and that should take care of the initialization. 

Could you try this and let me know if it fixed your issue?

Regards,
Robert V

0 Kudos
Reply
992 Views
RegulusCheng
Contributor III

Hi Robert,

Thanks for replying!

Yes, it works well. After reading the document about TJA1443, I tried to give high outputs on these two pins using the Dio module and the transmitter can work now. 

But I can not remember why this initialization function can work on my last S32K3X4EVB-T172, part of the Motor Control suite. Does the old version of this board use TJA1153?

 

Regulus.

0 Kudos
Reply
978 Views
robertv
NXP Employee
NXP Employee

Hello @RegulusCheng ,

Glad it worked.

You might be right in your assumption that the new version may have a different transceiver.
I asked a colleague about this and they confirmed that they found two S32K3X4EVB-T172 boards from different revisions, that had different transceivers. 

From what I understood, the SCH-53148 Rev B had the TJA1153 transceiver, while the SCH-53148 Rev B1 has the TJA1443.

Regards,
Robert V

0 Kudos
Reply
950 Views
RegulusCheng
Contributor III

Thanks, this information helps a lot.

0 Kudos
Reply
1,784 Views
RegulusCheng
Contributor III

Hi, Robert V

Thanks for your explanation, it is very useful for me to understand the mechanism! I

have another problem using FreeMaster. I will try to solve it today, and if I fail, I may ask for your help tonight in another thread

Regards, 

Regulus

0 Kudos
Reply