Problem with reading LIN signals for s32k116 EVB board

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

Problem with reading LIN signals for s32k116 EVB board

Jump to solution
1,906 Views
santhosh23
Contributor III

I have master node which can send 2 signals with frame id 0x30. In my case, when I send a signal with frame id 0x30 as 0x01 0xff 0xff 0xff. any one of the gpio pin should be High(led should glow) or when the signal wih frame id 0x30 as 0x00 0xff 0xff 0xff is sent, the other gpio configured with led should go High.  I have configured all the lin stack and would like to read the lin signal messages sent from master node. The master node will send default signal 0xFF 0xFF 0xFF 0XFF. When I tried to read the first byte signal using 
data1= l_u8_rd_LI0_EVK_CTRL_Byte_1();  
I could see the signal value as 0XFF but it is not changing in slave node even if I changed from master node. I have attached lin ldf and main.c file below for your reference.
I referred qith the example lin_slave_s32k116 as shown below:

santhosh23_0-1721226664724.png

 

Is there anything i am missing out inorder to read the changed signals? Or Do I need to make some changes? 

Any suggestions or simple examples related to this are highly appreciated.

Thanks in advance!

Thanks & regards,
Santhosh

 

#lin #s32k 

0 Kudos
Reply
1 Solution
1,463 Views
santhosh23
Contributor III

Hello all,
I found a solution to my problem with the LIN protocol, and I hope this helps anyone who is working with it for the first time. The issue was with the UART configuration on my board. Initially it was set to the UART pins to PTC 6 and 7, but they should have been set to PTC 8 and 9. Once I corrected the pin configuration, everything started working as expected.

Thanks & regards,
Santhosh

View solution in original post

0 Kudos
Reply
16 Replies
1,864 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

if you receive frame with id 0x30 then based on your ldf you should rather check/clear NXP_EVK_Byte_1 flag, I think. 

