LIN Receive Frames lost

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

LIN Receive Frames lost

跳至解决方案
1,711 次查看
DirkG
Contributor III

Dear all,

i'm using the S32K3X4EVB-T172 Evaluation Board (S32K344) and the LINSTACK for S32K3 version 2.0.5.

My setup is as follows.

The MCU (S32K344) acts as a LIN Master. Inside ldf file three frames are declared (0x27, 0x28, 0x29), each frame hast the same structure ( getting values from temperaturre sensors)

This works fine, please see following screenshot (right now no slave is responding to the frames)

DirkG_0-1739795525144.png

As soon as the slaves are responding to the Frames, i see a strange behaviour.

If only one slave is active (doesn't matter which one), everything is fine. The data are refreshed periodically inside the MCU. I observe the g_lin_frame_data_buffer and also the application variables.

 

If slave1 and slave2 are active, slave1 is behaving fine, slave2 does not refresh data. Remember, running each slave alone does work fine.

 

if all three slaves are active, no slave does refresh data.

 

But, using an oscilloscope and decoding the frames with it, shows that the data on the physical LIN BUS seems to be fine.

DirkG_1-1739796163559.png

 

Can you please tell me what i'm doing wrong.

Your help is very appreciated.

 

Best Regards

Dirk

 

 

0 项奖励
回复
1 解答
1,554 次查看
DirkG
Contributor III

Dear Daniel,

 

i have found the issue.

l_sch_tick() was called periodically every 10ms ( time base is also 10ms within ldf file ).

But lin_dat_timeout_service() was also called every 10ms. After changing the periodicity of lin_dat_timeout_service() to 1ms, everything has been fine.

Now im able to receive all three frames fro the slaves.

Thanks a lot for your support !!!

Best Regards

Dirk 

在原帖中查看解决方案

6 回复数
1,680 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @DirkG,

Does the checksum match the data?

Can you compare the LIN signal when one sensor is active and when three sensors are active?

 

0 项奖励
回复
1,585 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @DirkG,

Thank you for all the information, but I will need to test it on my side.

Can you share the project here or privately via a support ticket?

 

Regards,

Daniel

 

0 项奖励
回复
1,555 次查看
DirkG
Contributor III

Dear Daniel,

 

i have found the issue.

l_sch_tick() was called periodically every 10ms ( time base is also 10ms within ldf file ).

But lin_dat_timeout_service() was also called every 10ms. After changing the periodicity of lin_dat_timeout_service() to 1ms, everything has been fine.

Now im able to receive all three frames fro the slaves.

Thanks a lot for your support !!!

Best Regards

Dirk 

1,669 次查看
DirkG
Contributor III

Hello Daniel,

 

thanks for your fast response.

I have checked the CRC data of all three farmes, it is correct.

See Oszi screenshot and results from "online LIN CRC calculator".

DirkG_0-1739898215599.png

DirkG_1-1739898233154.pngDirkG_2-1739898249468.pngDirkG_3-1739898272413.png

 

The Lin Signal looks also ok to me, here is a screenshot with onyl 0x27 active.

DirkG_4-1739898376040.png

 

and also a "zoom screenshot" to frame 0x27 only.

DirkG_5-1739898437887.png

The behaviour is still the same.

Best Regards

Dirk

 

 

 

0 项奖励
回复
1,657 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Dirk,

What about the status of the LIN master?

What does this function return?

l_ifc_read_status()

 

 

0 项奖励
回复
1,650 次查看
DirkG
Contributor III

Hello Daniel,

 

i just placed the function call, l_ifc_read_status(),  directly inside the "LinTick Task", the same task which calls: 

lin_dal_timeout_service();
l_sch_tick();
 
The return value is tracked.
The picture below gives back the tracked value.
 
Legend:
Yellow Marker --> 0x27 is enabled by restbus simulation
Green Marker --> 0x27 and 0x28 is enabled by restbus simulation
Blue Marker --> 0x27, 0x28 and 0x29 are enabled by restbus simulation (all slaves)
 
 
 

Screenshot 2025-02-19 151409.png

 

 

 

The value, returned by function l_ifc_read_status() is:

0x27 only active, yellow marker:

59152 (0b1110011100010000) for 40ms

43024 (0b1010100000010000) for 80 ms

 

0x27 and 0x28 are active, green marker:

59152 (0b1110011100010000) for 80ms

59664 (0b1110100100010000) for 40ms

 

0x27, 0x28 and 0x29 are active, blue marker:

59152 all the time.

 

Remember, my ldf is configured to send every 40ms a frame (0x27, 0x28, 0x29) and then repeat.

Best Regards

Dirk

 

 

 

 

 

 

 
 
0 项奖励
回复