doc:hw_syntax
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
doc:hw_syntax [2014/02/25 06:37] – created admin | doc:hw_syntax [2014/03/23 07:57] – admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== The OOBD Firmware | + | ====== The OOBD Firmware |
- | Under the assumption, that it will be mostly other software which talks to the interface, the command structure was made simple, but flexible. | + | Under the assumtion, that it will be mostly other software which talks to the interface, the command structure was made simple, but flexible. |
- | To archive this, the interface knows only two different kind of inputs, data or parameters | + | The exact description about the syntax as such can be found in the [[rfc_firmware_syntax|RFC Firmware Syntax]] |
- | ===== Data ===== | + | The firmware and its commands are split into five different so called functions blocks |
- | input: | + | - System |
- | | + | - Serial Input |
+ | - Serial Output | ||
+ | - Protocol | ||
+ | | ||
- | where data is defined | + | where each of this function blocks |
+ | * **Generic** means, that these functions are common for all implementation of this particular function block, means each implementation has to support this commands. But please note that e.g. a K-Line Bus will still have other generic commands | ||
+ | * **Implementation specific** means, that the support of these commands if depending of actual type or implementation of the function block. So is e.g. the CAN-ID length setting supported of course by a CAN bus, but not by a K-Line Bus | ||
- | data = hex , { hex }; | + | When sending any p- command to the firmware, the first number in the command string always defines, to which function block the command is forwarded to. This gives then finally the following meaning of the first number: |
- | digit = " | + | |
- | hex = " | + | |
- | ===== Parameters ===== | + | ^ Command starts with ^ goes to which function block ^ |
+ | | p 0 | System Specific | ||
+ | | p 1 | System Generic | ||
+ | | p 2 | Serial-In Specific | ||
+ | | p 3 | Serial-In Generic | ||
+ | | p 4 | Serial-Out Specific | ||
+ | | p 5 | Serial-Out Generic | ||
+ | | p 6 | Protocol Specific | ||
+ | | p 7 | Protocol Generic | ||
+ | | p 8 | Bus Specific | ||
+ | | p 9 | Bus Generic | ||
- | input: | ||
- | p key value <CR> | ||
- | | ||
- | where the definion is as follows | ||
- | p = " | ||
- | key = number ; | ||
- | value = number ; | ||
- | number = digit , {digit } | " | ||
- | | ||
- | | ||
- | ===== Examples ===== | ||
- | Sending 11 bytes of data | + | max: implementation specific (unsigned long) |
- | input: | + | ===== System Generic Commands (P 1) ===== |
- | | + | |
- | if the number | + | ^ Command |
+ | | 1 | 0 | 0 | enable protocol CAN raw | | | ||
+ | | 1 | 1 | 0 | enable protocol UDS diagnositc | ||
+ | | 1 | 3 | 0 | enable protocol RTP (Real time data) | | | ||
+ | | 2 | 0 | 0 | disable blue LED (= OFF) | | | ||
+ | | 2 | 0 | 1 | enable blue LED (= ON) | | | ||
+ | | 2 | 1 | 0 | disable green LED (= OFF) | | | ||
+ | | 2 | 1 | 1 | enable green LED (= ON) | | | ||
+ | | 2 | 2 | 0 | disable red LED (= OFF) | | | ||
+ | | 2 | 2 | 1 | enable red LED (= ON) | | | ||
+ | | 2 | 3 | 0 | disable buzzer (= OFF) | | | ||
+ | | 2 | 3 | 1..max | ||
+ | | 2 | 10000 | 0 | disable Relais (= OFF) | | | ||
+ | | 2 | 10000 | 1 | enable Relais (= ON) | | | ||
- | | + | ===== System Specific Commands (P 0) ===== |
+ | ==== System Specific Commands (P 0) for the D2 Implementation ==== | ||
- | is send as | + | ^ Command |
+ | | 0 | 0 | 0 | show software version: \\ OOBD < | ||
+ | | 0 | 1 | 0 | show serial number: \\ xx: | ||
+ | | 0 | 2 | 0 | show power supply voltage of OBD-II connector | ||
+ | | 0 | 3 | 0 | show CPU info | | | ||
+ | | 0 | 4 | 0..max | ||
+ | | 0 | 5 | 0 | show ROM table location | ||
+ | | 0 | 6 | 0 | show free heap memory | ||
+ | | 0 | 7 | 0 | check CRC-32 of application | ||
+ | | 0 | 8 | 0 | show OOBD-Cup device name | | | ||
+ | | 0 | 9 | 0 | show UART speed | | | ||
+ | | 99 | 0 | 0 | Hardware - Reset | | | ||
- | | ||
+ | ===== Serial-In Specific Commands (P 2) ===== | ||
+ | Nothing implemented yet | ||
- | Set the parameter 127 to 64: | + | ===== Serial-In Generic Commands (P 3) ===== |
- | + | Nothing implemented yet | |
- | p 127 64 | + | |
- | + | ||
- | the same, but with hexadecimal notation: | + | |
- | + | ||
- | p $7F $40 | + | |
- | + | ||
- | + | ||
- | ====== Interface feedback ====== | + | |
- | The format of the data given back on a data or parameter input is depending on the actual active protocol and bus implementation. | + | |
- | + | ||
- | + | ||
- | **Important** Sending '' | + | |
- | + | ||
- | ====== Parameter list ====== | + | |
- | The OOBD interface is designed to allow generic protocols and busses. For that reason only some parameters can be common for all possible cases (the so called global parameters). All other ones are protocol or bus specific. | + | |
- | + | ||
- | + | ||
- | + | ||
- | max: implementation specific (unsigned long) | + | |
- | **usable for latest Firmware** | + | ===== Serial-Out Specific Commands (P 4) ===== |
+ | Nothing implemented yet | ||
- | ^ Receiver | + | ===== Serial-Out Generic |
- | | 0 | 0 | 0 | 0 | System Specific | + | Nothing implemented yet |
- | | 0 | 0 | 1 | 0 | System Specific | + | |
- | | 0 | 0 | 2 | 0 | System Specific | + | |
- | | 0 | 0 | 3 | 0 | System Specific | + | |
- | | 0 | 0 | 4 | 0..max | + | |
- | | 0 | 0 | 5 | 0 | System Specific | + | |
- | | 0 | 0 | 6 | 0 | System Specific | + | |
- | | 0 | 0 | 7 | 0 | System Specific | + | |
- | | 0 | 0 | 8 | 0 | System Specific | + | |
- | | 0 | 0 | 9 | 0 | System Specific | + | |
- | | 0 | 99 | 0 | 0 | System Specific | + | |
- | | 1 | 1 | 0 | 0 | System Generic | + | |
- | | 1 | 1 | 1 | 0 | System Generic | + | |
- | | 1 | 1 | 3 | 0 | System Generic | + | |
- | | 1 | 2 | 0 | 0 | System Generic | + | |
- | | 1 | 2 | 0 | 1 | System Generic | + | |
- | | 1 | 2 | 1 | 0 | System Generic | + | |
- | | 1 | 2 | 1 | 1 | System Generic | + | |
- | | 1 | 2 | 2 | 0 | System Generic | + | |
- | | 1 | 2 | 2 | 1 | System Generic | + | |
- | | 1 | 2 | 3 | 0 | System Generic | + | |
- | | 1 | 2 | 3 | 1..max | + | |
- | | 1 | 2 | 10000 | 0 | System Generic | + | |
- | | 1 | 2 | 10000 | 1 | System Generic | + | |
- | | 2 | 0..max | + | |
- | | 3 | 0..max | + | |
- | | 4 | 0..max | + | |
- | | 5 | 0..max | + | |
- | | 6 | 1 | 0..max | + | |
- | | 6 | 5 | $xxx | 0 | Protocol Specific | + | |
- | | 6 | 6 | $xxx | 0 | Protocol Specific | + | |
- | | 6 | 7 | $xxx | 0 | Protocol Specific | + | |
- | | 6 | 8 | 0..max | + | |
- | | 6 | 9 | $xxx | 0 | Protocol Specific | + | |
- | | 7 | 0 | 0 | 0 | Protocol Generic | + | |
- | | 7 | 1 | 0 | 0 | Protocol Generic | + | |
- | | 7 | 1 | 1 | 0 | Protocol Generic | + | |
- | | 8 | 2 | 0 | 0 | BUS Specific | + | |
- | | 8 | 2 | 1 | 0 | BUS Specific | + | |
- | | 8 | 2 | 2 | 0 | BUS Specific | + | |
- | | 8 | 2 | 3 | 0 | BUS Specific | + | |
- | | 8 | 3 | 1 | 0 | BUS Specific | + | |
- | | 8 | 3 | 2 | 0 | BUS Specific | + | |
- | | 8 | 3 | 3 | 0 | BUS Specific | + | |
- | | 8 | 3 | 4 | 0 | BUS Specific | + | |
- | | 8 | 3 | | + | |
- | | 8 | 3 | 6 | 0 | BUS Specific | + | |
- | | 8 | 3 | 7 | 0 | BUS Specific | + | |
- | | 8 | 3 | 8 | 0 | BUS Specific | + | |
- | | 8 | 4 | 0 | 0 | BUS Specific | + | |
- | | 8 | 4 | 1 | 0 | BUS Specific | + | |
- | | 8 | 10 | < | + | |
- | | 8 | 11 | < | + | |
- | | 8 | 12 | < | + | |
- | | 8 | 13 | < | + | |
- | | 8 | 14 | 0 | 0 | BUS Specific | + | |
- | | 9 | 0 | 0 | 0 | BUS Generic | + | |
- | | 9 | 0 | 3 | 0 | BUS Generic | + | |
- | | 9 | 0 | 4 | 0 | BUS Generic | + | |
- | | 9 | 0 | 5 | 1 | BUS Generic | + | |
- | | 9 | 0 | 5 | 2 | BUS Generic | + | |
- | | 9 | 0 | 10 | 0 | BUS Generic | + | |
- | | 9 | 0 | 11 | 0 | BUS Generic | + | |
+ | ===== Protocol Specific Commands (P 6) ===== | ||
+ | ==== Protocol Specific Commands (P 6) for the CAN UDS Protocol ==== | ||
- | **usable for Firmware <= SVN382** | + | ^ Command |
+ | | 1 | 0..max | ||
+ | | 5 | $xxx | 0 | set ECU Request-ID (RECVID) | ||
+ | | 6 | $xxx | 0 | activate Tester present on CAN-ID $xxx | | | ||
+ | | 7 | $xxx | 0 | deactivate Tester present on CAN-ID | ||
+ | | 8 | 0..max | ||
+ | | 9 | $xxx | 0 | set ECU Response-ID (SENDID) | ||
+ | ==== Protocol Specific Commands (P 6) for the CAN Raw Protocol ==== | ||
- | ^ Key ^ Value ^ Used by ^ Meaning | + | No dedicated p- commands for this mode, as the function is mainly driven |
- | | 0 | 0..max | + | |
- | | 1 | 0,1 | Global | + | |
- | | 2 | 0..2 | Global | + | |
- | | 3 | 0..max | + | |
- | | 4 | 0..max | + | |
- | | 5 | 0..max | + | |
- | | 6 | 0..max | + | |
- | | 7 | 0..max | + | |
- | | 8 | 0..max | + | |
- | | 9 | 0..max | + | |
- | | 10 | 0..max | Protocol | + | |
- | | 11 | 0..max | + | |
- | | 12 | 0..max | + | |
- | | 13 | 0..max | + | |
- | | 14 | 0..max | + | |
- | | 15 | 0 | 0 | just for internal | + | |
- | | 16 | 0..max | + | |
- | | 99 | 0..max | + | |
- | **Firmware <= SVN382** | + | ==== Protocol Specific Commands (P 6) for the CAN RTD Protocol ==== |
+ | For more details about the CAN RTD Mode, please refer to the [[rfc_rtd-real-time-data-protocol-for-the-oobd-firmware|RFC CAN RTD Mode]] | ||
- | ^ System infos (Parameter: p 0 < | + | ^ |
- | | 0 | version | + | | 1 | |
- | | 1 | serial number | + | |
- | | | + | |
- | | | + | |
- | | 4 | actual CAN-Transceiver status | + | |
- | | 5 | actual Bus Configuration | + | |
- | | 6 | Power supply | + | |
- | | 10 | CPU ID | (e.g.: 0x411fc231) | + | |
- | | 13 | Free Heap | Total Heap (in byte): < | + | |
- | | 14 | CRC check of application | + | |
- | | 20 | BTM222 devicename | + | |
- | | 21 | BTM222 UART speed | 4800/ | + | |
- | ^ Protocols | + | ===== Protocol Generic Commands |
- | ^ | + | ^ |
- | | | + | | |
- | | | + | | |
+ | | | ||
- | ^ Busses | + | ===== Bus Specific Commands |
- | ^ Value ^ Bus ^ | + | ==== Bus Specific Commands (P 8) for the CAN Bus, used in D2 Design ==== |
- | | 0 | Silent Mode, **default** after power up, reset and Busconfig change via P 6 x | | + | |
- | | 1 | Loopback Mode | | + | |
- | | 2 | Loopback Mode combined with Silent Mode | | + | |
- | | 3 | Normal Mode | | + | |
- | ^ Reset (Key 99) ^^ | + | ^ |
- | ^ | + | | 2 | 0 | 0 | CAN transceiver: |
- | | 1 | + | | 2 |
- | | 2 | + | | 2 |
+ | | 2 | 3 | 0 | CAN transceiver: | ||
+ | | 3 | 1 | 0 | Standard-CAN init (initialize CAN controller with 125kbit/s, 11bit) | ||
+ | | 3 | 2 | 0 | Standard-CAN init (initialize CAN controller with 250kbit/s, 11bit) | ||
+ | | 3 | 3 | 0 | Standard-CAN init (initialize CAN controller with 500kbit/s, 11bit) | ||
+ | | 3 | 4 | 0 | Standard-CAN init (initialize CAN controller with 1000kbit/s, 11bit) | ||
+ | | 3 | 5 | 0 | Extended-CAN init (initialize CAN controller with 125kbit/s, 29bit) | ||
+ | | 3 | 6 | 0 | Extended-CAN init (initialize CAN controller with 250kbit/s, 29bit) | ||
+ | | 3 | 7 | 0 | Extended-CAN init (initialize CAN controller with 500kbit/s, 29bit) | ||
+ | | 3 | 8 | 0 | Extended-CAN init (initialize CAN controller with 1000kbit/s, 29bit) | ||
+ | | 4 | 0 | 0 | HS-CAN (Relais switch - OFF) | | | ||
+ | | 4 | 1 | 0 | MS-CAN (Relais switch - ON) | | | ||
+ | | 10 | < | ||
+ | | 11 | < | ||
+ | | 12 | < | ||
+ | | 13 | < | ||
+ | | 14 | 0 | 0 | set all 11bit CAN filter to CAN-ID $0000 and Mask-ID $07FF (= disable any CAN traffic to application) | ||
- | ===== Raw CAN & UDS ===== | + | ===== Bus Generic Commands (P 9) ===== |
+ | ==== Bus Generic Commands (P 9) for the CAN Bus ==== | ||
- | ^ | + | ^ |
- | ^ Bus configuration (Key 06) ^^ | + | | |
- | | | + | | 0 |
- | | | + | | 0 |
- | | 3 | + | | 0 |
- | | 4 | + | | |
- | | 5 | + | "| |
- | | | + | < |
- | | | + | "| |
- | | | + | < |