How can I use SvcDiagnosticSessionControl_2013 to enter extended session mode

A free API for the communication with control devices according to UDS (ISO 14229-1)
Post Reply
icewind
Posts: 1
Joined: Thu 30. May 2024, 02:44

How can I use SvcDiagnosticSessionControl_2013 to enter extended session mode

Post by icewind » Thu 30. May 2024, 02:59

Hello,
I cannot enter the extended mode with the following code. Where is the problem

Code: Select all

	status = UDS_Initialize_2013(channel, PCANTP_BAUDRATE_500K, (cantp_hwtype)0, 0, 0);
    printf("Initialize channel: %s\n", UDS_STATUS_OK_KO(status));

    uint8_t tmp_buffer = PCANTP_ISO_TIMEOUTS_15765_4;
    status = UDS_SetValue_2013(channel, PUDS_PARAMETER_ISO_TIMEOUTS, &tmp_buffer, sizeof(tmp_buffer));

    tmp_buffer = 32;
    status = UDS_SetValue_2013(channel, PUDS_PARAMETER_SEPARATION_TIME, &tmp_buffer, sizeof(tmp_buffer));//stmin

    tmp_buffer = 8;
    status = UDS_SetValue_2013(channel, PUDS_PARAMETER_BLOCK_SIZE, &tmp_buffer, sizeof(tmp_buffer));//blocksize
    status = UDS_SetValue_2013(channel, PUDS_PARAMETER_CAN_TX_DL, &tmp_buffer, sizeof(tmp_buffer));//tx_data_length

	tmp_buffer = 0;
    status = UDS_SetValue_2013(channel, PUDS_PARAMETER_CAN_PADDING_VALUE, &tmp_buffer, sizeof(tmp_buffer));//tx_padding

    uint32_t tmp_buffer1 = 1000;
    status = UDS_SetValue_2013(channel, PUDS_PARAMETER_TIMEOUT_REQUEST, &tmp_buffer1, sizeof(tmp_buffer1));
    status = UDS_SetValue_2013(channel, PUDS_PARAMETER_TIMEOUT_RESPONSE, &tmp_buffer1, sizeof(tmp_buffer1));

    uds_status result;
    uds_msg request;
    uds_msg request_confirmation;
    uds_msg response;
    uds_msgconfig config;
    memset(&request, 0, sizeof(request));
    memset(&request_confirmation, 0, sizeof(request_confirmation));
    memset(&response, 0, sizeof(response));
    memset(&config, 0, sizeof(config));

    // Set request message configuration
    config.can_id = PUDS_ISO_15765_4_CAN_ID_FUNCTIONAL_REQUEST;
    config.can_msgtype = PCANTP_CAN_MSGTYPE_ECHO;
    config.nai.extension_addr = 0x0;
    config.nai.protocol = PUDS_MSGPROTOCOL_ISO_15765_2_11B_NORMAL;
    config.nai.source_addr = PUDS_ISO_15765_4_ADDR_TEST_EQUIPMENT;
    config.nai.target_addr = PUDS_ISO_15765_4_ADDR_ECU_1;
    config.nai.target_type = PCANTP_ISOTP_ADDRESSING_FUNCTIONAL;
    config.type = PUDS_MSGTYPE_USDT;     	
	
    result = UDS_SvcDiagnosticSessionControl_2013(channel, config, &request, PUDS_SVC_PARAM_DSC_ECUEDS);	
	// WaitForService_2013 

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

Re: How can I use SvcDiagnosticSessionControl_2013 to enter extended session mode

Post by M.Heidemann » Fri 31. May 2024, 13:18

Hello,

Please validate the result and see what feedback you are receiving,
otherwise this is pure guesswork. If this comes back as "OK" ( PUDS_STATUS_OK) the issue
lies somewhere else, if it doesn't then you at least have some indicator as to what's going on.

We'll delete the duplicate in the ISO-TP sub-forum.

Best Regards

Marvin
---
Marvin Heidemann
PEAK-Support Team

Post Reply