Example code for sending and receiving LIN diagnostic message?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Example code for sending and receiving LIN diagnostic message?

3,071 次查看
pankajprasad100
Contributor III

Hi,

I am working on a project in which i need to send and receive LIN diagnostics message using apis.

I need an example code for the diagnostic communication.

 

location:

      SDK>middleware>lin>transport>lin_commontl_api.c

 

Diagnostic request ID-3C

For example i need to send 

7E 02 10 03 00 00 00 00

Diagnostic Response ID-3D

 35 02 50 03 00 00 00 00

 

MCU-S32K116

Complier-IAR

 

 

Thanks & Regards

Pankaj prasad

 

 

 

0 项奖励
回复
5 回复数

3,052 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

are you asking for master or slave demo code?
What is the driver (SDK, RTD) version you are using?

BR, Petr

0 项奖励
回复

3,043 次查看
pankajprasad100
Contributor III

Hi, 

 

I need master code for sending and receiving message. 

Driver-SDK 3.0 version

 

Thanks & Regards

Pankaj prasad

0 项奖励
回复

3,023 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

see response I got from SW team...

Base on the information which our customer provided, I have some question as below:

  • Diagnostic request ID-3C

For example i need to send

7E 02 10 03 00 00 00 00

[Diep] For my understand, the diagnostic request (3C) is sent with length = 0x02. So, the unused data should be 0xFF instead of 0x00.

  • Diagnostic Response ID-3D

35 02 50 03 00 00 00 00

[Diep] Because diagnostic request is sent with NAD = 0x7E(Functional NAD), the master node should not send diagnostic response header after that. Slave node only receive functional request and do not transmit the response. You can see image below or chapter 5.4, 5.5 of LIN_Specification_Package_2.2A to more detail.

PetrS_0-1633692854856.jpeg

Please help me to confirm with our customer.

BR, Petr

0 项奖励
回复

2,794 次查看
pankajprasad100
Contributor III

Hi,

Apologies for the late reply

Question-1

Base on the information which our customer provided, I have some question as below:

  • Diagnostic request ID-3C

For example i need to send

7E 02 10 03 00 00 00 00

[Diep] For my understand, the diagnostic request (3C) is sent with length = 0x02. So, the unused data should be 0xFF instead of 0x00.

Ans- Yes unused data will be 0XFF.

 

Question-2

  • Diagnostic Response ID-3D

35 02 50 03 00 00 00 00

[Diep] Because diagnostic request is sent with NAD = 0x7E(Functional NAD), the master node should not send diagnostic response header after that. Slave node only receive functional request and do not transmit the response. You can see image below or chapter 5.4, 5.5 of LIN_Specification_Package_2.2A to more detail.

Ans:- Usually in diagnostics we send the Master Req and also we send the diagnostics response header from the master  where slave just update the buffer with the data.

pankajprasad100_0-1643709849859.png

For reference I need some code like this- Solved: S32K SDK LIN Stack not working properly with UDS - NXP Community

Above link is for slave but we need master.

 

Thanks & Regards

Pankaj prasad

标记 (2)
0 项奖励
回复

1,421 次查看
HanamantKaluti
Contributor I
Hi team we need a quick support for Lin diagnostic services like 3E 27

some sample code for implementation of the above mentioned services.
our device will be acting as a master.
Thanks in advance.
0 项奖励
回复