PCANTP_STATUS_NETWORK_TIMEOUT_Cr Read error: 57344 or hexa 0xe000

A free API for the transfer of data packages according to ISO-TP (ISO 15765-2)
Locked
sandeepc
Posts: 14
Joined: Thu 4. Apr 2024, 08:56

PCANTP_STATUS_NETWORK_TIMEOUT_Cr Read error: 57344 or hexa 0xe000

Post by sandeepc » Tue 21. May 2024, 13:11

Hi,

My application is to Exchange huge data between ECU and PC.

I can able to send Huge data to the ECU and also able to read SF frame from ECU.

NOTE: All data is reading by using event callback

When i try to read more than 8 bytes getting read Error ==> Read error: 57344 or hexa 0xe000

error description:
PCANTP_STATUS_NETWORK_TIMEOUT_Cr 0x0000E000 Receiver side timeout while waiting for consecutive (57344) frame.

So my query is When i try to send 16 bytes of data from ECU to PC. PC side able to receive FF and also PC is sending FC frame to ECU, the next CF frame sent by ECU to PC < 80ms as mentioned detailed below frames.

Frames:
  • ECU to PC (FF): 0x10 0x10 0x00 0x01 0x02 0x03 0x04 0x05 (Extended CAN Identifier: 0x00DA01F1)
    PC to ECU (FC): 0x30 0x0A 0x7F 0x55 0x55 0x55 0x55 0x55 (Extended CAN Identifier: 0x00DAF101)
    ECU to PC(CF): 0x21 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C (Extended CAN Identifier: 0x00DA01F1)

i tried with default configuration of CAN ISO TP standard, got Same Error 57344, so i changed default timeout to 0X7F i. 127 ms to all timeout parameters still get same error .

How to overcome this error because ECU is sending CF frame <127 ms?
Still what are the parameters need to change or provide me tips to solve the issue.?

Please look in to my configuration and attached files:

My ECU configuration:

Code: Select all

n_req_t crc =
{ 
		.n_ai.n_pr = 0x00,     /* Network Address Priority */
		.n_ai.n_sa = 0xF1,     /* Network Source Address */
		.n_ai.n_ta = 0x01,     /* Network Target Address */
		.n_ai.n_ae = 0x00,   /* Network Address Extension */
		.n_ai.n_tt = N_TA_T_PHY,  /* Network Target Address type */

		.fr_fmt = CBUS_FR_FRM_STD,   /* Standard CANBUS */
		.msg = {0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x00B,0x0C},
		.msg_sz = 16,
};

PEAK Configuration :

Code: Select all

