How to detect LIN slave offline?

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

How to detect LIN slave offline?

521 次查看
ABOLUO
Contributor II

Basing on S32K144 LIN stack (S32DS for ARM2.2),  If there is on slave, how can the Lin Master detect the issue? 

标记 (1)
0 项奖励
回复
5 回复数

503 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

yes, as already provided here, to detect a LIN slave going offline in a LIN stack:
- Master checks for response after sending a header.
- If no response or error (e.g., checksum), a timeout counter increases/expires.
- After N missed responses, the slave is marked offline.
- Optionally, use diagnostic frames to ping the slave.

BR, Petr

0 项奖励
回复

481 次查看
ABOLUO
Contributor II

Is there same APIs to get the timeout flag? I try to use l_ifc_read_status, but 'error_in_response' flag not set when I power off the slave.

Thanks a lot.

 

标记 (1)
0 项奖励
回复

505 次查看
mary22evans
Contributor I

A LIN Master detects a missing slave primarily through response timeouts. When the master transmits a frame header and expects a response from a specific slave, it monitors for the slave's data within a defined timeframe. If no response is received before the timeout expires, the master concludes the slave is absent or non-functional. Additionally, checksum errors on received frames, though not directly indicating a missing slave, can signal communication issues. For a more definitive check, the master can utilize LIN diagnostic services (e.g., "Read by Identifier") to actively poll a slave; a lack of response CredibleBH to such a request further confirms its absence. The S32K144 LIN stack typically handles these timeout mechanisms, providing status flags or callbacks to the application.

0 项奖励
回复

307 次查看
ABOLUO
Contributor II

Thanks for your suggestion. It can be solved by diagnostic services, but I think it's better to use normal frame to solve it. Trace the function "lin_lld_timeout_service()", I found in the file "lin.c", line 567,  'Received part of data but not completed' can trigger 'LIN_LLD_NODATA_TIMEOUT' event, but 'no data received' can not trigger it, is this behavior expected? or it's the issue?

标记 (1)
0 项奖励
回复

292 次查看
ABOLUO
Contributor II

Now, I use the API 'l_ifc_read_status' to check the 'SUCCESSFULL_TRANSFER' of a special frame, I get the wanted result.

标记 (1)
0 项奖励
回复