UDS Mapping

A free API for the communication with control devices according to UDS (ISO 14229-1)
Post Reply
Rommel
Posts: 10
Joined: Sat 11. Jan 2025, 10:08

UDS Mapping

Post by Rommel » Mon 13. Jan 2025, 22:36

Here one Point I am struggeling:

To use the UDS procs I need to tell them the ids of the communication partners.
This I do by adding uds_mapping for sent and recive messages on a initializeted tphandle.

Why do I have to set uds_msgconfig config with similar information additionally to use uds function like testerpresent?

Code: Select all

requestMapping.can_id = 0x18DA017E;
requestMapping.can_id_flow_ctrl = 0x18DA7E01;
requestMapping.can_msgtype = cantp_can_msgtype.PCANTP_CAN_MSGTYPE_STANDARD;
requestMapping.nai.extension_addr = 0;
requestMapping.nai.protocol = uds_msgprotocol.PUDS_MSGPROTOCOL_ISO_15765_2_29B_NORMAL;
requestMapping.can_tx_dlc = 8;
requestMapping.nai.source_addr = (UInt16)uds_address.PUDS_ADDRESS_ISO_15765_4_ADDR_TEST_EQUIPMENT;
requestMapping.nai.target_addr = (UInt16)uds_address.PUDS_ADDRESS_ISO_15765_4_ADDR_ECU_1;
requestMapping.nai.target_type = cantp_isotp_addressing.PCANTP_ISOTP_ADDRESSING_PHYSICAL;
....
config.can_id = (UInt32)0xFFFFFFFF;
config.can_msgtype = cantp_can_msgtype.PCANTP_CAN_MSGTYPE_STANDARD;
config.nai.protocol = uds_msgprotocol.PUDS_MSGPROTOCOL_ISO_15765_2_29B_NORMAL;
config.nai.target_type = cantp_isotp_addressing.PCANTP_ISOTP_ADDRESSING_PHYSICAL;
config.type = uds_msgtype.PUDS_MSGTYPE_USDT;
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;
And does .PUDS_MSGPROTOCOL_ISO_15765_2_11B_NORMAL works without mapping, since this adresses are pre Mapped ?
Last edited by M.Gerber on Tue 14. Jan 2025, 10:56, edited 1 time in total.
Reason: Inserted [code] tag for improved readability

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

Re: UDS Mapping

Post by F.Vergnaud » Tue 14. Jan 2025, 09:26

Hello,

A mapping defines a possible communication with 2 nodes. It informs the API that it can handle ISOTP segmentation protocol.
Keep in mind that there can be multiple configured mappings on a single initialized UDS channel.
uds_msgconfig is the configuration of a UDS message, you need to configure it correctly so that the API checks that it matches a corresponding mapping.

You do need to initialize mappings with NORMAL addressing, it is not the case with 29 bit FIXED NORMAL (PUDS_MSGPROTOCOL_ISO_15765_2_29B_FIXED_NORMAL) which does this automatically.
Please check documentation p.770-773 on that matter: 4.3 and 4.3.2 ISO-TP Network Addressing Format.

Note: The CAN IDs you are using look like fixed normal addressing where nodes' addresses are 7E and 01.
Reminder, by default the UDS API consider that your node address (PUDS_PARAMETER_SERVER_ADDRESS) is the Test Equipment 0xF1, you may need to change it to 7E or add another listened address (PUDS_PARAMETER_LISTENED_ADDRESSES) if you plan to try PUDS_MSGPROTOCOL_ISO_15765_2_29B_FIXED_NORMAL.
Best regards,
Fabrice

Post Reply