Dear Sir:
I have a project ,the master node send 0x01 to inquire my node(slave node)button state,so I will response the button state signal and Linerr signal like this:
0 0 0 0 0 0 0 0(bits in byte0)
| |
| |
I I ----------------Linerr bit set when PID parity err&checksum err up to 20 times
|------------------------------if button pressed this bit is 1 else is 0
I set up two signals in unconditional frames: sw_signal and Linerr_signal. but I dont know how to configurate response err signal, the linerr signal is just the response err signal?
could you send me a example project or tell me what should i do?
thanks!
Hi Jack,
Unfortunately, I am not sure with your question.
If I understood correctly, you want to signalize error to master when slave detects more than 20 times PID parity err or checksum err. Right?
If you want to set Linerr bit when PID parity err&checksum err up to 20 times, you can configure Linerr signal like a normal signal and put that signal into the frame together with button state signal.
In that case, you might edit lin_handle_error() function in lin_common_proto.c file and add there some command for increasing some user err counter (global variable, for case LIN_LLD_PID_ERR and case LIN_LLD_CHECKSUM_ERR).
When the global counter is counted to 20 times, you can use "static access macros for signal" in file lin_cfg.h to set or clear the signal.
The user err counter might be erased on periodical time base (e.g some timer) or decreased by successfully received LIN frames (like on CAN – increased by 8, decreased by 1).
Please notice that if users configure the linerr signal as the response error signal in ldf file in Node_attributes section [Please see some ldf file in example folder for an example], the behavior of this signal is described as in section 2.7.3 of LIN_Specification_Package_2.2A.pdf and it has already been implemented in LIN stack.
-The response_error signal shall be set whenever a frame (except for event triggered frame responses) that is transmitted or received by the slave node contains an error in the frame response.
-The response_error signal shall be cleared when the unconditional frame containing the response_error signal is successfully transmitted.
So if users configure Linerr signal to be set only for the case when slave detects more than 20 times PID parity err or checksum err, it might be not conformant with LIN Specifications.
I hope it helps you.
Have a great day,
Radek
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------