S32K1 LIN stack - diagnostic slave response

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

S32K1 LIN stack - diagnostic slave response

770 Views
Francesco_Solito
Contributor II

Good morning

I'm making a slave device and I'm using LIN stack.

How can I check that a slave response has been phisically sent on LIN bus?

For instance, when I receive a reset diagnostic frame (11 01), I parse it with ld_receive_message() and I prepare the response with ld_send_message(); then I have to really reset the microprocessor, but only after I'm sure that the slave response was really sent on bus. How can I check that the response was sent on bus? ld_send_message() only prepares the response, but this does not mean that it was phisically sent on bus.

As regards normal frames (not diagnostic), what is the way to ensure the same thing? (I mean, be sure that the response to a frame was really sent on bus).

Thank you in advance and kind regards,

Francesco Solito

0 Kudos
Reply
2 Replies

720 Views
DanNguyenDuy
NXP Employee
NXP Employee

Hi @Francesco_Solito,

For instance, when I receive a reset diagnostic frame (11 01), I parse it with ld_receive_message() and I prepare the response with ld_send_message(); then I havesss to really reset the microprocessor, but only after I'm sure that the slave response was really sent on bus. How can I check that the response was sent on bus? ld_send_message() only prepares the response, but this does not mean that it was phisically sent on bus.
=> As far as I know, you can use ld_raw_tx_status() function to check the status of tx_queue.
tx_queue will be updated with data after you call ld_send_message() and will be cleaned after it is transmitted.
Please refer the chapter 7.4.3.3 of LIN_Specification_Package_2.2A.pdf to more detail.
      nxf78987_0-1688653316065.png

 

 
As regards normal frames (not diagnostic), what is the way to ensure the same thing? (I mean, be sure that the response to a frame was really sent on bus).
=> For Unconditional frame, you can use l_flg_tst() to check status. The flag will be set when the frame is successfully transmitted from the node.
Please refer the chapter 7.2.3 of LIN_Specification_Package_2.2A.pdf to more detail
      nxf78987_1-1688653316067.png

 

      nxf78987_2-1688653316068.png

Best regards,

Dan

0 Kudos
Reply

687 Views
Francesco_Solito
Contributor II

Thank you very much. I'll try both suggestiones.

Kind regards,

Francesco