Source and destionation address?

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

Source and destionation address?

Post by sandeepc » Mon 8. Apr 2024, 13:25

I want send huge data (in Mb) from Visual studio code (PC) to MCU?

Hardware using: PCAN-USB FD

So as i gone through CAN protocol if want send huge data we have use ISO TP (ISO 15765-2). PCAN-USB FD it supports this iso format.

I gone through the complete (ISO 15765-2) address formatting and can tp working.

Links removed! Please read the rules. no external links, please rules.php

I downloaded resources from peak website:

https://www.peak-system.com/PCAN-ISO-TP ... .html?&L=1

I gone through the all examples and i am able to build and run the 06_isotp_segmented_read_write successfully.

MCU configuration: CAN Reception ID =0xA1,CAN Transmission ID: 0xA2

i have few queries on mapping:

This ID is my MCU ID?

Code: Select all

mapping.can_id = 0xA1;
The MCU should response to this address right?

Code: Select all

mapping.can_id_flow_ctrl = 0xA2;

	mapping.can_msgtype = PCANTP_CAN_MSGTYPE_STANDARD;
//dlc will overwrittenduring msg data init right?

Code: Select all

mapping.can_tx_dlc = 0x0;
Not applicable Due to 11 bit identifier

Code: Select all

mapping.netaddrinfo.extension_addr = 0x00;

	mapping.netaddrinfo.format = PCANTP_ISOTP_FORMAT_NORMAL;
	mapping.netaddrinfo.msgtype = PCANTP_ISOTP_MSGTYPE_DIAGNOSTIC;
normal adressing format from ISO 15765-2 so its not required source and destination address why still we need to use these address?

Code: Select all

mapping.netaddrinfo.source_addr = 0xF1;
	mapping.netaddrinfo.target_addr = 0x01;
since i used PCAN-USB FD so i leave as it is

Code: Select all

mapping.netaddrinfo.target_type = PCANTP_ISOTP_ADDRESSING_PHYSICAL;
below is it configuring for to triggerr when data available on USB1 or what purpose below configuration we have to use?

Code: Select all

// Create the associated reversed mapping: 
	reverse_mapping = mapping;
	reverse_mapping.can_id = mapping.can_id_flow_ctrl;
	reverse_mapping.can_id_flow_ctrl = mapping.can_id;
	reverse_mapping.netaddrinfo.source_addr = mapping.netaddrinfo.target_addr;
	reverse_mapping.netaddrinfo.target_addr = mapping.netaddrinfo.source_addr;


to send huge data i configured as below

Code: Select all

mapping.can_id = 0xA1;
	mapping.can_id_flow_ctrl = 0xA2;
	mapping.can_msgtype = PCANTP_CAN_MSGTYPE_STANDARD;
	mapping.can_tx_dlc = 0x0;
	mapping.netaddrinfo.extension_addr = 0x00;
	mapping.netaddrinfo.format = PCANTP_ISOTP_FORMAT_NORMAL;
	mapping.netaddrinfo.msgtype = PCANTP_ISOTP_MSGTYPE_FLAG_INDICATION_TX;
1st try

Code: Select all

mapping.netaddrinfo.source_addr = 0xF1;
	mapping.netaddrinfo.target_addr = 0x01;
2nd try

Code: Select all

mapping.netaddrinfo.source_addr = 0x00;
	mapping.netaddrinfo.target_addr = 0x00;

	mapping.netaddrinfo.target_type = PCANTP_ISOTP_ADDRESSING_PHYSICAL;

	// Create the associated reversed mapping: 
	reverse_mapping = mapping;
	reverse_mapping.can_id = mapping.can_id_flow_ctrl;
	reverse_mapping.can_id_flow_ctrl = mapping.can_id;
	reverse_mapping.netaddrinfo.source_addr = mapping.netaddrinfo.target_addr;
	reverse_mapping.netaddrinfo.target_addr = mapping.netaddrinfo.source_addr;

when i use above configuration(PCANTP_ISOTP_MSGTYPE_FLAG_INDICATION_TX) vs code does not sending any messages it self, why?

If want to send huge what are the modification required in 06 example?

Regards,
Sandeep C

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

Re: Source and destionation address?

Post by M.Heidemann » Mon 8. Apr 2024, 14:52

Hello Sandeep,

regarding your post:
1.
This ID is my MCU ID?
mapping.can_id = 0xA1;

The MCU should response to this address right?
mapping.can_id_flow_ctrl = 0xA2;
These are the CAN-IDs which are used to match the ISOTP networking information.

2.
Not applicable Due to 11 bit identifier
mapping.netaddrinfo.extension_addr = 0x00;
Not applicable since normal ormal addressing is used.

3.
normal adressing format from ISO 15765-2 so its not required source and destination address why still we need to use these address?
This is wrong, ISO-TP always uses Source and Target Address. But with normal addressing there is a mapping between Adresses and CAN IDs.

4.
since i used PCAN-USB FD so i leave as it is
mapping.netaddrinfo.target_type = PCANTP_ISOTP_ADDRESSING_PHYSICAL;
This is wrong. The device has nothing to do with ISOTP addressing type (physical=point-to-point communication and functional=broadcasting)

5.
below is it configuring for to triggerr when data available on USB1 or what purpose below configuration we have to use?
It is required to configure a 2 way communication when one need to transmit segmented messages (because there are protocol frames that are sent from and to each peer).
Please see example #6 provided in the PCAN ISO-TP API packgage. In the example two ISO-TP nodes are initialized.
If you want to transmit data to an ECU, only one channel must be initialized (called transmitter_handle in the sample).

Also, i have to address:

Please try and use some form of formatting or make use of the code tags,
i'll add them this time around but consider using them in the future.
---
Marvin Heidemann
PEAK-Support Team

Post Reply