Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
interface:syntax [2013/12/17 10:58] admininterface:syntax [2014/02/25 06:38] (current) – removed admin
Line 1: Line 1:
-====== The OOBD Firmware Syntax ====== 
- 
-Under the assumption, 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 
- 
-===== Data ===== 
-input: 
-  data <CR> 
- 
-where data is defined as (in EBNF- Syntax) 
- 
-  data = hex , { hex }; 
-  digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ; 
-  hex = "A" | "B" | "C" | "D" | "E" | "F" |"a" | "b" | "c" | "d" | "e" | "f" | digit ; 
- 
-===== Parameters ===== 
- 
-input: 
-  p key value <CR> 
-   
-where the definion is as follows 
- 
-  p = "p" | "P" ; 
-  key = number ; 
-  value = number ; 
-  number = digit , {digit } | "$" , hex , { hex } ; 
-   
-   
-===== Examples ===== 
- 
-Sending 11 bytes of data 
- 
-input: 
-   112233445566778899AABB 
- 
-if the number of input chars is not even, the last char is handled as MSB of the last byte, so 
- 
-   112233445566778899AAB 
- 
-is send as  
- 
-   112233445566778899AAB0 
- 
- 
-Set the parameter 127 to 64: 
- 
-  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 ''data'' locks the input until the receive tasks times out. 
- 
-====== 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** 
- 
-^  Receiver  ^  Command  ^  Value1  ^  Value2  ^  Used by  ^  Meaning  ^ 
-|  0  |  0  |  0  |  0  |  System Specific  |  show software version  | 
-|  0  |  0  |  1  |  0  |  System Specific  |  show serial number  | 
-|  0  |  0  |  2  |  0  |  System Specific  |  show power supply voltage of OBD-II connector  | 
-|  0  |  0  |  3  |  0  |  System Specific  |  show CPU info  | 
-|  0  |  0  |  4  |  0..max  |  System Specific  |  show memory information if location x  | 
-|  0  |  0  |  5  |  0  |  System Specific  |  show ROM table location  | 
-|  0  |  0  |  6  |  0  |  System Specific  |  show free heap memory  | 
-|  0  |  0  |  7  |  0  |  System Specific  |  check CRC-32 of application  | 
-|  0  |  0  |  8  |  0  |  System Specific  |  show OOBD-Cup device name  | 
-|  0  |  0  |  9  |  0  |  System Specific  |  show UART speed  | 
-|  0  |  99  |  0  |  0  |  System Specific  |  Hardware - Reset  | 
-|  1  |  1  |  0  |  0  |  System Generic  |  enable protocol CAN raw  | 
-|  1  |  1  |  1  |  0  |  System Generic  |  enable protocol UDS diagnositc  | 
-|  1  |  1  |  3  |  0  |  System Generic  |  enable protocol RTP (Real time data)  | 
-|  1  |  2  |  0  |  0  |  System Generic  |  disable blue LED (= OFF)  | 
-|  1  |  2  |  0  |  1  |  System Generic  |  enable blue LED (= ON)  | 
-|  1  |  2  |  1  |  0  |  System Generic  |  disable green LED (= OFF)  | 
-|  1  |  2  |  1  |  1  |  System Generic  |  enable green LED (= ON)  | 
-|  1  |  2  |  2  |  0  |  System Generic  |  disable red LED (= OFF)  | 
-|  1  |  2  |  2  |  1  |  System Generic  |  enable red LED (= ON)  | 
-|  1  |  2  |  3  |  0  |  System Generic  |  disable buzzer (= OFF)  | 
-|  1  |  2  |  3  |  1..max  |  System Generic  |  enable buzzer (= ON) with frequency in Hz of Value2  | 
-|  1  |  2  |  10000  |  0  |  System Generic  |  disable Relais (= OFF)  | 
-|  1  |  2  |  10000  |  1  |  System Generic  |  enable Relais (= ON)  | 
-|  2  |  0..max  |  0..max  |  0..max  |  Serial-In Specific  |  0  | 
-|  3  |  0..max  |  0..max  |  0..max  |  Serial-In Generic  |  0  | 
-|  4  |  0..max  |  0..max  |  0..max  |  Serial-Out Specific         |  0  | 
-|  5  |  0..max  |  0..max  |  0..max  |  Serial-Out Generic  |  0  | 
-|  6  |  1  |  0..max  |  0  |  Protocol Specific  |  set response timeout in 10ms units  | 
-|  6  |  5  |  $xxx  |  0  |  Protocol Specific  |  set ECU Request-ID (RECVID)  | 
-|  6  |  6  |  $xxx  |  0  |  Protocol Specific  |  activate Tester present on CAN-ID $xxx  | 
-|  6  |  7  |  $xxx  |  0  |  Protocol Specific  |  deactivate Tester present on CAN-ID  | 
-|  6  |  8  |  0..max  |  0  |  Protocol Specific  |  set Tester present interval in ms  | 
-|  6  |  9  |  $xxx  |  0  |  Protocol Specific  |  set ECU Response-ID (SENDID)  | 
-|  7  |  0  |  0  |  0  |  Protocol Generic  |  show info of used protocol  | 
-|  7  |  1  |  0  |  0  |  Protocol Generic  |  deactivate CAN Listen mode  | 
-|  7  |  1  |  1  |  0  |  Protocol Generic  |  activate CAN Listen mode  | 
-|  8  |  2  |  0  |  0  |  BUS Specific  |  CAN transceiver: Silent mode (CAN deactive)  | 
-|  8  |  2  |  1  |  0  |  BUS Specific  |  CAN transceiver: Loop back (internal loop)  | 
-|  8  |  2  |  2  |  0  |  BUS Specific  |  CAN transceiver: Loop back combined with silent mode  | 
-|  8  |  2  |  3  |  0  |  BUS Specific  |  CAN transceiver: Normal mode (CAN active)  | 
-|  8  |  3  |  1  |  0  |  BUS Specific  |  Standard-CAN init (initialize CAN controller with 125kbit/s, 11bit)  | 
-|  8  |  3  |  2  |  0  |  BUS Specific  |  Standard-CAN init (initialize CAN controller with 250kbit/s, 11bit)  | 
-|  8  |  3  |  3  |  0  |  BUS Specific  |  Standard-CAN init (initialize CAN controller with 500kbit/s, 11bit)  | 
-|  8  |  3  |  4  |  0  |  BUS Specific  |  Standard-CAN init (initialize CAN controller with 1000kbit/s, 11bit)  | 
-|  8  |  3  |  5  |  0  |  BUS Specific  |  Extended-CAN init (initialize CAN controller with 125kbit/s, 29bit)  | 
-|  8  |  3  |  6  |  0  |  BUS Specific  |  Extended-CAN init (initialize CAN controller with 250kbit/s, 29bit)  | 
-|  8  |  3  |  7  |  0  |  BUS Specific  |  Extended-CAN init (initialize CAN controller with 500kbit/s, 29bit)  | 
-|  8  |  3  |  8  |  0  |  BUS Specific  |  Extended-CAN init (initialize CAN controller with 1000kbit/s, 29bit)  | 
-|  8  |  4  |  0  |  0  |  BUS Specific  |  HS-CAN (Relais switch - OFF)  | 
-|  8  |  4  |  1  |  0  |  BUS Specific  |  MS-CAN (Relais switch - ON)  | 
-|  8  |  10  |   <Filter-No>  |   $<CAN-ID>  |  BUS Specific  |  set Filter CAN-ID (11bit CAN-ID 0x0000-0x07FF) where Filter-No is 1-20, i.e. p 8 10 1 $720  | 
-|  8  |  11  |   <Filter-No>  |   $<Mask-ID>  |  BUS Specific  |  set Filter Mask-ID (11bit Mask-ID 0x0000-0x07FF) where Filter-No is 1-20 and Filter Mask depends on Filter CAN-ID (0=don't care 1=match), i.e. p 8 11 1 $7F0 (here: $720 - $72F)  | 
-|  8  |  12  |    <Filter-No>  |   $<CAN-ID>  |  BUS Specific  |  set Filter CAN-ID (29bit CAN-ID 0x00000000-0x1FFFFFFF) where Filter-No is 1-10, i.e. p 8 12 1 $18F30557  | 
-|  8  |  13  |    <Filter-No>  |   $<Mask-ID>  |   BUS Specific  |   set Filter Mask-ID (29bit Mask-ID 0x00000000-0x1FFFFFFF) where Filter-No is 1-10 and Filter Mask depends on Filter CAN-ID (0=don't care 1=match), i.e. p 8 11 1 $1FFFFFF0 (here: $18F30550 - $18F3055F)  | 
-|  8  |  14  |  0  |  0  |  BUS Specific  |  set all 11bit CAN filter to CAN-ID $0000 and Mask-ID $07FF (= disable any CAN traffic to application)  | 
-|  9  |  0  |  0  |  0  |  BUS Generic  |  show info which interface/bus is active (i.e. CAN-Bus)  | 
-|  9  |  0  |  3  |  0  |  BUS Generic  |  show info of CAN transceiver operating mode  | 
-|  9  |  0  |  4  |  0  |  BUS Generic  |  0  | 
-|  9  |  0  |  5  |  1  |  BUS Generic  |  read different CAN error counters  | 
-|  9  |  0  |  5  |  2  |  BUS Generic  |  delete all software internal CAN error counters  | 
-|  9  |  0  |  10  |  0  |  BUS Generic  |  show all 11bit CAN-ID filter, each line with two 11bit CAN-filters like: \\ <CAN-ID> <Mask-ID> <CAN-ID> <Mask-ID>  | 
-|  9  |  0  |  11  |  0  |  BUS Generic   |  show all 29bit CAN-ID filter, each line with one 29bit CAN-filter like: \\ <CAN-ID> <Mask-ID>  | 
- 
- 
-**usable for Firmware <= SVN382** 
- 
- 
-^  Key  ^  Value  ^  Used by  ^  Meaning  ^ 
-|  0  |  0..max  |  Global  |  Output System infos  | 
-|  1  |  0,1  |  Global  |  set local echo on/off. 0=off, 1=on  | 
-|  2  |  0..2  |  Global  |  set Linefeed (0=crlf, 1 = cr , 2 = lf  | 
-|  3  |  0..max  |  Global  |  set bus listening level. 0=off, all other values implementation specific  | 
-|  4  |  0..max  |  Global  |  select Protocol  | 
-|  5  |  0..max  |  Protocol  |  select Bus  | 
-|  6  |  0..max  |  Protocol  |  select Bus configuration  | 
-|  7  |  0..max  |  Protocol  |  set module answer Timeout (Unit: 10ms)  | 
-|  8  |  0..max  |  Protocol  |  set “answer pending” answer Timeout (Unit: 10ms)  | 
-|  9  |  0..max  |  Protocol  |  overwrite Blocksize with fixed value (0= use the blocksize requested by module)  | 
-|  10  |  0..max  |  Protocol  |  set frame delay time (Unit: 10ms, 0= use the delay requested by module)  | 
-|  11  |  0..max  |  Protocol  |  set Receiver ID  | 
-|  12  |  0..max  |  Protocol  |  set tester present ON (value (dec or $xxx) = Receiver ID)  | 
-|  13  |  0..max  |  Protocol  |  set tester present OFF (value (dec or $xxx) = Receiver ID)  | 
-|  14  |  0..max  |  Protocol  |  set tester present frequency (Unit: 10ms)  | 
-|  15  |  0  |  0  |  just for internal  | 
-|  16  |  0..max  |  Protocol  |  set Sender ID (value (dec or $xxx) (= awaited answer address, 0 disables)  | 
-|  99  |  0..max  |  System  |  system reset (= jumps back into bootloader)  | 
- 
- 
- 
-**Firmware <= SVN382** 
- 
-^ System infos (Parameter: p 0 <value> ^^^ 
-|  0  |  version  |  OOBD <Design-ID> <Rev> [Build date](e.g.: OOBD D2 214 So 27. Feb 14:31:12 CET 2011)  | 
-|  1  |  serial number  |  xx:xx:xx:xx:xx:xx (=BTM222 MAC-Address)  | 
-|  2  |  actual Bus  |  <Bus-ID> [<Name>] (e.g.: 1 CAN)  | 
-|  3  |  actual Protocol  |  <value> [<Name>] (e.g.: 1 - UDS (ISO 14229-1)  | 
-|  4  |  actual CAN-Transceiver status  |  <Transceiver-Status> (e.g.: 0 - CAN Transceiver in 'Silent Mode' | 
-|  5  |  actual Bus Configuration  |  <Configuration-ID> [<Name>] (e.g.: 3 - ISO 15765/4, CAN 11bit ID/500kBaud)  | 
-|  6  |  Power supply  |  <voltage value> (e.g. 12950 mV)  | 
-|  10  |  CPU ID  |  (e.g.: 0x411fc231)  | 
-|  13  |  Free Heap  |  Total Heap (in byte): <value>, Free Heap (in byte): <value>  | 
-|  14  |  CRC check of application  |  CRC-32 application check <passed>/<failed> | 
-|  20  |  BTM222 devicename  |  OOBD-Cup xxxxxxxx  | 
-|  21  |  BTM222 UART speed  |  4800/9600/19200/38400/57600/115200/230400/460800 bit/s  | 
- 
- 
-^ Protocols (Key 04) ^^ 
-^  Value ^ Protocol ^ 
-|  1     | raw CAN | 
-|  2     | [[http://de.wikipedia.org/wiki/Unified_Diagnostic_Services|UDS (ISO 14229-1)]] | 
- 
- 
-^ Busses (Key 05) ^^ 
-^  Value ^ Bus ^ 
-|  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) ^^ 
-^  Value ^ kind of reset ^ 
-|  1     | soft reset | 
-|  2     | hard reset | 
- 
-===== Raw CAN & UDS ===== 
- 
-^  Value ^ Meaning, CAN-Interface **must be** set to **Normal Mode** afterwards wit parameter "P 5 3" ^ 
-^ Bus configuration (Key 06) ^^ 
-|  1     | CAN Bus 11 bit ID 125kB | 
-|  2     | CAN Bus 11 bit ID 250kB | 
-|  3     | CAN Bus 11 bit ID 500kB | 
-|  4     | CAN Bus 11 bit ID 1MB | 
-|  5     | CAN Bus 29 bit ID 125kB | 
-|  6     | CAN Bus 29 bit ID 250kB | 
-|  7     | CAN Bus 29 bit ID 500kB | 
-|  8     | CAN Bus 29 bit ID 1MB | 
-