UDS Mapping Problem

A free API for the communication with control devices according to UDS (ISO 14229-1)
Post Reply
Ken0711
Posts: 21
Joined: Wed 19. Jul 2023, 03:04

UDS Mapping Problem

Post by Ken0711 » Thu 1. Feb 2024, 13:04

Hello ,

I used the latest PCAN_UDS version ,

when i added mapping ID,i Sent the UDS message ,but CANOE feedback the message error

As shown attachment ,

Below is my code ,

Code: Select all

 private void AddMapping()
        {
            uds_mapping request_mapping = new uds_mapping();
            request_mapping.can_id = 0x784;
            request_mapping.can_id_flow_ctrl = 0x78C;
            request_mapping.can_msgtype = cantp_can_msgtype.PCANTP_CAN_MSGTYPE_STANDARD;
            request_mapping.nai.extension_addr = 0;
            request_mapping.nai.protocol = uds_msgprotocol.PUDS_MSGPROTOCOL_ISO_15765_2_11B_NORMAL;
            request_mapping.can_tx_dlc = 8;
            request_mapping.nai.source_addr =
            (UInt16)uds_address.PUDS_ADDRESS_ISO_15765_4_ADDR_TEST_EQUIPMENT;
            request_mapping.nai.target_addr = (UInt16)uds_address.PUDS_ADDRESS_ISO_15765_4_ADDR_ECU_1;
            request_mapping.nai.target_type = cantp_isotp_addressing.PCANTP_ISOTP_ADDRESSING_PHYSICAL;


            uds_mapping response_mapping;
            response_mapping = request_mapping;
            response_mapping.can_id = request_mapping.can_id_flow_ctrl;
            response_mapping.can_id_flow_ctrl = request_mapping.can_id;
            response_mapping.nai.source_addr = request_mapping.nai.target_addr;
            response_mapping.nai.target_addr = request_mapping.nai.source_addr;
            uds_status status;
            status = UDSApi.AddMapping_2013(cantp_handle.PCANTP_HANDLE_USBBUS1, ref request_mapping);
           
            status = UDSApi.AddMapping_2013(cantp_handle.PCANTP_HANDLE_USBBUS1, ref response_mapping);
           
            //status = UDSApi.GetMapping_2013(cantp_handle.PCANTP_HANDLE_USBBUS1, out response_mapping, 0x7BC, cantp_can_msgtype.PCANTP_CAN_MSGTYPE_STANDARD);

        }
 

Code: Select all

        #region UDS Service
        private bool UDS_Boot_Process1()
        {
            uds_status result;
            uds_msg request = new uds_msg();
            uds_msg request_confirmation = new uds_msg();
            uds_msg response = new uds_msg();
            uds_msgconfig config = new uds_msgconfig();
            UInt32 ResponseTimeOut = 2000;
            // Set request message configuration

            config.can_msgtype = cantp_can_msgtype.PCANTP_CAN_MSGTYPE_STANDARD;
            config.nai.extension_addr = 0x0;
            config.nai.protocol = uds_msgprotocol.PUDS_MSGPROTOCOL_ISO_15765_2_11B_NORMAL;
            config.nai.source_addr = (UInt16)uds_address.PUDS_ADDRESS_ISO_15765_4_ADDR_TEST_EQUIPMENT;
            config.nai.target_addr = (UInt16)uds_address.PUDS_ADDRESS_ISO_15765_4_ADDR_ECU_1;
            config.nai.target_type = cantp_isotp_addressing.PCANTP_ISOTP_ADDRESSING_PHYSICAL;
            config.type = uds_msgtype.PUDS_MSGTYPE_USDT;

            result = UDSApi.SetValue_2013(cantp_handle.PCANTP_HANDLE_USBBUS1, uds_parameter.PUDS_PARAMETER_USE_NO_RESPONSE_AUTOMATIC_TESTER_PRESENT, ref ResponseTimeOut, sizeof(UInt32));

            // Sends a physical DiagnosticSessionControl message
            result = UDSApi.SvcDiagnosticSessionControl_2013(cantp_handle.PCANTP_HANDLE_USBBUS1, config,
            out request, UDSApi.uds_svc_param_dsc.PUDS_SVC_PARAM_DSC_ECUEDS);
            if (UDSApi.StatusIsOk_2013(result))
                result = UDSApi.WaitForService_2013(cantp_handle.PCANTP_HANDLE_USBBUS1, ref request, out
                response, out request_confirmation);

        }        
i checked ,the ID MApping seems Ok,why cannot send the message right?

thanks!

----- EDIT by ADMINS -----
** Moved to an own Thread - do NEVER post new questions into an old posts with different questions **
See Forum Rules
Attachments
MsgError.PNG
MsgError.PNG (28.75 KiB) Viewed 1748 times
Last edited by F.Vergnaud on Mon 5. Feb 2024, 09:49, edited 1 time in total.
Reason: added code formatting

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

Re: UDS Mapping Problem

Post by PEAK-Support » Thu 1. Feb 2024, 13:57

If you think, that your code is correct, and you get a wrong answer from a other Vendor tool, it is maybe a good idea to contact them ? think about it !
But the Tool show Stuff Bit Error, so it is no High Layer Problem - it is a CAN Layer 2 Problem - see CAN Specification!
Looks like a physical problem ...
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

Post Reply