Page 1 of 1

PCAN UDS and ISO-TP CAN ID Mapping

Posted: Mon 7. Sep 2015, 13:58
by tr.gt
Hey,

We are currently developing a tester using your APIs and we have some problems setting the correct mappings with the ISO-TP API.

Following setup:
Source (tester):
* CAN ID: 0x4F1
* UDS Address: 0x01 (not important for us, since we use the CAN IDs)

Target (ECU):
* CAN ID: 0x2F1
* UDS Address: 0x02 (not important for us, since we use the CAN IDs)

Mapping call:

Code: Select all

// Tester to ECU
TPCANTPStatus s = CANTP_AddMapping( ch, 0x2F1, 0x4F1,
                                          PCANTP_ID_CAN_11BIT,
                                          PCANTP_FORMAT_NORMAL,
                                          PCANTP_MESSAGE_DIAGNOSTIC,
                                          0x01, 0x02,
                                          PCANTP_ADDRESSING_PHYSICAL,
                                          remoteUds );
// ECU to Tester
s = CANTP_AddMapping( ch, 0x4F1, 0x2F1,
                            PCANTP_ID_CAN_11BIT,
                            PCANTP_FORMAT_NORMAL,
                            PCANTP_MESSAGE_DIAGNOSTIC,
                            0x02, 0x01,
                            PCANTP_ADDRESSING_PHYSICAL,
                            remoteUds );
Sending UDS request from the tester to the ECU works just fine. But the UDS API does not recognize the reponse from the ECU. BUT I can see response with PCAN-View!

Here some exmaple trace for the EcuReset service:

Code: Select all

;   Start time: 07.09.2015 11:35:03.360.0
;
;   Message Number
;   |         Time Offset (ms)
;   |         |        Type
;   |         |        |        ID (hex)
;   |         |        |        |     Data Length Code
;   |         |        |        |     |   Data Bytes (hex) ...
;   |         |        |        |     |   |
;---+--   ----+----  --+--  ----+---  +  -+ -- -- -- -- -- -- --
     1)      2442.7  Rx         02F1  8  02 11 01 00 00 00 00 00 
     2)      2468.1  Rx         04F1  8  03 7F 11 78 FF FF FF FF 
     3)      2524.4  Rx         04F1  8  02 51 01 FF FF FF FF FF 
What is the problem here? I hope you can help us.

Best Regards,
Tobias

P.S.: We are using the August release of the APIs.

Re: PCAN UDS and ISO-TP CAN ID Mapping

Posted: Mon 7. Sep 2015, 15:15
by F.Vergnaud
Hello Tobias,

Have you configured the "server address" of the UDS client ? Any messages that do not match the configured address are ignored.

By default the address is set to PUDS_SERVER_ADDR_TEST_EQUIPMENT (0xF1). In your case, received messages with the target address is 0x01 will be discarded. Here is how to setup the server address:

Code: Select all

	// Define Address
	WORD iBuffer = 0x01;
	TPCANTPStatus s = UDS_SetValue(ch, PUDS_PARAM_SERVER_ADDRESS, &iBuffer, 1);
Finally just a quick note about your variable "remoteUds": it should be zero as you are using format addressing: PCANTP_FORMAT_NORMAL. In this configuration the Remote Address is ignored when creating the CAN message, but when looking for mappings it is taken into account.
It is not the case in your test but if you forget to set the same remote address in a message, it will not be transmitted.

Re: PCAN UDS and ISO-TP CAN ID Mapping

Posted: Mon 7. Sep 2015, 15:44
by tr.gt
Hello Fabrice,

setting the "server address" did the trick. Thank you.

And thank you for the note regarding the remote address. It's set to 0x00. ;-)

Best,
Tobias