[CAN-FD] Vehicle Diagnostic Communication Part 97 [AUTOSAR 2]

[CAN-FD] Vehicle Diagnostic Communication Part 97 [AUTOSAR 2] 車両診断通信
[CAN-FD] Vehicle Diagnostic Communication Part 97 [AUTOSAR 2]

Click here for back issues.
https://www.simulationroom999.com/blog/diagnostic-communication-en-back-issue/

Introduction.

Explanation for the simulation of CAN-FD in AUTOSAR.
This article will modify the configuration of AUTOSAR-CanTp and AUTOSAR-Dcm.

AUTOSAR-CanTp configuration for CAN-FD

The configuration for CanTp is as follows

const NSDU_INIB nsdu_inib_table[2] = {
	{
		0, /* channel number to belong to */
		CANTP_SEND, /* NSDU send/receive direction */
		1000, /* N_Ar/N_As timeout value */
		1000, /* N_Br/N_Bs timeout value */
		1000, /* N_Cr/N_Cs timeout value */
		CANTP_ON, /* Permission/prohibition of communication abort */
		CANTP_NORMALFIXED, /* Address format */
		CANTP_ON, /* Use Padding or not */
		CANTP_CANFD_PHYSICAL, /* N-SDU communication type */
		0, /* N_AE */
		0x10, /* N_SA */
		0xF1, /* N_TA */
		62, /* Maximum SDU data length (single frame) */
		65535, /* Maximum SDU data length (multi-frame) */
		62, /* SF maximum data length */
		62, /* FF Maximum Data Length */
		63, /* CF max data length */
		&nsdu_inib, /* NSDU initialization block by transmit/receive */
	}
	{
		1, /* Channel number to belong to */
		CANTP_RECEIVE, /* NSDU send/receive direction */
		1000, /* N_Ar/N_As timeout value */
		1000, /* N_Br/N_Bs timeout value */
		1000, /* N_Cr/N_Cs timeout value */
		CANTP_ON, /* Permission/prohibition of communication abort */
		CANTP_NORMALFIXED, /* Address format */
		CANTP_ON, /* Use Padding or not */
		CANTP_CANFD_PHYSICAL, /* N-SDU communication type */
		0, /* N_AE */
		0xF1, /* N_SA */
		0x10, /* N_TA */
		62, /* Maximum SDU data length (single frame) */
		65535, /* Maximum SDU data length (multi-frame) */
		62, /* SF maximum data length */
		62, /* FF Maximum Data Length */
		63, /* CF max data length */
		&rx_nsdu_inib, /* NSDU initialization block by transmit/receive */
	}
};

The N-SDU communication type has changed and each data length has been changed for CAN-FD.
This alone should support CAN-FD diagnostic communication.

The configuration of the CAN version of AUTOSAR-CanTp is explained as follows, so you may want to compare them.

Configuration of AUTOSAR-Dcm for CAN-FD

The configuration of AUTOSAR-Dcm is actually almost nothing to modify, only adjusting DCM_BUF_SIZE.

#define DCM_BUF_SIZE	4095
↓
#define DCM_BUF_SIZE	65535

Since the maximum message length has expanded with CAN-FD, the buffer size has also been expanded accordingly.
Actually, it is OK to expand the size up to 4 Gbytes, but I set 65535 bytes as the maximum value on the configuration side of CanTp, so I made the buffer size accordingly.

For DCM_BUF_SIZE of Dcm, you may refer to the article as follows.

Conclusion.

  • Fixed the configuration of AUTOSAR-CanTp for CAN-FD.
  • Fix configuration of AUTOSAR-Dcm for CAN-FD.

Click here for back issues.

コメント

タイトルとURLをコピーしました