uint32_t ISOTP_init(cantp_mapping *mapping, cantp_handle handle)
{
	char version_buffer[500];
	cantp_status res;

	// Print version informations
	CANTP_GetValue_2016(PCANTP_HANDLE_NONEBUS, PCANTP_PARAMETER_API_VERSION, version_buffer, 500);
	printf("PCAN-ISO-TP API Version: %s\n\r", version_buffer);

	// Initialize channels: CAN2.0 - 500Kbit/s
	res = CANTP_Initialize_2016(handle, BAUDRATE, (cantp_hwtype)0, 0, 0);
	printf("Initialize: %s\n", STATUS_OK_KO(res));


	// Create a simple physical mapping: 
//    - Source 0xF1 (client), target 0x01 (server)
//    - Diagnostic message in a fixed normal format

	mapping->can_msgtype = PCANTP_CAN_MSGTYPE_EXTENDED;					//29 bit identifier
	mapping->netaddrinfo.extension_addr = 0x00;							//NA due to physical addressing mode
	mapping->netaddrinfo.format = PCANTP_ISOTP_FORMAT_FIXED_NORMAL;		//address type
	mapping->netaddrinfo.msgtype = PCANTP_ISOTP_MSGTYPE_DIAGNOSTIC;		//due to physical addressing 
	mapping->netaddrinfo.source_addr = 0xF1;							//
	mapping->netaddrinfo.target_addr = 0x01;							//
	mapping->netaddrinfo.target_type = PCANTP_ISOTP_ADDRESSING_PHYSICAL;

	STmin = 0x7F;
	res = CANTP_SetValue_2016(handle, PCANTP_PARAMETER_SEPARATION_TIME, &STmin, sizeof(STmin));
	printf("PCANTP_PARAMETER_SEPARATION_TIME %s\n\r", STATUS_OK_KO(res));

	res = CANTP_SetValue_2016(handle, PCANTP_PARAMETER_SEPARATION_TIME_TX, &STmin, sizeof(STmin));
	printf("PCANTP_PARAMETER_SEPARATION_TIME_TX %s\n\r", STATUS_OK_KO(res));


	res = CANTP_SetValue_2016(handle, PCANTP_PARAMETER_TIMEOUT_BR, &STmin, sizeof(STmin));
	printf("PCANTP_PARAMETER_TIMEOUT_BR %s\n\r", STATUS_OK_KO(res));

	res = CANTP_SetValue_2016(handle, PCANTP_PARAMETER_TIMEOUT_BS, &STmin, sizeof(STmin));
	printf("PCANTP_PARAMETER_TIMEOUT_BS %s\n\r", STATUS_OK_KO(res));

	res = CANTP_SetValue_2016(handle, PCANTP_PARAMETER_TIMEOUT_CR, &STmin, sizeof(STmin));
	printf("PCANTP_PARAMETER_TIMEOUT_CR %s\n\r", STATUS_OK_KO(res));

	res = CANTP_SetValue_2016(handle, PCANTP_PARAMETER_TIMEOUT_CS, &STmin, sizeof(STmin));
	
	printf("PCANTP_PARAMETER_TIMEOUT_CS %s\n\r", STATUS_OK_KO(res));
	
	uint32_t temp = 0x00;
	res = CANTP_GetValue_2016(handle, PCANTP_PARAMETER_TIMEOUT_CR, &temp, sizeof(temp));
	printf("get value PCANTP_PARAMETER_TIMEOUT_CR  %s %#X\n\r", STATUS_OK_KO(res), temp);

	printf("Can tp initialze success\n\r");
	return res;
}


void callback(cantp_handle channel, void* user_context)
{
	//printf("Call back called\n\r");
	cantp_status status;
	cantp_msg rx_msg;
	memset(&rx_msg, 0, sizeof(rx_msg));
	UserContext* context = (UserContext*)user_context;
	do {
		status = CANTP_Read_2016(channel, &rx_msg, NULL, PCANTP_MSGTYPE_ANY);
		if (CANTP_StatusIsOk_2016(status, PCANTP_STATUS_OK, false))
		{
			context->message_counter++;

			printf("received data length: %d =", rx_msg.msgdata.any->length);
			if (rx_msg.msgdata.any->length <= 500)
			{
				for (unsigned int i = 0; i < rx_msg.msgdata.any->length; i++)
				{
					printf("%#x ", rx_msg.msgdata.any->data[i]);

				}
			}
			else
			{
				printf("processing\n\r");
			}
		}
		else if (!CANTP_StatusIsOk_2016(status, PCANTP_STATUS_NO_MESSAGE, false)) {
			printf("Read error: %d or hexa %#x\n\r", status, status);
			context->error_counter++;
		}
		CANTP_MsgDataFree_2016(&rx_msg);
	} while (!CANTP_StatusIsOk_2016(status, PCANTP_STATUS_NO_MESSAGE, false));
}

If any clarification required please let me know

Regards,
Sandeep C

Admin: Added formatting for readability, please use code tags.
Attachments
forum_4.png
forum_4.png (20.94 KiB) Viewed 3651 times
forum_3.png
forum_3.png (27.59 KiB) Viewed 3651 times
forum_2.png
forum_2.png (64.45 KiB) Viewed 3651 times
forum_1.png
forum_1.png (63.04 KiB) Viewed 3651 times

