Fail to receive message from ECU with 29bit CAN addressing

A free API for the communication with control devices according to UDS (ISO 14229-1)
F.Vergnaud
Software Development
Software Development
Posts: 305
Joined: Mon 9. Sep 2013, 12:21

Re: Fail to receive message from ECU with 29bit CAN addressi

Post by F.Vergnaud » Thu 21. Sep 2017, 14:36

Ok, you will have to be more specific then because with your corrected configuration I'm able to receive corresponding UDS messages.
Are you sure you have defined the correct address for your client with the parameter PUDS_PARAM_SERVER_ADDRESS ? With your configuration the ECU is 0xF9 and the client is 0x93, is that correct ? Any message received by the client that doesn't match its address will be discarded.
Best regards,
Fabrice

horibamira
Posts: 7
Joined: Wed 20. Sep 2017, 18:07

Re: Fail to receive message from ECU with 29bit CAN addressi

Post by horibamira » Thu 21. Sep 2017, 17:33

The ECU address is 0x93 which I have set via PUDS_PARAM_SERVER_ADDRESS

I have defined the client address as 0xF9 using:

Code: Select all

	
// Define Network Address Information used for all the tests
	N_AI.SA = 0xF9;
	N_AI.TA = 0x93;
	N_AI.TA_TYPE = PUDS_ADDRESSING_PHYSICAL;
	N_AI.RA = 0x00;
	N_AI.PROTOCOL = PUDS_PROTOCOL_ISO_15765_2_29B;
I have attached the PCUClient output and corresponding PCAN-View trace showing the response from my ECU for the UDS request by the client.
Attachments
pcuclient.jpg
pcuclient.jpg (47.6 KiB) Viewed 12959 times
pcan trace.jpg
pcan trace.jpg (156.83 KiB) Viewed 12959 times

F.Vergnaud
Software Development
Software Development
Posts: 305
Joined: Mon 9. Sep 2013, 12:21

Re: Fail to receive message from ECU with 29bit CAN addressi

Post by F.Vergnaud » Thu 21. Sep 2017, 18:07

Be careful: PUDS_PARAM_SERVER_ADDRESS defines the address of your current application which in your case is called a client... So you have to set it to 0xF9. That is why you can see communications with PCAN-View: the PCAN-ISO-TP layer works fine, but the UDS layer discards the message as the Target address, in the response transmitted by the ECU, does not match the local address.

I understand the mixup and the parameter should better be called PUDS_PARAM_LOCAL_ADDRESS for disambiguation in future releases.
Best regards,
Fabrice

horibamira
Posts: 7
Joined: Wed 20. Sep 2017, 18:07

Re: Fail to receive message from ECU with 29bit CAN addressi

Post by horibamira » Thu 21. Sep 2017, 18:30

Thanks, I have not set it to 0xF9 but still no response.. I not sure what else it could be now

Have I got the N_AI set correctly in the below code?

Code: Select all


	// Define Address
	iBuffer = 0xF9;
	Status = UDS_SetValue(Channel, PUDS_PARAM_SERVER_ADDRESS, &iBuffer, 1);
	printf("  Set ServerAddress: %i (0x%02x)\n", (int)Status, iBuffer);
	// Define TimeOuts
	ulBuffer = 2000;
	Status = UDS_SetValue(Channel, PUDS_PARAM_TIMEOUT_REQUEST, &ulBuffer, sizeof(ulBuffer));
	printf("  Set TIMEOUT_REQUEST: %i (%d)\n", (int)Status, ulBuffer);
	Status = UDS_SetValue(Channel, PUDS_PARAM_TIMEOUT_RESPONSE, &ulBuffer, sizeof(ulBuffer));
	printf("  Set TIMEOUT_REQUEST: %i (%d)\n", (int)Status, ulBuffer);
	

	
	// Define Network Address Information used for all the tests
	N_AI.SA = 0xF9;
	N_AI.TA = 0x93;
	N_AI.TA_TYPE = PUDS_ADDRESSING_PHYSICAL;
	N_AI.RA = 0x00;
	N_AI.PROTOCOL = PUDS_PROTOCOL_ISO_15765_2_29B;
	

	//Priority set to 7
	iBuffer = 0x07;
	CANTP_SetValue(Channel, PCANTP_PARAM_J1939_PRIORITY, &iBuffer, 1);
	// Data paddding byte value
	iBuffer = 0x55;
	CANTP_SetValue(Channel, PCANTP_PARAM_PADDING_VALUE, &iBuffer, 1);
	
	// 29 bit can ID, normal format addressing (diagnostic message mandatory) - 
	Status = CANTP_AddMapping(Channel, 0x1CDA93F9, 0x1CDAF993,
		PCANTP_ID_CAN_29BIT, PCANTP_FORMAT_NORMAL, PCANTP_MESSAGE_DIAGNOSTIC,
		N_AI.SA, N_AI.TA, PCANTP_ADDRESSING_PHYSICAL, 0x00);
	printf("TP Mapping status 1: %i\n", (int)Status);

	Status = CANTP_AddMapping(Channel, 0x1CDAF993, 0x1CDA93F9,
		PCANTP_ID_CAN_29BIT, PCANTP_FORMAT_NORMAL, PCANTP_MESSAGE_DIAGNOSTIC,
		N_AI.TA, N_AI.SA, PCANTP_ADDRESSING_PHYSICAL, 0x00);
	printf("TP Mapping status 2: %i\n", (int)Status);

    Status = CANTP_AddMapping(Channel, 0x1CDA93F9, CAN_ID_NO_MAPPING,
		PCANTP_ID_CAN_29BIT, PCANTP_FORMAT_NORMAL, PCANTP_MESSAGE_DIAGNOSTIC,
		N_AI.SA, 0xFF, PCANTP_ADDRESSING_FUNCTIONAL, 0x00);