/* Check if signal is updated */
if (l_flg_tst_LI0_NXP_EVK_Byte_1_flag())
{

         /* Clear this flag... */
         l_flg_clr_LI0_NXP_EVK_Byte_1_flag();
         /* Store selection data */
         data1= l_u8_rd_LI0_NXP_EVK_Byte_1();

.....

Also seems you are using some older SDK version, it can be recommended to have most recent one.

BR, Petr

0 Kudos
Reply
1,784 Views
santhosh23
Contributor III

Hello @PetrS ,
I've tried this approach and aslo made required hardware configuration, but no change in signal can be seen from s32k116 EVB. Here, the data1 will go to 0x00 as soon as erase flag line is executed and comes back to 0xFF again as default. I've also checked with my master node, it is sending signals as expected as shown below.

santhosh23_0-1721742303195.png

I've attached the document containing all necessary files like main.c and ldf file for your reference. Please let me know if I have missed something in order to read the data properly.
I will be looking forward for your response.

Thanks & regard,
Santhosh

0 Kudos
Reply
1,729 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

project is using some old SDK version, which I do not have installed, so hard to modify/build a code.
From main.c file it seems you are missing PORT_IRQHandler with portion to AutoBaudCapture calling. Try to add that as is used in demo project.

I tested SDK RTM 4.0.3 slave demo on S32K116 board and it works properly.

BR, Petr

0 Kudos
Reply
1,706 Views
santhosh23
Contributor III

Hello @PetrS ,
Thanks for your response!

As per your suggestion, I've tried with SDK RTM 4.0.3 slave demo on S32K116 board with S32 DS version 3.4 and it is not working as expected. I've also monitored the signals with the UART peripheral pins such as PTC 6 and 7 with logic analyzer and could not see any signals from it. Please find the all necessary project files attached with this message and let me know if I am missing something.
Thanks in advance!

Thanks & regards,
Santhosh

0 Kudos
Reply
1,696 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

I tried this project and it seems it is working normally, I used PLIN View and load ldf there to work as BABY_LIN master.

Slave (EVB board) is responding to master Status_EVK_Board_LIN frame and controls EVB LEDs based on data received in Control_EVK_Board_LIN frame, see attached video.

BR, Petr

 

 

0 Kudos
Reply
1,620 Views
santhosh23
Contributor III

Thanks @PetrS fro your response!

If this is working fine with you, then I might be missing something from hardware configuration part. 
I did the following hardware configuration:
* Connected 12 V external supply and changed jumper J107 to 1-2(Default).
*Removed jumper J108 as it is in not in master mode.
*Connected lin bus line, Gnd and 12 V for lin communication peripherals for NXP EVB as shown in below image.

santhosh23_0-1722335901041.png

Please let me know if there is anything else I'm missing out.

Thanks & regards,
Santhosh

0 Kudos
Reply
1,612 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

yes, it looks correct.
I can recommend to check TDX, RXD lines with scope/analyzer to be sure LIN signal passes through transceiver. Be sure transceiver is active, check /SLP pin, for example on revA board this is not pulled up on PCB.

BR, Petr

0 Kudos
Reply
1,609 Views
santhosh23
Contributor III

Hello @PetrS !
You were right, I couldn't see any signals coming from TDX, RXD lines with analyzer. This means that transceiver is not active. Could you please explain me how to check SLP pin, for pulling it up on PCB?

Thanks & regards,
Santhosh

0 Kudos
Reply
1,602 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

check board schematic. You can measure test point TP521.
On revB board /SLP is pulled up and not connected to MCU, nothing to do

PetrS_0-1722341386072.png

On revA board is not pulled up and is connected to PTA7 which should be held high then

PetrS_1-1722341444419.png

BR, Petr

0 Kudos
Reply
1,578 Views
santhosh23
Contributor III

Hello @PetrS ,
I checked with pin PTA7 which is showing high(5V) on analyzer. But I am not sure why I cannot see any signals from PTC6 RXD or PTC7 TXD pins for transciever. 
If possible, could you please share the video clip of your EVB working or responding to the lin signals?

Thanks & regards,
Santhosh

0 Kudos
Reply
1,569 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

better to check SLP on transceiver, so TP521. 
TXD is output from MCU, so there will be signal just when slave (MCU) is sending its response.
RXD is input to MCU and if transceiver is active it follows LIN bus signal. So if transceiver is working you have to see same signal on RXD as it is on LIN.

I can do new capture, but do not have board, so next week at the earliest.

BR, Petr

1,562 Views
santhosh23
Contributor III

Thanks @PetrS for your quick response!
Please send it as earliest as possible. I will be looking forward for your response.

Thanks & regards,
Santhosh

0 Kudos
Reply
1,464 Views
santhosh23
Contributor III

Hello all,
I found a solution to my problem with the LIN protocol, and I hope this helps anyone who is working with it for the first time. The issue was with the UART configuration on my board. Initially it was set to the UART pins to PTC 6 and 7, but they should have been set to PTC 8 and 9. Once I corrected the pin configuration, everything started working as expected.

Thanks & regards,
Santhosh

0 Kudos
Reply
1,781 Views
santhosh23
Contributor III

Also, the other signals from master node is as shown below.

For 0x01:

santhosh23_0-1721742989318.png

For 0x00:

santhosh23_1-1721743016558.png

 

0 Kudos
Reply
1,856 Views
santhosh23
Contributor III

Thanks @PetrS for your response!
I tried with the both examples below . 
1. lin master
2. lin slave

santhosh23_0-1721392444542.png


I couldn't send any signals nor I recieve any. Is there any settings or configurations that has to be made with hardware such as setting jumpers properly or something else before trying this examples?
If yes, please let me know with detailed steps. Also, please provide me a simple example where s32k EVB can read lin signals which is sent from master node. 
I will be looking forward for your response.

Thanks & regards,
santhosh

0 Kudos
Reply
1,794 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

if you need to use LIN stack then you need to refer to SDK or RTD demo examples. SDK or RTD offers LIN driver demos as well. It would work normally. Boards have to be powered by 12V and master board must have MASTER jumper placed. You should be able to measure LIN frames on LIN line and TXD,RXD pins.
If you would like to have some slave baremetal code, maybe below one can be useful as well
 https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K116-LPUART-LIN-Slave-TXRX-ISR-S32DS-ARM...

BR, Petr 

0 Kudos
Reply