User Tools

Site Tools


doc:hw_commands

The OOBD Firmware Commands

Under the assumtion, that it will be mostly other software which talks to the interface, the command structure was made simple, but flexible.

The exact description about the syntax as such can be found in the RFC Firmware Syntax

The firmware and its commands are split into five different so called functions blocks

  1. System
  2. Serial Input
  3. Serial Output
  4. Protocol
  5. Bus

where each of this function blocks is split again into a generic and a implementation specific part

  • 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 as a CAN- Bus
  • 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

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:

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

max: implementation specific (unsigned long)

System Generic Commands (P 1)

Command Value1 Value2 Meaning Errorcodes
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 enable buzzer (= ON) with frequency in Hz of Value2
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

Command Value1 Value2 Meaning Errorcodes
0 0 0 show software version:
OOBD <FW-ID> <Rev> <Hardware> <Model> [Build date]
(e.g.: OOBD D2 651 Lux-Wolf CAN-Invader Thu, 15 Aug 2013 01:15:25 +0200)
0 1 0 show serial number:
xx:xx:xx:xx:xx:xx (=BTM222 MAC-Address)
0 2 0 show power supply voltage of OBD-II connector
0 3 0 show CPU info
0 4 0..max show memory information of address x
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

Serial-In Generic Commands (P 3)

Nothing implemented yet

Serial-Out Specific Commands (P 4)

Nothing implemented yet

Serial-Out Generic Commands (P 5)

Nothing implemented yet

Protocol Specific Commands (P 6)

Protocol Specific Commands (P 6) for the CAN UDS Protocol

Command Value1 Value2 Meaning Errorcodes
1 0..max 0 set response timeout in 10ms units
5 $xxx 0 set ECU Request-ID (RECVID)
6 $xxx 0 start Tester present on CAN-ID $xxx with actual interval and mask 10 (Out of Mem)
7 $xxx 0 stop Tester present on CAN-ID
8 0..max 0 set Tester present interval in 10ms units (Default 250)
9 $xxx 0 set ECU Response-ID (SENDID) (Default 0, makes SENDID= RECVID | 0x08)
10 $xxx 0 set Tester Present mask 02 xx (Default 0x80)
11 0 or 1 0 set/resets the Ping Mode Flag

Protocol Specific Commands (P 6) for the CAN Raw Protocol

For more details about the CAN Raw Mode, please refer to the RFC CAN Raw Mode

Command Value1 Value2 Meaning Errorcodes
1 (PARAM_CANRAW_FRAME_DELAY, not used yet?)
2 (PARAM_CANRAW_SENDID, not used yet?)
3 0..max repeats the sequence n+1 times. $FFFF means endless loop, send “p 6 3 0” to stop again. Note: This Counter needs to set again before each use, it's not “re-usable”


Protocol Specific Commands (P 6) for the CAN RTD Protocol

For more details about the CAN RTD Mode, please refer to the RFC CAN RTD Mode

Command Value1 Value2 Meaning Errorcodes
1 clear the internal data buffer list, releases all used memory buffers

Protocol Generic Commands (P 7)

Command Value1 Value2 Meaning Errorcodes
0 0 0 show info of used protocol
1 0 0 deactivate Listen mode
1 1 0 activate Listen mode

Bus Specific Commands (P 8)

Bus Specific Commands (P 8) for the CAN Bus, used in D2 Design

Command Value1 Value2 Meaning Errorcodes
2 0 0 CAN transceiver: Silent mode (CAN deactive)
2 1 0 CAN transceiver: Loop back (internal loop)
2 2 0 CAN transceiver: Loop back combined with silent mode
2 3 0 CAN transceiver: Normal mode (CAN active) ATTENTION: You need to active the bus before you set the CAN-Filters, but not after, otherways the settings are lost and the filters are closed
3 0 or 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 <Filter-No> $<CAN-ID> set Filter CAN-ID (11bit CAN-ID 0x0000-0x07FF) where Filter-No is 1-N*, i.e. p 8 10 1 $720
11 <Filter-No> $<Mask-ID> set Filter Mask-ID (11bit Mask-ID 0x0000-0x07FF) where Filter-No is 1-N* and Filter Mask depends on Filter CAN-ID (0=don't care 1=match), i.e. p 8 11 1 $7F0 (here: $720 - $72F)
12 <Filter-No> $<CAN-ID> set Filter CAN-ID (29bit CAN-ID 0x00000000-0x1FFFFFFF) where Filter-No is 1-N*, i.e. p 8 12 1 $18F30557
13 <Filter-No> $<Mask-ID> set Filter Mask-ID (29bit Mask-ID 0x00000000-0x1FFFFFFF) where Filter-No is 1-N* and Filter Mask depends on Filter CAN-ID (0=don't care 1=match), i.e. p 8 11 1 $1FFFFFF0 (here: $18F30550 - $18F3055F)
14 0 0 set all 11bit CAN filter to CAN-ID $0000 and Mask-ID $07FF (= disable any CAN traffic to application)

* N: number of filters is implementation depending, see #define MAXCANFILTER= in mc_can.h

The socketCAN implementation has some advanced filter settings. Please read the Socketcan dokumentation (chapter 4.1) for details.


Bus Generic Commands (P 9)

Bus Generic Commands (P 9) for the CAN Bus

Command Value1 Value2 Meaning Errorcodes
0 0 0 show info which interface/bus is active (i.e. CAN-Bus)
0 3 0 show info of CAN transceiver operating mode
0 4 0 show info about CAN ID side and bitrate
0 5 1 read different CAN counters: rx rxerr tx txerr rxerr2 txerr2 busoff buswarn buspass
0 5 2 delete all software internal CAN error counters
0 10 0 show all 11bit CAN-ID filter, each line with two 11bit CAN-filters like:
<CAN-ID> <Mask-ID> <CAN-ID> <Mask-ID>
0 11 0 show all 29bit CAN-ID filter, each line with one 29bit CAN-filter like:
<CAN-ID> <Mask-ID>


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/hw_commands.txt · Last modified: 2017/04/02 07:09 by admin