based on s32k118, ide is s32ds, generate lin code by lin stack
it's slave node from my side, the following is the requirements I need to achieve, I need to get these errors by APIs, and send errors to LIN, but I don't know how to get these errors or which API used by Lin stack, Could someone help me? thanks very much!
I don't get it... You want to change the stack code, don't you?
now I want to call l_bool_wr_LI0_SWSL_responseError(1) when LINCurrentState->currentEventId is SYNC_ERROR,FRAME_ERROR CHECKSUM_ERROR IDENTIFIER_PARITY or BIT_ERROR occure.
Why do you want to implement like this? Because set the reponse_error bit to 1 is already handled in the stack code, so it's like re-inventing the wheel when doing like this
Best Regards,
Nam
Show you our LIN ldf config
As your mean,we dont not modify the code.If there are some error
The SWSL_responseError shall be 1.So how to create the error to make SWSL_responseError value as 1
Hello @liuxing_hu,
SWSL_responseError will be 1 if there is an error in the bus. So like my previous comment, you have to inject a fault in the bus if you want to verify the SWSL_responseError bit, and you need a test device, e.g. Vector CANOE or NI LIN interface... Our LIN stack does NOTHING with fault injection/ bus disturbance.
Please, make sure what is your target and carefully read what our team has suggested...
Best Regards,
Nam
Hello @namnguyenviet
Thanks very much for your reply, I 'm not sure whether it is SWSL_responseError in my case when you say response error, so I confirm with you one more, now I understand what you means.
1. we have Vector CANOE, do you know how to verify SWSL_responseError using this tool, we never do that.
2. when set SWSL_responseError, I don't see the BIT-ERROR, INCONSISTENT-SYNC-FIELD-ERROR and IDENTIFIER-PARITY-ERROR, does lin stack driver support these 3 errors?
Hello @liuxing_hu,
1. You can write a script then import to the Vector CANOE. You can refer to the Vector CANOE helper. Below is one of the syntax to create a bit inversed (as a result a bit error will be occurred):
Please ask VECTOR for further support.
2. INCONSISTENT-SYNC-FIELD-ERROR and IDENTIFIER-PARITY-ERROR are not reported by the stack, the frame is just ignored according to the LIN specification:
BIT-ERROR is supported.
Best Regards,
Nam
Hello @liuxing_hu,
According to our LIN Stack developer, here is some information about handling the response error signal as below:
You can refer to chapter 2.7 of LIN_Specification_Package_2.2A.pdf to more detail.
One example about the response error signal is handled on bus:
Best Regards,
Nam
Helllo @namnguyenviet
Thanks very much for your reply!
I don't really understand how the lin stack set respond error
Each slave node shall publish a one bit scalar signal, named response_error, to the master node in one of its transmitted unconditional frames.
I have 2 slave node, named SWSL and SWSR, in each slave node, the corresponding respond_err named SWSL_responseError and SWSR_responseError, is it ok? or the name must be response_error?
The response_error signal is set by linstack 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.
how does linkstack set response_error signal? does it need config previously ?
The response_error signal shall be cleared when the unconditional frame containing the response_error signal is successfully transmitted.
how and who clear the error signal?
i can see the respond error here, but I can't see the error status API by generate code, does anything wrong to my configuration?
Hello @liuxing_hu
I have 2 slave node, named SWSL and SWSR, in each slave node, the corresponding respond_err named SWSL_responseError and SWSR_responseError, is it ok? or the name must be response_error?
[NXP] It is ok.
how does linkstack set response_error signal? does it need config previously ?
[NXP] The response_error signal has been defined in the .ldf file. The configuration tool(S32DS) will base on it to generate the configuration file as follows.
Whenever a frame that is transmitted or received by the slave node contains an error in the frame response the linstack(not user) will call to lin_update_err_signal() function to set.
how and who clear the error signal?
[NXP] Normally, the response_error signal shall be cleared by linstack(not user)when the unconditional frame containing the response_error signal is successfully transmitted.
However, the user can also use the definitions in the config file to set/reset the response_error signal as follows
i can see the respond error here, but I can't see the error status API by generate code, does anything wrong to my configuration?
[NXP] If you don’t have any error in your .ldf file, the generated configuration files will contain the same that I showed above.
Best Regards,
Nam
our configuration tool(S32DS) not generates the configuration file as follows.
we have and use this as follow
we want to know how to use this to set/reset the response_error signal.
Hello @liuxing_hu,
I'm afraid that you're having a misunderstanding. The reponse_error signal is handled internally by our LIN stack driver, and there is NO API to set/clear the reponse_error signal: The mechanism to set/clear the response_error signal is also handled internally and is explained in previous comment. In fact, we can "force" the stack to set the reponse_error bit each time the slave send the response, as below:
However, we don't recommend to do that, since it would break the whole stack: an response_error bit would be set even when there was no error, which is an abnormal behavior.
I have read again your question, and looks like you're asking for some functions which inject the fault into the bus, e.g. inject a bit error or a frame error,... Then unfortunately, our LIN stack doesn't provide any fault injection API. (The reponse_error bit only indicates whenever a fault was ALREADY occurred in the bus). You can use a test device (VECTOR Canoe, or NI LIN Interface,...) which support fault injection/bus disturbance.
Best Regards,
Nam
How to set response error signal to 1 by using CANoe to create checksum error , frame error and so on.
Hello @liuxing_hu,
We don't provide the CANoe tool, so we couldn't help you with this question. Please ask Vector to support this.
Best Regards,
Nam
Hello ,
We want to do for the ECC .How to do ECC config for RAMT ,Flash memory and so on.
Hello,
Please create a new thread with such a new question.
Best Regards,
Nam
Retell my question, now I want to call l_bool_wr_LI0_SWSL_responseError(1) when LINCurrentState->currentEventId is SYNC_ERROR,FRAME_ERROR CHECKSUM_ERROR IDENTIFIER_PARITY or BIT_ERROR occure.
plan A:
We call this function l_bool_wr_LI0_SWSL_responseError(1)
Plan B:
We want to write new function about get current Event ID in Lin_Ipuart_driver.c called by APPL Level.Like this
Another question,we have not found IDENTIFIER_PARITY_ERROR or BIT_ERROR,how to genarete the error or where to find the error