PCANTP_STATUS_NETWORK_TIMEOUT_Cr Read error: 57344 or hexa 0xe000
Posted: 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:
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:
PEAK Configuration :
If any clarification required please let me know
Regards,
Sandeep C
Admin: Added formatting for readability, please use code tags.
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,
};
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.