F.Vergnaud
Software Development
Software Development
Posts: 305
Joined: Mon 9. Sep 2013, 12:21

Re: Fail to receive message from ECU with 29bit CAN addressi

Post by F.Vergnaud » Fri 22. Sep 2017, 10:03

N_AI.PROTOCOL should be PUDS_PROTOCOL_ISO_15765_2_29B_NORMAL: you are using 29 bits NORMAL addressing.

If this is not working, can you post the CAN trace of the communication between your device and the ECU through PCAN-View.
Please also check the PCAN-UDS and PCAN-ISO-TP API versions by calling function GetValue with the parameter PUDS_PARAM_API_VERSION and PCANTP_API_VERSION.
Thank you.
Best regards,
Fabrice

horibamira
Posts: 7
Joined: Wed 20. Sep 2017, 18:07

Re: Fail to receive message from ECU with 29bit CAN addressi

Post by horibamira » Mon 25. Sep 2017, 10:58

Hi, I have set N_AI.PROTOCOL to PUDS_PROTOCOL_ISO_15765_2_29B_NORMAL but still not working.

UDS API version is: 1.3.0.25
PCAN-ISO API version is:2.0.1.82

I using 64 bit version of DLLs.

I have attached the PCAN trace of the ECU responding to UDS request

Kind Regards
Attachments
uds_mira.trc
(656 Bytes) Downloaded 605 times

mabel
Posts: 3
Joined: Mon 25. Sep 2017, 11:44

Re: Fail to receive message from ECU with 29bit CAN addressi

Post by mabel » Mon 25. Sep 2017, 12:30

Hi,

i had the same problem. After I set the the server address parameter to the address of my client application, i.e. 0xF9, i could remove the ISO-TP mappings and use the standard address protocol PUDS_PROTOCOL_ISO_15765_2_29B in the request.

I hope this helps you.

regards,
Martin Abel

F.Vergnaud
Software Development
Software Development
Posts: 305
Joined: Mon 9. Sep 2013, 12:21

Re: Fail to receive message from ECU with 29bit CAN addressi

Post by F.Vergnaud » Mon 25. Sep 2017, 12:37

Unfortunately horibamira uses non standard CAN IDs 29 bits FIXED NORMAL Adressing, that is why he has to use NORMAL addressing.

The problem lies with the following code which should be removed:

Code: Select all

   //Priority set to 7
   iBuffer = 0x07;
   CANTP_SetValue(Channel, PCANTP_PARAM_J1939_PRIORITY, &iBuffer, 1);
We're currently investigating why the priority (which is used only for FIXED_NORMAL, ENHANCED and 29bits MIXED addressing) has this side effect on your configuration.
Best regards,
Fabrice

horibamira
Posts: 7
Joined: Wed 20. Sep 2017, 18:07

Re: Fail to receive message from ECU with 29bit CAN addressi

Post by horibamira » Mon 25. Sep 2017, 12:57

I can now receive UDS responses from my ECU!!! Many thanks. I had set the priority field to 7 as the priority field is set to 7 our project CAN messages. I thought I needed to set this. However it seems I did not need it set at all.

Post Reply