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
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.
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?