User Tools

Site Tools


doc:rfc_rtd-real-time-data-protocol-for-the-oobd-firmware

RTD (Real Time Data) Protocol for the OOBD Firmware

OOBD Team S. Koehler
Request for Comments:6
Obsoletes: -
Category: Draft Standard May 2013

Status of this Memo

This memo provides information about how to read real time CAN data through the OOBD firmware. Distribution of this memo is unlimited.

Copyright (C) OOBD Team (2012). All Rights Reserved.

Introduction

Concept

To surround several constrains like bus speed, real time capabilities and memory size when recording real time data in OOBD, the following concept will be followed

  1. To avoid the use of proprietary intellectual property, the data fields to be recorded are not hardcoded in the firmware, they will be instead configured by the application at start-up
  2. To avoid unpredictable bus speed bottlenecks, the data will only be collected in the firmware and only transferred on request.
  3. To reuse existing code on application side, the configuration and the data request will be implemented as pseudo UDS services: Service 27 (Write Data) to configure, Service 22 (Read Data) to read.

Initialization

Select the CAN RTD protocol

p 1 1 3 0

Open the CAN filters

p 8 10 1 0
p 8 11 1 0

This activates the CAN Real Time Protocol, clears the internal PID list and sets the CAN bus into “invisible listen” mode

Configuration

Commands

The data to listen to is defined by the application to the firmware with an 27- command:

27 CanID Type [Length [cPos [cStart]]]

Values not given use 0 as default value

where the data byte meanings are as follows:

Block Length in Bytes Meaning Comment
CanID 4 CAN- ID to listen to (MSB ..LSB)
Type 1 Multi frame message type 0: Single Frame
1: Custom
2: ISO-TP
Length 2 total length of data telegram in case of ISO-TP, data length is dynamically taken out of the First Frame header
if not given, assumed as 8 (=single frame length)
cPos 1 Position of Sequence counter -preliminary- If telegram type is custom, than this position (0-7) is used to identify the sequence counter inside the CAN frame.
cStar 1 start value of Sequence counter -preliminary- If telegram type is custom, than this value is used to identify the first frame by its sequence counter inside the CAN frame.

Errors

Error Code Meaning
1 Command too long: there are more bytes gives as specified by the command format
2 out of Memory: Not enough memory to store the requested data buffer
3 CAN ID already exist: The requested CAN ID is already requested before

Examples

Request Single frame with ID 0400

27 00000400

Request Single frame (=type 00) with ID 0400 and length 3

27 00000400 00 0003

Request custom multi frame (=type 01) with ID 400 , length 20, sequence counter position at Byte 3 and starting value of 2

27 00000400 01 0014 03 02

Request ISO-TP multiframe (=type 02) with ID 400 (length is taken dynamically out of first frame info)

27 00000400 02

Read Data

Commands

The request to the firmware to send received data to the application is done with an 22- command:

22 AA BB CC DD

where the data byte meanings are as follows:

Bytes Meaning Comment
AA BB CC DD CAN- ID to listen to (MSB ..LSB)

As result the firmware first repeats the command + 40H (=0x62) , a four byte timestamp (AABBCCDD, FreeRTOS ticks), a one byte flag (FL) and the received data bytes after that:

62 AA BB CC DD FL 00 11 22 ..
Flag

In the moment only bit 0 of the flag is used. If set, the data output is new and has not been printed before. After printed, the flag is set to 0 by the firmware. So when bit 0 is set, this is fresh data. By that the application software don't need to control by itself (by the time stamps) if this data has already been received before or if its new data.

Errors

the error messages are designed as General Response Code Errors, means they are coded as received bytes, not as clear text error messages. The byte sequence always starts with 7F 00, followed by the error code byte:

Error Code Meaning
01 unknown CAN ID (not configured yet)
02 no valid data received until now

General Commands

Command Function
p 6 1 clear the internal data buffer list, releases all used memory buffers

Implementation Details

  1. All requested CAN-IDs are internally handled as list of elements
  2. In case a requested CAN ID is > 8 bytes, then the element needs to have two receive buffers (double buffering), to make make sure that there's always one buffer ready to read, while the other one is just in the fill process by the CAN interrupt handler.
  3. The implementation needs to make sure, that a buffer is not altered during its printout process
  4. The implementation needs to make sure, that a buffer is only declared as valid, if a complete frame sequence (0..x) has been received without disturbance.

Security Considerations

This RFC raises security issues. It's need to make sure that the firmware only listens on the bus in invisible mode without creating any active (re)action on the bus.

References

Authors' Addresses

Steffen Koehler

Phone: +49 172 410 35 98

EMail:steffen@koehlers.de

Appendix

Copyright (C) OOBD Team (2012). All Rights Reserved.

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the OOBD Team organizations, except as needed for the purpose of developing standards in which case the procedures for copyrights defined in the Standards process must be followed, or as required to translate it into languages other than English.

The limited permissions granted above are perpetual and will not be revoked by the OOBD Team or its successors or assigns.

This document and the information contained herein is provided on an “AS IS” basis and THE OOBD TEAM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.“ Relation to other RFCs

Updates

Obsoletes

Obsoleted-by

Updated-by

Contact

Distribution Lists

The OOBD-RFC announcements are distributed via the oobd-commit-messages@googlegroups.com mailing list.

To join (or quit) the list goto https://groups.google.com/forum/?hl=de&fromgroups=#!forum/oobd-commit-messages


This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
doc/rfc_rtd-real-time-data-protocol-for-the-oobd-firmware.txt · Last modified: 2014/08/16 12:25 by admin