M.Heidemann
Sales & Support
Sales & Support
Posts: 1083
Joined: Fri 20. Sep 2019, 13:31

Re: PCANTP_STATUS_NETWORK_TIMEOUT_Cr Read error: 57344 or hexa 0xe000

Post by M.Heidemann » Tue 21. May 2024, 13:37

Hi,

To summarize two earlier responses from our development team regarding this:

If a timeout is happening, then it is more likely because your address mappings are not correct. When using physical adressed communication, mappings are defined in pairs. Check that you are doing this and that you are using the correct CAN-IDs. Check the configuration of your device if you do not know which CAN-ID to use.

if you define only a single mapping from your test equipment to the ECU you will be able to send the First Frame of the CANTP message but won't receive the Flow Control from the ECU resulting in a network error n°2 (PCANTP_N_TIMEOUT_Bs).

That is why in PCTPClient for instance you'll see that there is always 2 mappings defined to test communication :

Code: Select all

// Mapping communication from Client to ECU
        CANTP_AddMapping(Channel, 0xA1, 0xA2,
		PCANTP_ID_CAN_11BIT, PCANTP_FORMAT_NORMAL, PCANTP_MESSAGE_DIAGNOSTIC,
		N_SA, N_TA_PHYS, PCANTP_ADDRESSING_PHYSICAL, 0x00);
// Mapping communication from ECU to Client
	CANTP_AddMapping(Channel, 0xA2, 0xA1,
		PCANTP_ID_CAN_11BIT, PCANTP_FORMAT_NORMAL, PCANTP_MESSAGE_DIAGNOSTIC,
		N_TA_PHYS, N_SA, PCANTP_ADDRESSING_PHYSICAL, 0x00);
More information about address mapping can be found in the help file, chapter 4.4.
Examples of address mapping can be see in almost any of the sample projects.

Please make sure your mapping is correct, let us know
if you need further assistance.

Best Regards

Marvin
---
Marvin Heidemann
PEAK-Support Team

sandeepc
Posts: 14
Joined: Thu 4. Apr 2024, 08:56

Re: PCANTP_STATUS_NETWORK_TIMEOUT_Cr Read error: 57344 or hexa 0xe000

Post by sandeepc » Tue 21. May 2024, 14:13

Thanks for the response,

I will check once again address mapping, i will let you know my status.

Is it mandatory of doing of reverse mapping, when we are using single PEAK usb?

Regards,
Sandeep C
Last edited by sandeepc on Tue 21. May 2024, 14:48, edited 1 time in total.

M.Heidemann
Sales & Support
Sales & Support
Posts: 1083
Joined: Fri 20. Sep 2019, 13:31

Re: PCANTP_STATUS_NETWORK_TIMEOUT_Cr Read error: 57344 or hexa 0xe000

Post by M.Heidemann » Tue 21. May 2024, 14:48

Hello,

You'll still need to configure two mappings in your software:

Mapping 1: From tester (e.g., 0xA1) to ECU (e.g., 0xA2) – Used for sending initial requests.
Mapping 2: From ECU (e.g., 0xA2) to tester (e.g., 0xA1) – Used for receiving responses.

If this is what you are referring to by "reverse mapping" then yes, it is mandatory.

Best Regards

Marvin
---
Marvin Heidemann
PEAK-Support Team

sandeepc
Posts: 14
Joined: Thu 4. Apr 2024, 08:56

Re: PCANTP_STATUS_NETWORK_TIMEOUT_Cr Read error: 57344 or hexa 0xe000

Post by sandeepc » Tue 21. May 2024, 17:55

Thanks for the reply,

Now able to read data from ECU.

Regards,
Sandeep C

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: PCANTP_STATUS_NETWORK_TIMEOUT_Cr Read error: 57344 or hexa 0xe000

Post by PEAK-Support » Wed 22. May 2024, 04:19

Thank you for the Feedback - Topic closed -
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

Locked