ISO 15765-2 (ISO-TP)
CAN is limited to just 8 bytes of payload. Diagnostic exchanges with an ECU often need to send more than 8 bytes of data. ISO-TP is a standard for sending larger amounts of data over CAN. It's defined in ISO 15765-2 and covers layer 3 (network) and layer 4 (transport) of the OSI model. ISO-TP is used in OBD and in UDS.
Message Structure
Every ISO-TP message consists of a header followed by the payload. If the payload is 7 bytes or less, the data fits into a single CAN frame. If the payload is larger, it needs to be broken up into multiple frames. The first nibble of the frame specifies the type of message — Single, First, Consecutive, or Flow. After the first nibble comes a length or index, followed by the actual payload.
If the CAN frame is less than 8 bytes in length, it can either be padded or sent with a shorter DLC. The ISO spec calls for padding with 0xCC, but 0xAA or 0x55 is more common in practice.
Single Frame
If the payload is 7 bytes or smaller, it fits in a single CAN frame. The first nibble is set to 0 to indicate a Single Frame. The next nibble is the length of the payload. The payload follows the length byte.
| Field | Mnemonic | Value | Description |
|---|---|---|---|
| N_PCI | PCI | 07 |
|
| payload | DATA | 22 F1 90 31 4A 34 47 | Up to 7 bytes of service data. |
First Frame and Consecutive Frame
If the payload is too large to fit in a single frame, it needs to be broken up into multiple messages. The first nibble of the first message is set to 1 to indicate a First Frame, followed by 12 bits indicating the length of the payload and 6 bytes of payload. The other side will then respond with a flow control message. This flow control message tells the sender whether it can continue sending, how long it needs to wait between frames, and how often it should wait for a new flow control message.
| Field | Mnemonic | Value | Description |
|---|---|---|---|
| N_PCI byte 1 | PCI1 | 10 |
|
| N_PCI byte 2 | PCI2 | 14 | FF_DL — low byte of total length. 0x014 = 20 bytes total. |
| payload | DATA | 62 F1 90 31 4A 34 | First 6 bytes of the message. |
After the flow control, the sender can send the rest of the payload using Consecutive Frames. These start with a 2 for the first nibble, followed by a 4-bit index to make sure the messages arrive in the correct order. When the index reaches 15 it wraps back to 0.
| Field | Mnemonic | Value | Description |
|---|---|---|---|
| N_PCI | PCI | 21 |
|
| payload | DATA | 47 58 34 38 53 38 31 | Up to 7 more bytes of the message. The last CF may be shorter (and padded). |
Flow Control
The flow control message is used to control the rate at which the rest of the data is sent. The first nibble of the flow control message is set to 3. The next nibble is the status of the flow control. The status can be either Continue (0), Wait (1), or Overflow (2).
Continue
Part of the continue message is the Block Size and Separation Time. The Block Size is the number of consecutive frames the sender is allowed to send before waiting for a new flow control message, and can be between 1 and 255. A Block Size of 0 indicates that the sender can send all consecutive frames without stopping.
The Separation Time is the time the sender should wait between sending consecutive frames. If the separation time is between 0 and 127, the unit is milliseconds; if the time is between 241 and 249, the unit is multiples of 100 µs (where 241 represents 100 µs).
| Field | Mnemonic | Value | Description |
|---|---|---|---|
| N_PCI | PCI | 30 |
|
| BlockSize | BS | 08 | Number of CFs the sender may transmit before the next FC. 0 = no further FCs. |
| SeparationTime | STmin | 0A | Minimum gap between CFs. 0x00–0x7F = 0–127 ms. 0xF1–0xF9 = 100–900 µs. |
Wait
When the sender is instructed to wait, it will wait for a second flow control message of the continue type before sending any more messages. A typical timeout is 1000 ms, so if a longer wait is needed the sender will need to send multiple wait messages.
Overflow
When the receiver indicates an overflow the transmission is aborted. The overflow flow control can only be sent as a reply to a first frame and should be used when the requested payload is too large to fit in the receiver's buffer.
Full transfer
The transfer below is generated from the payload you choose. The tester sends data and the ECU sends flow-control frames; expand the advanced controls to change the ECU's BS and STmin.
Try a transfer
4 CAN frames — 3 from tester, 1 from ECU- 101462F190314A34
- 30080AAAAAAAAAAA
- 2147583438533831
- 2246313233343536