Response error for LIN communication

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Response error for LIN communication

9,378 Views
liuxing_hu
Contributor III

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!

liuxing_hu_0-1639992390958.png

liuxing_hu_1-1639992681314.png

liuxing_hu_2-1639992709410.png

 

 

15 Replies

9,264 Views
namnguyenviet
NXP Employee
NXP Employee

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

9,245 Views
liuxing_hu
Contributor III

Show you our LIN ldf config

liuxing_hu_0-1640659146710.pngliuxing_hu_1-1640659184775.png

As your mean,we dont not modify the code.If there are some error 

liuxing_hu_2-1640659588039.png

The SWSL_responseError shall be 1.So how to create the error to make SWSL_responseError  value as 1

0 Kudos

9,237 Views
namnguyenviet
NXP Employee
NXP Employee

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

0 Kudos

9,229 Views
liuxing_hu
Contributor III

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?

liuxing_hu_0-1640663103397.png

 

0 Kudos

9,210 Views
namnguyenviet
NXP Employee
NXP Employee

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):

canoe-script.png

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:

namnguyenviet_0-1640678115913.png

BIT-ERROR is supported.

Best Regards,

Nam

 

0 Kudos

9,341 Views
namnguyenviet
NXP Employee
NXP Employee

Hello @liuxing_hu,

According to our LIN Stack developer, here is some information about handling the response error signal as below: 

  • Each slave node shall publish a one bit scalar signal, named response_error, to the master node in one of its transmitted unconditional frames.
  • 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.
  • The response_error signal shall be cleared when the unconditional frame containing the response_error signal is successfully transmitted.

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:

namnguyenviet_0-1640330019970.jpeg

Best Regards,

Nam

0 Kudos

9,334 Views
liuxing_hu
Contributor III

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?

 

liuxing_hu_0-1640338386231.png

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?

0 Kudos

9,322 Views
namnguyenviet
NXP Employee
NXP Employee

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.

namnguyenviet_0-1640343225746.png

 

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

namnguyenviet_1-1640343225781.png

 

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

0 Kudos

9,295 Views
liuxing_hu
Contributor III

our  configuration tool(S32DS) not generates the configuration file as follows.

liuxing_hu_0-1640585228865.png

we have and use this as follow

liuxing_hu_1-1640585251765.png

we want to know how to use this to set/reset the  response_error signal.

0 Kudos

9,282 Views
namnguyenviet
NXP Employee
NXP Employee

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:

namnguyenviet_0-1640588139231.png

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

0 Kudos

9,133 Views
liuxing_hu
Contributor III

How to set response error signal to 1 by using CANoe  to create checksum error , frame error and so on.

0 Kudos

9,128 Views
namnguyenviet
NXP Employee
NXP Employee

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

0 Kudos

9,059 Views
liuxing_hu
Contributor III

Hello ,

         We want to do for the ECC .How to do ECC config for RAMT ,Flash memory and so on.

0 Kudos

9,051 Views
namnguyenviet
NXP Employee
NXP Employee

Hello,

Please create a new thread with such a new question.

Best Regards,

Nam

0 Kudos

9,270 Views
liuxing_hu
Contributor III

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)

 

liuxing_hu_1-1640603403295.png

Plan B:

We want to write new function about get current Event ID in Lin_Ipuart_driver.c called by  APPL Level.Like this

liuxing_hu_2-1640603821730.png

Another question,we have not found IDENTIFIER_PARITY_ERROR or BIT_ERROR,how to genarete the error or where to find the error

0 Kudos