Interpreters April 01 2011
Interpreters April 01 2011
Interpreters April 01 2011
Creation Date: March 1, 1993 Version Date: April 01, 2011 Authoring Group: GM Customer Care & Aftersales - Product Engineering Document Name: Interpreters_April_01_2011.docx
The information contained within this document is proprietary to General Motors Company (GM)
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
Table of Contents
Service Programming System (SPS) ................................................................................................................... 1 Table of Contents ................................................................................................................................................. 2 Overview .............................................................................................................................................................. 6 Utility File Structure .............................................................................................................................................. 7 Format of Header Information ....................................................................................................................... 8 Format of Interpreter Instructions .................................................................................................................. 9 Device (ECU) Specific Control Routines and/or Service Request Data Routines ............................................. 10 Reprogramming Algorithm Overview ................................................................................................................. 11 Additional Utility File Information - Best Practices and recommendations ......................................................... 12 Programming Storage Buffers Recommended Usage ................................................................................... 15 Interpreter 0 - UART Communications Programming Op-Codes ...................................................................... 16 UART Support for No Communication Faults.............................................................................................. 17 UART Return Type Processing ................................................................................................................... 18 00 Op-Code: Enable Normal Communications ........................................................................................... 19 01 Op-Code: Request message from the device ........................................................................................ 20 02 Op-Code: Request memory dump from the device using Mode 2 (Saturn EEPROM) ........................... 21 03 Op-Code: Verify programming of a EEPROM device (NAO EEPROM) ................................................. 23 04 Op-Code: Device control - Mode 4 ......................................................................................................... 24 05 Op-Code: Ram download request - Mode 5 ........................................................................................... 26 08 Op-Code: Disable Normal Communications........................................................................................... 27 09 Op-Code: Enable Normal Communications ........................................................................................... 28 0A Op-Code: Clear Trouble Codes - Mode 10 ............................................................................................ 29 0C Op-Code: Program EEPROM - Mode 12 ............................................................................................... 30 0D Op-Code: Perform Security - Mode 13................................................................................................... 32 20 Op-Code: Receive a normal mode message from device ...................................................................... 33 A3 Op-Code Read Data from Specified Sequential Addresses (Electric Vehicle) Mode 3 ......................... 34 C0 Op-Code: Download Routine to RAM and Execute using Mode 6 ......................................................... 35 C1 Op-Code: Download Routine to RAM and Execute using Mode 16 ....................................................... 37 C2 Op-Code: Download Routine to RAM and Save Two Byte Response using Mode 6 ............................ 39 C3 Op-Code: Download Routine to RAM and Execute using Mode 6 (Electric Vehicle) ............................. 40 C4 Op-Code: Download Routine to RAM using Mode 20 (Holden Telematics) .......................................... 42 C5 Op-Code: Execute Routine using Mode 21 (Holden Telematics) .......................................................... 44 D0 Op-Code: Download Calibration / Software File using Mode 6 .............................................................. 45 D1 Op-Code: Download Calibration or Software Module using Mode 16 .................................................... 47 D2 Op-Code: Download VIN using Mode 6 & 16 ......................................................................................... 48 D4 Op-Code: Download Calibration / Software File using Mode 6 (Saturn EEPROM) ............................... 50 D5 Op-Code: Download Calibration / Software File using Mode 12 (Electric Vehicle) ................................ 52 D6 Op-Code: Erase Flash Block using Mode 22 (Holden Telematics)........................................................ 53 D7 Op-Code: Download Software Module using Mode 23 (Holden Telematics) ......................................... 54 D8 Op-Code: Execute Software Module using Mode 24 (Holden Telematics) ............................................ 56 F0 Op-Code: Wait for Poll from a Device .................................................................................................... 57 Interpreter 1 - Class 2 Communications Programming Op-Codes .................................................................... 58 Class 2 No Communications Processing .................................................................................................... 59 Class 2 Response Processing ..................................................................................................................... 60 01 Op-Code: Setup Global Variables .......................................................................................................... 62 10 Op-Code: Initiate Diagnostic Operation .................................................................................................. 63 14 Op-Code: Clear Diagnostic Information .................................................................................................. 64 20 Op-Code: Return to Normal Mode .......................................................................................................... 65 27 Op-Code: Perform Security - Mode 27 ................................................................................................... 66 28 Op-Code: Disable Normal Communications - Mode 28 ......................................................................... 69 29 Op-Code: Resume Normal Communications - Mode 29 (Obsolete Use Op-Code 20) .......................... 70 31 Op-Code: Start a Diagnostic Routine by Test Number ........................................................................... 71 34 Op-Code: Request the Control Module for Block Transfer - Mode 34.................................................... 72 1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved. Page 2
3B Op-Code: Write block of memory........................................................................................................... 74 3C Op-Code: Read and verify block of memory .......................................................................................... 81 3E Op-Code: Modify Block of Memory ........................................................................................................ 83 40 Op-Code: Read/Write Data Buffer .......................................................................................................... 85 52 Op-Code: Write Checksum to Block 82 / 8E .......................................................................................... 88 72 Op-Code: Set Programming Voltage ...................................................................................................... 90 84 Op-Code: Set Communications Parameters (Add Delay) ...................................................................... 91 A0 Op-Code: Request High Speed Communications - Mode A0 ................................................................ 92 A1 Op-Code: Begin High Speed Communications - Mode A1 .................................................................... 93 A8 Op-Code: GM Propriety Test Mode ........................................................................................................ 94 AE Op-Code: Request Device Control - Mode AE ...................................................................................... 95 B0 Op-Code: Block Transfer to RAM and Execute - Mode 36 .................................................................... 96 B2 Op-Code: Block Transfer to RAM and Save Two Byte Response - Mode 36 ........................................ 99 B3 Op-Code: Block Transfer to Download VIN as a Calibration - Mode 36 .............................................. 100 B4 Op-Code: Block Transfer to Download Calibration File - Mode 36 ...................................................... 102 Interpreter 2 KWP2000 Communications Programming Op-Codes ................................................................ 105 KWP2000 No Communications Processing .............................................................................................. 106 KWP2000 Response Processing .............................................................................................................. 107 01 Op-Code: Setup KWP2000 Programming (Target and Source Bytes) ................................................ 109 03 Op-Code: Set Number of Repetitions ................................................................................................... 110 10 Op-Code: SR 10 to Start Diagnostic Session ....................................................................................... 111 11 Op-Code: SR 11 ECU Reset ................................................................................................................ 113 14 Op-Code: SR 14 Clear Diagnostic Trouble Codes ............................................................................... 114 20 Op-Code: SR 20 to Stop Diagnostic Session ....................................................................................... 115 23 Op-Code: SR 23 to Read Memory by Address and Save Bytes........................................................... 116 27 Op-Code: SR 27 for Security Access Request ..................................................................................... 118 30 Op-Code: SR 30 to Input/Output Control by Local Identifier ................................................................. 120 31 Op-Code: SR 31 to Start Routine by Local Identifier ............................................................................ 121 32 Op-Code: SR 32 to Stop Routine by Local Identifier ............................................................................ 122 33 Op-Code: SR 33 to Request Routine Results by Local Identifier ......................................................... 123 34 Op-Code: SR 34 for Download Request............................................................................................... 124 37 Op-Code: SR 37 for Request Transfer Exit .......................................................................................... 126 38 Op-Code: SR 38 to Start Utility File Routine by Address ...................................................................... 127 39 Op-Code: SR 39 to Stop Utility File Routine by Address ...................................................................... 129 3A Op-Code: SR 3A to Request Routine Results by Address ................................................................... 131 3B Op-Code: SR 3B to Write Data by Local Identifier ............................................................................... 132 3D Op-Code: SR 3D to Write Memory by Address ................................................................................... 134 71 Op-Code: SR 31 to Start Routine by Local Identifier and Save 2 Bytes ............................................... 136 78 Op-Code: SR 38 to Start Utility File Routine by Address and Save 2 Bytes ......................................... 138 81 Op-Code: SR 81 to Start Communications ........................................................................................... 140 82 Op-Code: SR 82 to Stop Communications ........................................................................................... 141 83 Op-Code: SR 83 to Access Communications Parameters ................................................................... 142 84 Op-Code: SR 83 to Set Communications Parameters ......................................................................... 144 90 Op-Code: SR 36 to Transfer a Routine to ECU .................................................................................... 145 93 Op-Code: SR 36 to Transfer a Calibration File to ECU ........................................................................ 148 Interpreter 3 - GMLAN Communications Programming Op-Codes ................................................................. 152 GMLAN No Communications Processing .................................................................................................. 153 GMLAN Response Processing .................................................................................................................. 154 01 Op-Code: Setup Global Variables ........................................................................................................ 156 10 Op-Code: Mode 10 Initiate Diagnostic Operation ................................................................................. 157 14 Op-Code: Mode 04 Clear DTC's ........................................................................................................... 158 1A Op-Code: Mode 1A Read Data by Identifier ......................................................................................... 159 20 Op-Code: Mode 20 Return To Normal Mode ....................................................................................... 160 22 Op-Code: Mode 22 Read Data by Parameter Identifier (PID) .............................................................. 161 25 Op-Code: Mode AE Security Code ....................................................................................................... 162 27 Op-Code: Mode 27 Security Access ..................................................................................................... 163 34 Op-Code: Mode 34 Request Download ................................................................................................ 165 3B Op-Code: Mode 3B Write Data by Identifier ......................................................................................... 167 84 Op-Code: Set Communications Parameters ........................................................................................ 170 A2 Op-Code: Mode A2 Report Programmed State and Save Response .................................................. 171 AA Op-Code: Mode AA Read Data by Packet Identifier ............................................................................ 172 AE Op-Code: Mode AE Request Device Control ....................................................................................... 174
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
B0 Op-Code: Mode 36 Block Transfer to RAM ......................................................................................... 175 Communications Independent Programming Op-Codes ................................................................................. 178 50 Op-Code: Compare Bytes .................................................................................................................... 179 51 Op-Code: Compare Checksum ............................................................................................................ 180 53 Op-Code: Compare Data ...................................................................................................................... 181 54 Op-Code: Change Data ........................................................................................................................ 183 55 Op-Code: Evaluate RPO (for use in vehicle assembly plants only) ...................................................... 185 56 Op-Code: Interpreter Identifier .............................................................................................................. 186 EE Op-Code: End with ERROR ................................................................................................................. 187 F1 Op-Code: Set Global Memory Address ................................................................................................ 188 F2 Op-Code: Set Global Memory Length .................................................................................................. 189 F3 Op-Code: Set Global Header Length ................................................................................................... 190 F4 Op-Code: Ignore Responses for Milliseconds ...................................................................................... 191 F5 Op-Code: Override the Utility File Message Length Value ................................................................... 192 F7 Op-Code: No Operation Op-Code ........................................................................................................ 193 F8 Op-Code: Goto Field continuation ........................................................................................................ 194 FB Op-Code: Set and Decrement Counter ................................................................................................ 195 FC Op-Code: Delay for ?? Seconds/Minutes ............................................................................................ 196 FD Op-Code: Reset counter ...................................................................................................................... 197 FF Op-Code: End with SUCCESS ............................................................................................................. 198 System Errors and Op-Code Failures .............................................................................................................. 199 Procedure for Adding New Op-Codes or Exceptions to Existing Op-Codes .................................................... 200 Appendixes....................................................................................................................................................... 201 Appendix A - UART Interpreter Examples ................................................................................................. 202 Appendix B - Class 2 Interpreter Examples ............................................................................................... 203 Appendix C - KWP2000 Interpreter Example ............................................................................................ 204 Appendix D GMLAN Utility File Guidelines ............................................................................................. 206 Revision History (Appendix D: GMLAN Utility File Guidelines) ..........................................................207 Assumptions ........................................................................................................................................208 Programming Flow ..............................................................................................................................209 Step $01 Set Target and Source Address .......................................................................................211 Step $02 Start Perform Seed and Key............................................................................................212 Step $03 SetUp Prepare to Download Flash Routine #1 from Utility File ......................................213 Step $04 Download Flash Routine #1 from Utility File .....................................................................214 Step $05 Request the Operating Software Part Number .................................................................215 Step $06 Evaluate the Application Software Part Number Value.....................................................216 Step $07 ProgOp Set the Global Header Length...........................................................................217 Step $08 Prepare to Download the Operating Software ..................................................................218 Step $09 Download the Operating Software ....................................................................................219 Step $0A ProgCal Set the Global Header Length..........................................................................220 Step $0B Prepare to Download the First Calibration Module ...........................................................221 Step $0C Download the First Calibration Module ............................................................................222 Step $0D Prepare to Download the Second Calibration Module .....................................................223 Step $0E Download the Second Calibration Module .......................................................................224 Step $0F ProgState Request the Programmed State....................................................................225 Step $10 Evaluate the Programmed State Value ............................................................................226 Step $11 Part 2 Write the VIN .......................................................................................................227 Step $12 Write the Tester Serial Number ........................................................................................228 Step $13 Write the Programming Date ............................................................................................229 Step $14 Retry1 Initialize Retry counter and decrement ...............................................................230 Step $15 Retry1 Delay .....................................................................................................................231 Step $16 Retry2 Initialize Retry counter and decrement ...............................................................232 Step $17 Retry2 Delay .....................................................................................................................233 Step $18 Retry3 Initialize Retry counter and decrement ...............................................................234 Step $19 Retry3 Delay .....................................................................................................................235 Step $1A Retry4 Initialize Retry counter and decrement ...............................................................236 Step $1B Retry4 Delay .....................................................................................................................237 Step $1C Success Exit Interpreter with Success...........................................................................238 Step $1D Error Exit Interpreter with Error ......................................................................................239 SPS Editor Output of Interpreter Instructions ......................................................................................240
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
GMLAN Message Flow Diagrams .......................................................................................................241 Appendix E - Revision Log (Interpreters Document) ............................................................................... 244 Appendix F - Related Documents .............................................................................................................. 250 Appendix G $54 Op-Code Additional Information................................................................................... 251 Appendix H $55 Op-Code Additional Information - GATS Option String Processing ............................. 253
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
Overview
This manual is designed for developers who will be writing the interpretive sections of the Utility Files and for the system programmers who will be writing the Interpreter software. The purpose of the manual is to explain the Interpreter concept as well as instruct a user exactly how to write interpreter instructions. This document will be updated regularly, so user input is a must for maximum benefit. The main input to the Interpreter Concept is the Utility File. Step by step instructions on how to reprogram a control module is provided by the Utility File. Utility Files were developed to keep the proliferation of tool reprogramming software to a minimum. The Utility file is viewed as three distinct sections: the Header Information (24 bytes), the Interpreter Instructions (size varies) and the device specific programming routines (a.k.a. Programming Algorithm (PA)). Even though the Utility file is viewed as three distinct parts, it will always be treated as a single entity necessary for reprogramming a Control Module.
The Interpreter Concept uses Interpreters that allow reprogramming support of new products, without having to hard code or create independent software packages. An Interpreter is a module that understands the format of Utility Files as well as the use of each of its Op-Codes. The Interpreter follows the Interpreter Instructions in the Utility files until an exit point is reached. There are two Op-Codes that will end the programming event: If the EE Op-Code (End with Error) is executed by the interpreter, Programming has Failed. If the FF Op-Code (End with SUCCESS) is executed by the interpreter, Programming was Successful. NOTE: Refer to Communications Independent Programming Op-Codes
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
The Header Information defines information that remains constant during the entire reprogramming event. An example of this information is the "Type of Interpreter", once the software starts using an Interpreter it will not change to an Interpreter using another communications protocol.
Interpreter Instructions
A set of sequentially numbered steps to control the programming session
The Interpreter Instructions are the Op-Codes that guide the terminal application through a reprogramming event. Each instruction line is 16 bytes long and consists of four sections: 1 byte Step Number, 1 byte Op-Code, 4 byte Action Field, and 10 bytes of goto fields.
Device (ECU) Specific Control Routines and / or Service Request Data Routine
The Device Specific Control Routines are programming routines used for performing various functions during the reprogramming event. The number of routines varies, depending on how each ECU. Examples of control routines are: erase flash memory, turn on reprogramming voltage, or read flash manufacturer and ID. Service Request Data Routines provide a means to pass additional data in Service Request. Examples of this data are Routine Entry Options and Record Values.
Even though the Utility File is viewed as three sections, it must be handled as a single file. The following subsections, Format of Header Information, Format of Interpreter Instructions and Format of Device Specific Programming Routines, provide greater insight to the design of the three sections of the Utility File. The routine section of the utility file is an optional section and is controller specific.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
2 bytes $0E-$0F
Type of addressing (2,3 or 4 byte) Data address information Number of data bytes in a message
790E
0000
00000000
0000
0000
0001
00A8
0002
00002000
0040
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
Any position not used in an instruction line must be filled with zero. All numbers in the interpreter instructions must be entered as hexadecimal values. (Note: All entries made to a utility file must be in caps) Step Field (1 byte - valid steps 01 - FF) The Step is a sequential number, increasing by one, indicating the order of the instruction file. The Step is used as a reference for goto field branching in the instructions. The first step number in the interpretive code must be 1 (0x01) and the last step cannot be greater than 255 (0xFF). An Interpreter error will occur if a step zero (0x00) is encountered. Op-Code Field (1 byte) Op-Codes are assigned values that identify what type of function/service the service tool should perform. Action Fields (4 bytes) The Action Fields are used as parameters or indicating exceptions. By setting appropriate exceptions in the Action fields, the behavior of the Op-Code can be modified. All unused Action Fields shall be set to 0x00. GOTO Fields (5 - 2 byte pairs) The Goto Fields are used to determine the next step. Goto fields are defined as pairs. For Op-Codes that send a message to a control module based on the responses returned from the control module, the first byte is the response byte and the second byte is the interpreter step that is executed next. Comparison of the Goto Field pairs is done from left to right and will stop when the first matching code is found. The Goto Field pair is read as follows: On response return code ?? - Then_- Goto step ?? Two specific numbers FD and FF are defined to handle response codes / events. In case of a no communications fault event the FD code will determine the next step. The FF code is read as "ANY". If there is a response code or event return code that is not listed in the Goto Field pairs, then the FF Goto Field code will determine the next step. For Op-Codes which send a message to a control module, the FF code must be in the last Goto Field pair to handle all possible response codes / events.
NOTE:
In the case of negative response processing, it is possible to receive a negative response code that is equal to the expected service identification response for a positive response message. To resolve this issue, it is necessary to put a duplicate response code in the goto fields: the first goto response will be for positive response messages and the second will handle the negative response messages. For a more detailed description, see the Response processing section of this document. The response return codes are the control module responses to a transmitted message. Not all Op-Codes send a message to a control module, some perform other functions (i.e. Op-Code 50 and 51). The first byte of the goto pair should be zero for Op-Codes not requiring a response from the module. If more than five Goto Fields are needed for an interpreter instruction, do not close the step with an 'FF'. If the tool does not see an 'FF' return code and a return code has not been found, the tool continues searching for a return code in the Goto Fields of the next step in the interpreter instructions. The 'F8' OpCode must be used on the goto continuation line (for more information see 'F8' Op-Code description).
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
Device (ECU) Specific Control Routines and/or Service Request Data Routines
The Device (ECU) Specific Control Routines are pieces of code that are transferred to an ECU. The suppliers or the Flash vendors develop the control routines. Examples of Control Routines are: erase flash memory, checksum memory, or reset ECU. The user has the option to include Control Routines in the Utility File or to embed the routines in the ECU's memory. This entire section of the Utility File is optional. If this section is omitted all required Control Routines shall be embedded in the ECU's memory and therefore no user optional data shall be needed for any Service Requests. If this section is in the Utility File, it shall be formatted as follows: The routines in the Utility File must be laid out as follows: 4 bytes 2 byte X bytes 4 bytes 2 byte Y bytes : 4 bytes 2 byte Z bytes Address information Length of the routine 1 (not including address and length) Routine 1 data Address information Length of the routine 2 (not including address and length) Routine 2 data : Address information Length of the routine N (not including address and length) Routine N data.
The routines are one contiguous block of data. They are separated only for presentation purposes. The address can be used by the tool as a destination address (Note: The address information could also come from the global address or the header address or might be not used at all.). The length is used to locate the routines in the routine(s) portion of the Utility File. The length of a routine is the total number of data bytes not including the 2 byte length and the 4 byte address. The first routine in the routine section will be referenced as routine number 1. The routine numbers are not included in the routines section of the Utility File. However, the routine number will be used in the Op-Code to call the routine. The tool will internally keep track of the routine numbers. If an Op-Code calls for routine 3, the tool will skip over the first two routines and return the data in the third routine. The tool will determine where each routine is located by using the routine lengths that precede each routine located in the routines section of the Utility File.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
10
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
11
UART Protocol: TBD Class 2 Protocol: 1. Op-Code 29 (mode $29) is obsolete and should be replaced with Op-Code 20 (mode $20) in any new utility files. Op-Code $29 is supported for legacy issues only. 2. For part number comparisons using Op-Code 3B (mode $3B) other than the VIN, the first goto field shall indicate a matching part number, the second goto field will provide the path to follow when the part numbers differ. Keyword 2000 Protocol: 1. There shall be a delay after ECU Reset and a start/stop communication to assure that the controller is still OK after Reset 2. Seed &Key: Error code 37 is handled internally (external loop not necessary) 3. Op-Code FC Delay for Seconds/Minutes KWP 2000 requires AC1=01 to send Tester Present (AC1=00 Default Tester Present is only for UART and GMLAN)
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
12
(continued) GMLAN CAN Protocol: 1. All GMLAN CAN Utility files shall have Op-Code 01 as the first interpreter instruction. 2. All SPS_TYPE_A and SPS_TYPE_B ECU's shall support mode $1A DID $B0 (ECU diagnostic address). See GMW3110 specification. 3. All SPS_TYPE_C ECUs shall enable and support two special case CANIds as defined in GMW3110 chapter 11. 4. Items 1,2 and 3 allow the programming code to map the utility file device ID to the ECU request and response CANIds. 5. Any interpreter instruction which needs to sent after a ECU reset shall be implemented in part two of the utility file. The utility file header bytes $0A-$0B shall be set to the interpreter instruction number for the beginning of part two. A FF Op-Code is required before the beginning of part two of the utility file. 6. Only the GMLAN CAN protocol supports 4 byte addressing. 7. GMLAN CAN utilizes pre utility (programming setup) and post utility (programming conclusion) file processes as documented in GMW3110. Pre Utility file process example for HS GMLAN CAN: <04 00 00 01 01 00 00 00 00 FE 3E <04 00 00 01 01 00 00 00 00 FE 1A B0 >04 00 00 00 00 00 00 07 E8 00 5A B0 11 <04 00 00 01 01 00 00 00 00 FE 10 02 >04 00 00 00 00 00 00 07 E8 00 50 <04 00 00 01 01 00 00 00 00 FE 28 >04 00 00 00 00 00 00 07 E8 00 68 <04 00 00 01 01 00 00 00 00 FE A2 >04 00 00 00 00 00 00 07 E8 00 E2 00 <04 00 00 01 01 00 00 00 00 FE A5 01 >04 00 00 00 00 00 00 07 E8 00 E5 <04 00 00 01 01 00 00 00 00 FE A5 03
Post Utility file process example for HS GMLAN CAN: <04 00 00 01 01 00 00 00 00 FE 20 >04 00 00 00 00 00 00 06 44 00 60 <04 00 00 01 01 00 00 00 00 FE 1A B0 >04 00 00 00 00 00 00 07 E8 00 5A B0 11 Certain Op-Codes commonly used in Class 2 are not defined for GMLAN CAN as they are part of the pre and post utility file processes and run automatically. 8. GMLAN CAN supports Op-Code 53 Compare Data functions. In combination with Op-Code 1A, OpCode 53 can be used to read the operational software part number and program operational software and calibrations or program only calibrations. S1130000071AC10100005A08FD09FF1B00000000FF S1130000085301010000000A000B000000000000FF 9. For Single Wire GMLAN CAN, the pre utility file process as defined in GMW3110 handles the high voltage wake up message. 10. If the VIN, Repair Shop Code, Programming Date or End Model Part Number are written to the ECU, it is recommended that this be done in part two of the utility file after programming and ECU reset. Repair shop code and Programming Date should be stored in flash memory.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
13
(continued)
11. The utility file needs to comprehend how the ECU reacts to a request for a part number if the part is not fully programmed. For example, some ECUs when running out of boot will go to a fixed memory location and report out the contents of those memory locations as the part number. If the data file had been previously successfully programmed the reported data is correct. If programming was interrupted you may get bogus data (e.g. FF FF FF FF) or you may get a valid part number even though the complete data file had not been programmed. This can occur if the boot code retrieves the part number from the memory where the GMLAN header is written and programming had been interrupted after the header data was written to flash. There are several ways to get around this. One would be to have the boot check the validity of that particular data file and reject the part number request with reject code $31 if the data file was not fully programmed. The utility file could then be setup to jump to the appropriate line to reprogram the partially programmed data component. A second method to get around this is to use a combination of $A2 and $50 Op-Codes. The $A2 Op-Code will retrieve the programmed state of the ECU and dump it into one of the utility file buffers. The $50 Op-Code can then be used to verify that software is programmed before proceeding to the Op-Codes to check the software part numbers. If the software were not programmed then the utility file would jump directly to program op-software. If software is programmed then check the part numbers to see if the software needs to be updated (see above use of the $1A and $53 Op-Codes). If the software part numbers match then the utility file can jump to just program the calibration section. Note also that the use of the $50 Op-Code needs to comprehend whether or not the ECU supports any of the memory failure responses ($5x) that the ECU may send when checking to see if software is present. 12. The utility files should be designed to compare part numbers of software components to determine if software and calibrations are to be programmed or just calibrations (see above descriptions on use of Op-Code $1A and Op-Code $53). It is not necessary (or desirable) to check individual calibration file part numbers in the utility file unless the ECU supports reprogramming of subsets of the calibration data files. If all calibration data files must be programmed as part of the same programming event it is not necessary to compare these part numbers. 13. The module Id field in the $B0 Op-Code must match the module Id field in the drawing file for the data part as well as the module Id field in the WWAPI wrapper. 14. The utility file should include an $A2 Op-Code after programming all data files. Success of the programming event would then be determined based on an $A2 response of $00 (fully programmed). Putting the $A2 Op-Code at the end ensures that a data size mismatch of the last programmed data file cannot result in a passed programming event and a non-functioning ECU. 15. The conclusion of part 1 and part 2 of the utility file are both signified by encountering either the end with success ($FF) Op-Code or end with error ($EE) Op-Code. There only needs to be one end with success and one end with error Op-Code. Both parts can conclude by jumping to the same end with success or end with error Op-Code. 16. It is not necessary to put Op-Code $01 in part 2 of the utility file. The value used in part 1 of the utility file will also be used in part 2.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
14
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
15
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
16
If the Op-Code (OP) Ignores No Communication Faults Continue reprogramming process Else Display the no communication screen Verification is received Check the goto fields for a FD return code (G0, G2, G4, G6, or G8) If a FD Return Code is Found Flag appropriate step to execute next and return Else Do While No Response Send the ALDL message again If This Is the Third Failure End reprogramming process as a no comm fault Endif this is the third failure End do while no response Endif an FD return code is found Endif the Op-Code (OP) ignores no communication faults
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
17
Do Return Type Processing Zero Check response byte 4 for return codes (set return code position to 3) Expect an AA return code for SUCCESS Enddo return type processing zero Do Return Type Processing One Ignore the response and return Enddo return type processing one Do Return Type Processing Two If Response Byte 3 is the Message Mode If Response Byte 4 is a 15 Check return code in response byte 5 (anything but 06 is a FAILURE) Else Mode number in response byte 3 is SUCCESS Endif response byte 4 is a 15 Else No response received from device Endif response 3 is the message mode Enddo return type processing is two Do Return Type Processing Three If Response Byte 4 is Equal to Block Number (AC1) return SUCCESS Else return FAILURE Endif response byte 4 is equal to Block Number (AC1) Enddo return type processing is three Do Return Type Processing Five (developed for EEPROM applications) Check response byte 3 for response If Response Byte 3 is Mode Number Return SUCCESS Endif response byte 3 is mode number Enddo return type processing five
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
18
Pseudo Code: XX 00 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use UART Return Type Processing of One. Build Mode 0 message as below Request Byte 1 2 3 4 Value AC0 01 00 CS Byte Description Device ID Message length Message mode Message checksum
Send Mode 0 message Goto step specified in goto field 1 (G1) Typical Interpreter Line: Step 01 Op-Code 00 Action Fields F4 00 00 00 Goto Fields FF 99 00 00 00 00
00 02
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
19
Pseudo Code: XX 01 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use UART Return Type Processing of One Build Mode 1 message as indicated in the table below: Request Byte 1 2 3 4 5 Value AC0 02 01 AC1 CS Byte Description Device ID Message length Message mode Message number requested Message checksum
If the Exception Is One (AC3=01) Wait for an F0 poll before sending message Endif the exception is one Send Mode 1 message Goto UART Return Type Processing Goto step specified in goto field 1 (G1) (this Op-Code ignores no communication fault) Typical Interpreter Line: Step 1F Op-Code 01 Action Fields F4 03 00 00 Goto Fields FF 99 00 00 00 00
00 20
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
20
02 Op-Code: Request memory dump from the device using Mode 2 (Saturn EEPROM)
Supported By: UART Interpreter 0 Description: The 02 Op-Code will build a standard mode 2 message to request a 64 byte memory dump from a device. Messages can consist of a single or multiple mode 2s, depending on the action fields. The calculated value is then compared against a previously stored value. In order to work correctly, a D4 Op=Code may need to be run prior to this one in order to create a valid value to compare against. Warning: In order for this code to work correctly, a D4 Op-Code may need to be run first. This will place a valid checksum or CAL ID in global storage against which we will perform a comparison. (Note: This is not necessary if AC3 = 02). Action Fields: AC0: AC1: AC2: AC3: Device ID High byte of address (needed only if AC3 = 02 or 04) Low byte of address (needed only if AC3 = 02 or 04) Exceptions. See pseudo code below 00 = multiple block read and checksum calculation. Compare against stored checksum. 01 = Read block and compare first two bytes to global checksum field 02 = Read block and exit No comparisons 03 = Read block and compare to global CAL ID 04 = Read block and compare ABS controller transmission option byte. 00 - Don't care
G0:
Pseudo Code: XX 02 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use UART Return Type Processing Five Build Mode 2 message as indicated in the table below Request Byte 1 2 3 4 5 6 Value AC0 03 02 AC1 AC2 CS Byte Description Device ID Message length Message mode High byte of address to read from Low byte of address to read from Message checksum
If the Exception is One or Three (AC3=01, AC3=03 or AC3 = 04) Send Mode 2 and receive response (64 data Bytes) Compare extracted value to stored value Endif the exception is one or three If the Exception is Two (AC3=02) Send Mode 2 and receive response (64 data Bytes) Compare extracted value to stored value End the exception is two If the Exception is Zero (AC3=0) While entire calibration has not yet been read from controller Send Mode 2 with address of next block Receive response Perform summation algorithm on new data block
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
21
(continued) End while Compare calculated checksum to stored checksum End the exception is zero Goto UART Response Processing Goto step specified in goto field 1 (G1) Typical Interpreter Line: Step 1F Op-Code 02 Action Fields F4 10 F7 00 Goto Fields FF 99 00 00 00 00
00 20
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
22
Pseudo Code: XX 03 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use UART Return Type Processing of Five Build Null Mode 3 message as indicated in the table below: Request Byte 1 2 3 4 Value AC0 01 03 00 Byte Description Device ID Message length Mode number Placeholder for checksum
Send Mode 3 and check for response Goto UART Return Type Processing If Response Byte 3 is Message Mode Indicate success Else If No Response Fail and indicate error Endif response byte 3 is message mode Goto step specified in goto field 1 (G1) Typical Interpreter Line: Step 0A Op-Code 03 Action Fields F4 00 00 00 Goto Fields 03 02 FD 99 FF 99 00 00 00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
23
Pseudo Code: XX 04 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use UART Return Type Processing of One Build Mode 4 message as indicated in the table below Request Byte 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Value AC0 0D 04 00 00 00 00 01 00 00 00 00 00 00 00 CS Byte Description Device ID Message length Message mode First data byte Second data byte Third data byte Fourth data byte Fifth data byte Sixth data byte Seventh data byte Eighth data byte Ninth data byte Tenth data byte Eleventh data byte Twelfth data byte Message checksum
Send Mode 4 message and receive response Goto UART Return Type Processing Build a Mode 5 message as exactly as indicated below (the interpreter builds and sends this message as part of the 04 Op-Code. A separate 05 Op-Code does not necessarily need to follow the 04 Op-Code): Request Byte 1 2 3 4 Value AC0 01 05 CS Byte Description Device ID Message length Message mode Message checksum
Use UART Return Type Processing of Zero Wait for an F0 poll (equivalent of the option AC1=01 shown in the description of 05 Op-Code)
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
24
(continued) Send the Mode 5 message and receive response Goto UART Response Processing Look for response byte 4 in Goto fields If Response Byte 4 is Found in Goto Fields Goto appropriate step Else Goto step indicated by FF goto field Endif response byte 4 is found in goto field Typical Interpreter Line: Step Op-Code 1F 04
Action Fields F4 00 00 00
04 20
Goto Fields FF 99 00 00 00 00
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
25
AC2: AC3:
Pseudo Code: XX 05 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use UART Return Type Processing of Zero Build Mode 5 message as below: Request Byte 1 2 3 4 Value AC0 01 05 CS Byte Description Device ID Message length Message mode Message checksum
If Exception is One or Two (AC1=01 or AC1=02) Wait for an F0 poll Endif exception is one or two If Exception is Two (AC1=02) Ignore no communications faults Endif exception is two Send Mode 5 message and receive response Goto UART Return Type Processing Look for response byte 4 in Goto fields If Response Byte 4 (AA) is Found in Goto Fields Goto appropriate step Else Goto step indicated by FF goto field Endif response byte 4 is found in goto field Typical Interpreter Line: Step 10 Op-Code 05 Action Fields F4 01 00 00 Goto Fields 05 0D FF 99 00 00
AA 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
26
G0: XX
Pseudo Code: UART Return Type Processing is based on exception. Build Mode 8 message as below Request Byte 1 2 3 4 Value AC0 01 08 CS Byte Description Device ID Message length Message mode Message checksum
If the Exception is One or Three (AC3=01 or AC3=03) If the Device ID is F1 Wait for an F0 poll with Tech 2 as Master (For Electric Vehicle) Else Wait for an F0 poll with Tech 2 as Slave (Normal F0 processing) Endif the device ID is F1 Else Do not wait for an F0 poll Endif the exception is one or three Send Mode 8 message If the Exception is Zero or One (AC3=00 or AC3=01) Wait for a response Verify correct response Else Do not wait for a response (ignore) Endif the exception is zero or one Goto step specified in the goto fields Typical Interpreter Line: Step 01 Op-Code 08 Action Fields F4 00 00 00 Goto Fields FF 99 00 00 00 00
00 02
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
27
Pseudo Code: XX 09 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Use UART Return Type Processing of One. Build Mode 9 message as below Request Byte 1 2 3 4 Value AC0 01 09 CS Byte Description Device ID Message length Message mode Message checksum
Send Mode 9 message and receive response. Goto UART Return Type Processing (Op-Code ignores no communications faults). Goto step specified in goto field 1 (G1) Typical Interpreter Line: Step 01 Op-Code 09 Action Fields F4 00 00 00 Goto Fields FF 99 00 00 00 00
00 02
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
28
Pseudo Code: XX 0A AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use UART Return Type Processing of One (ignore). Build Mode 8 message as below Request Byte 1 2 3 4 Value F4 01 08 CS Byte Description Device ID Message length Message mode Message checksum
Send the Mode 8 response to break normal communications. Ignore the response. Build Mode 10 message as below Request Byte 1 2 3 4 Value AC0 01 0A CS Byte Description Device ID Message length Message mode Message checksum
Send Mode 10 message and ignore the response. Goto step specified in goto field 1 (G1) Typical Interpreter Line: Step 01 Op-Code 0A Action Fields F4 00 00 00 Goto Fields FF 99 00 00 00 00
00 02
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
29
AC3:
Pseudo Code: XX Use UART Return Type Processing of Three Build Mode 12 message as below Request Byte 1 2 3 4 5 5+N 6+N Value AC0 N+2 0C AC1* XX Byte Description Device ID Message length Message mode Block number Data byte 1 The pseudo code below explains how the data portion of this request is filled Data byte N Message checksum
XX CS
* Use first routine byte if AC2 is $10 If the Exception is Zero (AC2 is 00) Copy the VIN into the data area of the message starting at data byte 1 ElseIf the Exception is One (AC2 is 01) Copy the End Model part number into the data area of the message starting at data byte 1 ElseIf the Exception is Two (AC2 is 02) Reset the manufacturers enable counter to zero ElseIf the Exception is Three (AC2 is 03) (Used for Electric Vehicle) If AC0 is 0xF4 Write key code to the PCM (Electric Vehicle) Else Write key code to the CCU (Electric Vehicle) ElseIf the Exception is Four (AC2 is 04) (Used for Electric Vehicle) While state of charge data remains Create new mode 12 command with appropriate block number Send the new mode 12 and receive response Endwhile
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
30
(continued) ElseIf the Exception is Ten Hex or Sixteen Decimal (AC2 is $10) Copy Routine specified by AC1 into message. The first byte is used as block number (Request Byte 4) and all following bytes as data (Request Byte 5 and following) Endif exception processing If AC3 is 01 Wait for an F0 poll before sending message Endif AC3 is 01 If AC2 is Not Equal to Four Send 12 message and receive response Endif AC2 is not equal to four Look for response byte 4 in Goto fields (Block Number) If Matching Block Number is Found Goto appropriate step Else Goto step indicated by FF goto field Endif matching block number is found Typical Interpreter Line: Step 21 Op-Code 0C Action Fields F4 01 00 00 Goto Fields FF 99 00 00 00 00
01 22
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
31
Pseudo Code: XX 0D AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use UART Return Type Processing of Zero Build mode 13 security seed request as indicated in the table below Request Value Byte Description Byte 1 AC1 Device ID 2 02 Message Length 3 0D Message mode 4 01 Request number 5 CS Message checksum Send mode 13 seed request and receive response Goto UART Return Type Processing If Both Bytes of the Seed (response bytes 5 & 6) are Zeros Set security response byte 5 to success (AA) Indicate successful response Else Use specified security algorithm to determine device's key Build mode 13 security key response as indicated in the table below Request Value Byte Description Byte 1 AC1 Device ID 2 04 Message Length 3 0D Message mode 4 02 Request number 5 XX High byte of key 6 XX Low byte of key 9 CS Message checksum Send Mode 13 key response and receive response Goto UART Return Type Processing Endif both bytes of the seed (response bytes 5 & 6) are zeros Look for mode 13 key response byte 5 in goto fields If Mode 13 Key Response Byte 5 is Found Goto appropriate step Else Goto step indicated by FF goto field Endif Mode 13 Key Response Byte 5 is Found Typical Interpreter Line: Step 01 Op-Code 0D Action Fields 00 F4 00 00 Goto Fields 27 22 FF 55 00 00
AA 02
00 00 Page 32
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Pseudo Code: XX 20 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use UART Return Type Processing of Five Build Mode 1 message as indicated in the table below Request Byte 1 2 3 4 Value AC0 01 20 CS Byte Description Device ID Message length Message mode Message checksum
Send message and receive response (up to 256 Bytes) Goto UART Response Processing If the Exception is One or Two (AC2=01 or AC2=02) Extract odometer value from incoming message I Initialize return code to FAILURE If AC2=00 Store read odometer value in VIT2 Structure Set return code to SUCCESS Elseif AC2=01 and received odometer value is <= value in VIT2 structure Set return code to SUCCESS Elseif AC2=02 and received odometer value is = value in VIT2 structure Set return code to SUCCESS Endif Endif the exception is one or two Goto step specified in goto field 1 (G1), this Op-Code ignores no communication faults Typical Interpreter Line: Step 1F OpCode 20 Action Fields 21 00 02 00 Goto Fields 21 20 FD 99 FF 99 00 00 00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
33
A3 Op-Code Read Data from Specified Sequential Addresses (Electric Vehicle) Mode 3
Supported By: UART Interpreter 0 Description: The A3 Op-Code is used to read the data from the specified two byte addresses of a controller. It was developed specifically for reprogramming the key code of the CCU/RSA controller of the EV1 electric vehicle. To use the Op-Code, the target controller must have normal communication discontinued. The addresses will all be sequential starting from the address indicated in the actions fields. The number of addresses can be varied based on the value of AC1. See the pseudo code for more detailed information concerning Op-Code function. Action Fields: AC0: AC1: AC2: AC3: Target Device ID Number of Addresses to Read (including the address specified in AC2 & AC3) High Byte of Starting Address Low Byte of Starting Address
Pseudo Code: XX D0 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use UART Return Type Processing Five Build Mode 03 Address Read as indicated in the table below. Contents of the XX locations are detailed in the pseudo code following the table. Request Byte 1 2 3 4 5 6 7 1 + M +1 Value AC0 1+M 03 AC XX XX XX Byte Description Device ID Message mode + (AC1 multiplied by 2) Message mode High byte of starting address Low byte of starting address High byte of second address Low byte of second address High and low byte of each consecutive address to read. 1 byte request checksum
CS
Build mode 03 message through low byte of starting address. Combine the high and low byte of starting address into one number. Increment the starting address by one. Load the new address value in the next two message bytes. Continue to increment and load the addresses until number of addresses indicated in AC1 is met. Send the message and expect a response of 03 in the mode position. Typical Interpreter Line: Step 08 Op-Code A3 Action Fields F3 05 1F 20 00 09 Goto Fields FD 12 FF 4A 00 00 00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
34
Pseudo Code: XX C0 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Use UART Return Type Processing of Three. Build Download message as indicated in the table below. Contents of the XX locations is detailed in pseudo code following the table Request Byte 1 2 3 4 5 6 6+N 7+N Value AC2 3+N 06 XX XX XX Byte Description Device ID Message length Message mode High byte of message address Low byte of message address Data byte 1 The pseudo code below explains how the data portion of this request is filled Data byte N (N <= maximum as defined in pseudo code) 1 byte request checksum
XX CS
If the Exception is Zero (AC3=00) or the Exception is One (AC3=01) Expect an AA return code for SUCCESS (set return type processing to 0) Check response byte 4 for return codes (set return code position to 3) If AC1 is Not 0 Retrieve section AC1 and assign to prolog Endif AC1 is Not 0 Retrieve section AC0 and assign to routine Set maximum packet to 167 (SFI-66U & PCM-66U) Endif exception is zero or exception is one If the Exception is Two (AC3=02) Expect a 06 return code for success (set return type processing to 2) For failures or last packets expect a 15 in response byte 4 and a return code in response byte 5 Check response byte 3 for message mode (set return code position to 2) Retrieve section AC0 and assign to routine Assign value in AC1 as prolog Set maximum packet to 60 bytes (VCM-1) Endif the exception is two If the Exception is Three (AC3=03) - developed for EEPROM applications Expect an 06 return code for success (set return type processing to 5) Check response byte 3 for message mode (set return code position to 2)
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
35
(continued) Retrieve section AC0 and assign to routine Assign value in AC1 as prolog Set maximum packet to 114 bytes Endif the exception is three If Routine Length is Greater than Maximum Packet # of packets = routine length / (maximum packet - prolog length) Last message length = remainder of routine length / (maximum packet - prolog length) Addresses are calculated from highest load address to lowest load address If Exception is Two or Three (AC3=02 or AC3=03) Use value in AC1 as the prolog; copy AC1 into data byte 1 of message buffer Else Copy prolog into data area of message starting at data byte one Endif exception is two or three Do while More Packets If This is the Last Packet Change message length to last message length+3 Set the two byte packet address to the low two bytes of the four byte address in the routine Copy the last message from the routine overlaying the prolog (no prolog on last packet) Else Calculate appropriate two byte packet address Copy calculated packet address into message buffer Copy a piece of the routine into message buffer Endif this is the last packet Send the message and expect a response If Exception is Two or Three (AC3=02 or AC3=03) If Message Response was SUCCESS (06 in position 3) Loop and continue sending packets Else Indicate FAIL Endif message response was a success Else If Message Response was SUCCESS (AA in position 4) Loop and continue sending packets Else Indicate FAIL Endif message response was SUCCESS Endif exception is two End do while more packets Else Use low two bytes of the four byte address in the routine for message address Copy routine into message buffer, NO prolog on packet Send the message and expect a response Endif routine length is greater than maximum packet If Exception is One (AC3=01) Do while response byte 4 is $55 Wait for another response End do while response is $55 Endif exception is one Look for response byte 4 in Goto fields If Response Byte 4 is Found Goto appropriate step Else Goto step indicated by FF goto field Endif response byte 4 is found Typical Interpreter Line: Step Op-Code 10 C0 Action Fields 01 39 F4 02 Goto Fields 04 0D FD 20 FF 49
06 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
36
Pseudo Code: XX C1 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use UART Return Type Processing of Two. Build Mode 16 Download Request as indicated in the table below. Contents of the XX locations is detailed in pseudo code following the table Request Byte 1 2 3 4 5 6 7 7+N 8+N Value AC3 4+N 10 XX XX XX XX Byte Description Device ID Message length Message mode High byte of load address Middle byte of load address Low byte of load address Data byte 1 The pseudo code below explains how the data portion of this request is filled Data byte N (N <= maximum as defined in pseudo code) 1 byte request checksum
XX CS
For failures or last packets expect a 15 in response byte 4 and a return code in response byte 5 and Expect a 06 return code for success (set return type processing to 2) Check response byte 3 for message mode (set return code position to 2) Retrieve section AC0 and assign to routine Set maximum packet to 60 If Routine Length is Greater than Maximum Packet # Of packets = routine length / (maximum packet - prolog length) Last message length = remainder of routine length / (maximum packet - prolog length) If remainder of the routine length is 0 Reduce the number of messages sent with a prolog by one Endif remainder of the routine length is 0 Addresses are calculated from high to low memory so last packet can be executed once downloaded Copy AC1 into next data byte of data area, this is high byte of prolog Copy AC2 into next data byte of data area, this is low byte of prolog Do while More Packets If This is the Last Packet Change message length to last message length+4
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
37
(continued) Set three byte message address to the low three bytes of the four byte address in the routine Copy the last message from the routine overlaying the prolog (no prolog in last packet) Else Calculate appropriate two byte packet address for next data packet Copy calculated packet address into message buffer Copy a piece of the routine into message buffer Endif this is the last packet Send the message and expect a response Goto UART Return Type Processing If Message Response was SUCCESS (10 in position 3) Loop and continue sending packets Else Indicate FAIL Endif message response was SUCCESS End do while more packets Else Routine Length is Not Greater than Maximum Packet Copy routine into message buffer, no prolog in message Send the message and expect a response Goto UART Return Type Processing Endif routine length is greater than maximum packet Look for response byte 3 in Goto fields If Response byte 3 is Found Goto appropriate step Else Goto step indicated by FF goto field Endif response byte 3 is found Typical Interpreter Line: Step 10 Op-Code C1 Action Fields 01 4E 75 F4 Goto Fields 05 0D FF 99 00 00
10 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
38
C2 Op-Code: Download Routine to RAM and Save Two Byte Response using Mode 6
Supported By: UART Interpreter 0 Description: The C2 Op-Code is processed exactly like the C0 Op-Code except for response processing. If a valid response is received from the Mode 6 command, positions 4 and 5 of the response are saved. The Action Field 3 (AC3) is the ID of the bytes saved. The valid ID's are 0x00 thru 0x13. Note: Only twenty (20) two byte responses can be saved before ID positions must be reused. Note: If the routine can be downloaded in one packet no prolog is need. See the Pseudo code for more information on maximum packet sizes. Action Fields: AC0: AC1: AC2: AC3: Section Number of Routine Section Number of Prolog. Device ID ID of saved bytes (0x00 0x13)
Pseudo Code: XX C2 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
The message build and transmit portion of this Op-Code is identical to the C0 Op-Code. The only change is after a successful response is returned from the control module. If Successful Response is Received Save two bytes from the response to storage ID indicated by AC3 (bytes 5 & 6 of response are saved) Endif successful response is received Look for response byte 4 in Goto fields If Response Byte 4 is Found Goto appropriate step Else Goto step indicated by FF goto field Endif response byte 4 is found Typical Interpreter Line: Step 10 Op-Code C2 Action Fields 04 03 F4 09 Goto Fields 05 0D FF 99 00 00
AA 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
39
C3 Op-Code: Download Routine to RAM and Execute using Mode 6 (Electric Vehicle)
Supported By: UART Interpreter 0 Description: The C3 Op-Code builds and sends an ALDL mode 6 download routine message. It is used to send routines with a prolog to the RAM of the device being reprogrammed. This Op-Code was developed specifically for the EV1 electric vehicle BTCM controller because the controller does not respond to each download and uses a one byte prolog. As with the C0 Op-Code, if the entire routine can be sent in one message, it will be sent without a prolog. If it cannot be sent in one message, then the routine is split evenly and a prolog is sent with each message except for the last one. A C3 Op-Code should always be preceded by a Mode 5 (Op-Code 05) message unless the module is already prepared to accept a mode 6. Note: See Pseudo code for more information on maximum packet sizes. Action Fields: AC0: AC1: AC2: AC3: Section Number of Routine Prolog Value Device ID Not Used
Pseudo Code: XX C0 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use UART Return Type Processing of One. Build Download message as indicated in the table below. Contents of the XX locations is detailed in pseudo code following the table Request Byte 1 2 3 4 5 6 6+N 7+N Value AC2 3+N 06 XX XX XX Byte Description Device ID Message length Message mode High byte of message address Low byte of message address Data byte 1 The pseudo code below explains how the data portion of this request is filled Data byte N (N <= maximum as defined in pseudo code) 1 byte request checksum
XX CS
Retrieve section AC0 and assign to routine Retrieve the address from the routine header Assign value in AC1 as prolog Set maximum packet size to 60 bytes Send the Mode 6 message and do not expect a response.
If Routine Length is Greater than Maximum Packet # Of packets = routine length / (maximum packet - prolog length) Last message length = remainder of routine length / (maximum packet - prolog length) Addresses are calculated from highest load address to lowest load address Use value in AC1 as the prolog; copy AC1 into data byte 1 of message buffer Do while More Packets
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
40
(continued) If This is the Last Packet Change message length to last message length+3 Set the two byte packet address to the low two bytes of the four byte address in the routine Copy the last message from the routine overlaying the prolog (no prolog on last packet) Else Calculate appropriate two byte packet address Copy calculated packet address into message buffer Copy a piece of the routine into message buffer DO NOT include a prolog Endif this is the last packet Send the message and do not expect a response Loop and continue sending packets End do while more packets Else Use low two bytes of the four byte address in the routine for message address Copy routine into message buffer, NO prolog on packet Send the message do not expect a response Endif routine length is greater than maximum packet
00 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
41
Pseudo Code: XX C4 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Build Mode 20 RAM Download Request as indicated in the table below. Contents of the XX locations is detailed in pseudo code following the table Request Byte 1 2 3 4 5 6 7 7+N 8+N Value AC0 4+N 14 XX XX XX XX Byte Description Device ID Message length Message mode High byte of download address Middle byte of download address Low byte of download address Data byte 1 The pseudo code below explains how the data portion of this request is filled Data byte N (N <= maximum as defined in pseudo code) 1 byte request checksum
XX CS
Retrieve section AC1 and assign to routine Get download address from routine address Get number of bytes to download from routine size Get packet length from utility file header Do while number of bytes to download not yet 0 If number of bytes to download is greater than packet length Limit packet length to number of bytes to download Endif number of bytes to download is greater than packet length Copy download address into message bytes 4.6 Copy next data block from routine into message starting with byte 7, packet length specifies the number of bytes to copy. Send the message and expect a response If message response was SUCCESS If the response byte 3 is $14 (expected mode) If response byte 4 is $06 (download completed) Increment the download address by the packet size Decrement the number of bytes to download by the packet length
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
42
(continued) Else Break the loop Endif response byte 4 is $06 (download completed) Else Set message response FAILURE Break the loop Endif the response byte 3 is $14 (expected mode) Else Break the loop Endif message response was SUCCESS Enddo while number of bytes to download not yet 0 If message response was SUCCESS Set response code to response byte 4 Else Set response code to NO COMM Endif message response was SUCCESS Look for response code in Goto fields If response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif response code is found Typical Interpreter Line: Step 10 Op-Code C4 Action Fields E4 03 00 00 Goto Fields 15 0D FF 99 00 00
06 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
43
Pseudo Code: XX C5 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Build Mode 21 RAM Execute Request as indicated in the table below. Contents of the XX locations is detailed in pseudo code following the table Request Byte 1 2 3 4 5 6 7 Value AC0 04 15 XX XX XX CS Byte Description Device ID Message length Message mode High byte of start address Middle byte of start address Low byte of start address 1 byte request checksum
Retrieve section AC1 and assign to routine Get start address from routine address Copy start address into message bytes 4.6 Send the message and expect a response If message response was SUCCESS If the response byte 3 is not $15 (expected mode) Set message response FAILURE Endif the response byte 3 is not $15 (expected mode) Endif message response was SUCCESS If message response was SUCCESS Set response code to response byte 4 Else Set response code to NO COMM Endif message response was SUCCESS Look for response code in Goto fields If response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif response code is found Typical Interpreter Line: Step 10 Op-Code C5 Action Fields E4 03 00 00 06 11 Goto Fields 15 0D FF 99 00 00 00 00 Page 44
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Pseudo Code: XX D0 AC0 AC1 AC2 AC3 Find the file with ID equal to AC0 Load the file into memory Build Mode 6 Download Request as indicated in the table below, contents of the XX locations is detailed in pseudo code following the table Request Byte 1 2 3 4 5 6 6+N+M 7+N+M Value AC2 6+N+M 06 XX XX XX Byte Description Device ID Message length (N is prolog length, M data bytes in message) Message mode High byte of load address Low byte of load address Data byte 1 The pseudo code below explains how the data portion of this request is filled Data byte N (N <= maximum as defined in pseudo code) 1 byte request checksum G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
XX CS
If the Exception is Zero (AC3=00) Expect an AA return code for success (set return type processing to 0) Check response byte 4 for return codes (set return code position to 3) Retrieve section AC1 and assign to the prolog Set message length to 6 + prolog length + data packet length Copy high byte of prolog address into data byte 1 of buffer Copy low byte of prolog address into data byte 2 of buffer Copy prolog into buffer starting at byte 3 Copy high byte of data address information from the Header into the data buffer Copy low byte of data address information from the Header into the data buffer Endif the exception is zero
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
45
(continued) If the Exception is One (AC3=01) Expect a 06 return code for success (set return type processing to 2) For failures or last packets expect a 15 in response byte 4 and a return code in response byte 5 Check response byte 3 for message mode (set return code position to 2) Set message length to 4 + data packet length Copy high byte of data address information from the Header into the data buffer byte 1 Copy low byte of data address information from the Header into the data buffer byte 2 Copy AC1 into data buffer byte 3 to be used as a prolog Endif the exception is one If the Exception is Two (AC3=02) - (developed for EEPROM applications) Expect a 06 return code for success (set return type processing to 2) For failures or last packets expect a 15 in response byte 4 and a return code in response byte 5 Check response byte 3 for message mode (set return code position to 2) Retrieve section AC1 and assign to the prolog Set message length to 6 + prolog length + data packet length Copy high byte of prolog address into data byte 1 of buffer Copy low byte of prolog address into data byte 2 of buffer Copy prolog into buffer starting at byte 3 Copy high byte of data address information from the Header into the data buffer Copy low byte of data address information from the Header into the data buffer Endif the exception is two Do while more data to download Copy M data bytes into message buffer following the front end Put message checksum at end of data buffer Send message and receive the response If Exception is Zero or Two (AC3=00 or AC3=02) Increment message data address by number of data bytes downloaded in message Else If Exception is One (AC3=01) Use the same address for all data packets Endif exception is one Endif exception is zero or two Update and display percent downloaded End do while more data to download Look for response byte 4 in Goto fields If Response Byte 4 is Found Goto appropriate step Else Goto step indicated by FF goto field Endif response byte 4 is found Typical Interpreter Line: Step 08 Op-Code D0 Action Fields 01 03 F4 00 Goto Fields FD 12 FF 4A 00 00
AA 09
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
46
Pseudo Code: XX D1 AC0 AC1 AC2 AC3 Find the file with ID equal to AC0 Load the file into memory Expect a 06 return code for success (set return type processing to 2) For failures or last packets expect a 15 in response byte 4 and a return code in response byte 5 Check response byte 3 for message mode (set return code position to 2) Build Mode 6 Download Request as indicated in the table below, contents of the XX locations is detailed in pseudo code following the table Request Byte 1 2 3 4 5 6 7 7+N+M 8+N+M Value AC3 4+M 10 XX XX XX XX Byte Description Device ID Message length (M is data bytes in message) Message mode High byte of load address Middle byte of load address Low byte of load address Data byte 1 The pseudo code below explains how the data portion of this request is filled Data byte M (M <= maximum as defined in pseudo code) 1 byte request checksum
XX CS
Copy high byte of data load address from the Utility header into message Copy middle byte of data load address from the Utility header into message Copy low byte of data load address from the Utility header into message Copy AC1 into data area of message as the high byte of the prolog into data byte 1 Copy AC2 into data area of message as the high byte of the prolog into data byte 2 Do until all of the data is downloaded Copy next packet of data into message buffer at data byte 3, packet size is from header Copy message checksum at end of data area of message Send message and receive the response Goto UART Return Type Processing Update and display percent downloaded End do when all of the data is downloaded Look for response byte 3 in Goto fields If response byte 3 is found Goto appropriate step Else Goto step indicated by FF goto field Endif response byte 3 is found Typical Interpreter Line: Step 98 Op-Code D1 Action Fields 02 4E 75 00 06 11 Goto Fields 05 0D FF 99 00 00 00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
47
AC2: AC3:
Pseudo Code: XX D2 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Build Mode 6 or 16 Download Request as indicated in the table below, contents of the XX locations is detailed in pseudo code following the table Request Byte 1 2 3 4 5 6 6+N+M 7+N+M Value AC2 4+M 06 or 10 XX XX XX Byte Description Device ID Message length (M is data bytes in message) Message mode High byte of load address Middle of low byte of load address Low byte of load address or data byte 1 The pseudo code below explains how the data portion of this request is filled Data byte N (N <= maximum as defined in pseudo code) 1 byte request checksum
XX CS
If the Exception is Zero (AC3=00) Use two byte addressing Expect a 06 return code for success (set return type processing to 2) For failures or last packets expect a 15 in response byte 4 and a return code in response byte 5 Check response byte 3 for message mode (set return code position to 2) Set message mode to 06 Copy high byte of data load address from the Utility header into message Copy low byte of data load address from the Utility header into message Reserve this byte for high byte of module checksum Reserve this byte for low byte of module checksum Copy AC0 into data area of message as the module ID Copy AC1 into data area of message as the prolog Endif the exception is zero If the Exception is One (AC3=01) Use three byte addressing Set the return type processing to 2 Set the return code position to 3
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
48
(continued) Set message mode to 10 Copy high byte of data load address from the Utility header into message Copy middle byte of data load address from the Utility header into message Copy low byte of data load address from the Utility header into message Reserve this byte for high byte of module checksum Reserve this byte for low byte of module checksum Copy AC0 into data area of message as the module ID If the Prolog Identifier is Zero (AC1=00) Copy 4E into data area of message as the high byte of the prolog Copy 75 into data area of message as the low byte of the prolog Endif the prolog identifier is zero Endif the exception is one Copy VIN data into data area of message following the prolog Calculate module checksum by adding all bytes from module ID through VIN Copy module checksum into module checksum area of message Copy message checksum at end of data area of message Send message and receive the response Goto UART Return Type Processing Update and display percent downloaded If Response Byte in Position 4 is 15 Look for response byte 5 in goto fields If Response byte 5 is Found Goto appropriate step Else Goto step indicated by FF goto field Endif response byte 5 is found Else Error invalid response from module Endif response byte in position 4 is 15 Typical Interpreter Line: Step 98 Op-Code D2 Action Fields 06 00 F4 01 Goto Fields FD A0 FF A9 00 00
06 99
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
49
Pseudo Code: XX D4 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
This Op-Code use return type processing one (ignore response). Find the routine with section equal to AC0 + 1 (This is the header block associated with the routine stored at section AC0) Extract required information Find the routine with section equal to AC0 (This is the actual download and run routine) Load this data into the download request buffer
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
50
(continued) Build Mode 6 Download Request as indicated in the table below, contents of the XX locations is detailed in pseudo code following the table Request Byte 1 2 3 4 5 6 6+N+M 7+N+M Value AC2 6+N+M 06 XX XX XX Byte Description Device ID Message length (N is prolog length, M data bytes in message) Message mode High byte of load address Low byte of load address Data byte 1 The pseudo code below explains how the data portion of this request is filled Data byte N (N <= maximum as defined in pseudo code) 1 byte request checksum.
XX CS
If the Exception is One, Two, Three, Four, Five, Six, or Seven (AC3 > 0) Copy data bytes from appropriate locations Overlay the copied data bytes into the data portion of the routine Update size bytes appropriately Update global checksum if necessary Send a mode 5 message and receive reply Fail if error Send message to write the specified information Endif the exception is greater than zero processing If the Exception is Equal to Zero (AC3 = 0) Find the calibration file with ID equal to AC0 Load the file into memory Overlay adaptive data from VIT2 to appropriate location in calibration data (if required) Do while more data to download Copy M data bytes into message buffer at the appropriate location If Device ID is F2 Wait for F0 poll with the Tech 2 as Master else Wait for F0 poll with the Tech 2 as Slave Endif device id is F2 Send a mode 8 message Send a mode 5 message and check response If the Mode 5 Response is Not Valid Send the Mode 8 and Mode 5 message up to three more times If Response is Valid Continue with Mode 6. Else Fail with error. Endif response is valid Endif the mode 5 response is not valid Send the Mode 6 message to write the calibration data Ignore any response Increment message data address by number of data bytes downloaded in message Update and display percent downloaded End do while more data to download Update global checksum field for later processing. Endif the exception is equal to zero Typical Interpreter Line: Step 08 Op-Code D4 Action Fields 01 00 F4 00 00 09 Goto Fields FD 12 FF 4A 00 00 00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
51
Pseudo Code: XX D0 AC0 AC1 AC2 AC3 Find the file with ID equal to AC0 Load the file into memory Build Mode 12 Download Request as indicated in the table below, contents of the XX locations is detailed in the pseudo code following the table Request Byte 1 2 3 4 5 6 6+N+M 7+N+M Value AC2 6+M 06 XX XX XX Byte Description Device ID Message length (M data bytes in message) Message mode High byte of load address Low byte of load address Data byte 1 The pseudo code below explains how the data portion of this request is filled Data byte N (N <= maximum as defined in pseudo code) 1 byte request checksum G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
XX CS
Copy high byte of data address information from the calibration file header into the data buffer Copy low byte of data address information from the calibration file header into the data buffer Expect a 00 in position 3 for success Do while more data to download Copy M data bytes into message buffer following the front end Put message checksum at end of data buffer Send message and receive the response Increment message data address by number of data bytes downloaded in message Update and display percent downloaded End do while more data to download Send a Mode FF message; do not expect a response. Typical Interpreter Line: Step 08 Op-Code D5 Action Fields 01 F9 00 00 00 09 Goto Fields FD 12 FF 4A 00 00 00 00 Page 52
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Pseudo Code: XX D6 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Build Mode 22 Flash Erase Request as indicated in the table below. Contents of the XX locations is detailed in pseudo code following the table Request Byte 1 2 3 4 5 Value AC0 4+N 16 XX CS Byte Description Device ID Message length Message mode Block number 1 byte request checksum
Copy AC1 address into message byte 4 Send the message and expect a response If message response was SUCCESS If the response byte 3 is not $16 (expected mode) Set message response FAILURE Endif the response byte 3 is not $16 (expected mode) Endif message response was SUCCESS If message response was SUCCESS Set response code to response byte 5 Else Set response code to NO COMM Endif message response was SUCCESS Look for response code in Goto fields If response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif response code is found Typical Interpreter Line: Step 10 Op-Code D6 Action Fields E4 01 00 00 Goto Fields 15 0D FF 99 00 00
06 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
53
Pseudo Code: XX D7 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Build Mode 23 Flash Program And Verify Request as indicated in the table below. Contents of the XX locations is detailed in pseudo code following the table
Byte Description Device ID Message length Message mode High byte of download address Middle byte of download address Low byte of download address Data byte 1 The pseudo code below explains how the data portion of this request is filled Data byte N (N <= maximum as defined in pseudo code) 1 byte request checksum
XX CS
Find the file with ID equal to AC1 Load the file into memory If AC3 is $00 Get download address from utility file header Else Get download address from global address (must be set by Op-Code $F1) Endif AC3 is $00 Get number of bytes to download from file size Get packet length from utility file header Do while number of bytes to download not yet 0 If number of bytes to download is greater than packet length Limit packet length to number of bytes to download Endif number of bytes to download is greater than packet length Copy download address into message bytes 4.6 Copy next data block from file into message starting with byte 7, packet length specifies the number of bytes to copy Send the message and expect a response 1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved. Page 54
(continued) If message response was SUCCESS If the response byte 3 is $17 (expected mode) If response byte 4 is $06 (download completed) Increment the download address by the packet size Decrement the number of bytes to download by the packet length Else Break the loop Endif response byte 4 is $06 (download completed) Else Set message response FAILURE Break the loop Endif the response byte 3 is $17 (expected mode) Else Break the loop Endif message response was SUCCESS Enddo while number of bytes to download not yet 0 If message response was SUCCESS Set response code to response byte 4 Else Set response code to NO COMM Endif message response was SUCCESS Look for response code in Goto fields If response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif response code is found Typical Interpreter Line: Step 10 Op-Code D7 Action Fields E4 01 00 00 Goto Fields 15 0D FF 99 00 00
06 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
55
Pseudo Code: XX D8 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Build Mode 24 Flash Memory Execute Request as indicated in the table below. Contents of the XX locations is detailed in pseudo code following the table Request Byte 1 2 3 4 5 6 7 Value AC3 04 18 XX XX XX CS Byte Description Device ID Message length Message mode High byte of start address Middle byte of start address Low byte of start address 1 byte request checksum
Copy start address from AC1.AC3 into message bytes 4.6 Send the message and expect a response If message response was SUCCESS If the response byte 3 is not $18 (expected mode) Set message response FAILURE Endif the response byte 3 is not $18 (expected mode) Endif message response was SUCCESS If message response was SUCCESS Set response code to response byte 4 Else Set response code to NO COMM Endif message response was SUCCESS Look for response code in Goto fields If response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif response code is found Typical Interpreter Line: Step 10 Op-Code D8 Action Fields E4 00 00 00 06 11 Goto Fields 15 0D FF 99 00 00 00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
56
Pseudo Code: XX F0 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Do While Wait Time is Not Greater than (AC1*100ms) Wait for a poll from device ID AC0 End do Goto step specified in goto field 1 (G1), this Op-Code ignores no communication faults Typical Interpreter Line: Step 10 Op-Code F0 Action Fields F4 05 00 00 Goto Fields FF 99 00 00 00 00
00 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
57
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
58
Pseudo Code: XX OP AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
If no comm. occurred If the Op-Code Ignores No Communication Faults (Ignore Error or Ignore Response) Continue reprogramming event based on specific Op-Code logic Else Check goto fields for an FD return code (G0, G2, G4, G6, or G8) If found (FD) Flag appropriate step to execute next and return Else Check goto fields for an FF return code (G0, G2, G4, G6, or G8) If found (FF) Flag appropriate step to execute next and return Else End programming with fatal error Endif Endif Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 11 Op-Code OP Action Fields B4 03 10 00 Goto Fields FD 2A FF 4A 00 00
65 12
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
59
** Note: - There are some Class 2 Op-Codes that send out a request and do not look for a response (i.e. Ignore Response). - There are some Class 2 Op-Codes that send out a request and dont care if there are no responses (i.e. Ignore Error). - There are some Class 2 Op-Codes that do not support the no comm. (FD) processing. These special cases are defined within the individual Class 2 Op-Codes. Pseudo Code: Ignore Response Processing If the op-code specifies a response processing type of Ignore Response No response messages will be processed (read) from the vehicle communication link. Response processing will return immediately with Success after the request has been transmitted Endif Ignore Error Processing If the op-code specifies a response processing type of Ignore Error The response data (one or more messages) WILL be processed (read) from the vehicle communication link (based on FE Response Processing or Individual Device Response Processing). Regardless of whether the response is a positive, negative, or no response is received, response processing will return with Success Endif FE (all devices) Response Processing If the request message is targeted to all (FE) devices Process the response from the controller(s) on the vehicle communication link (only for controllers that respond to the FE request) If a negative (7F) response is processed from one of the responding controllers Return immediately with failed (negative response) and the data from the negative response Endif Wait for 2 seconds of no responses being processed (idle vehicle communication link) If after 2 seconds there have been NO responses processed (zero in total) Return with a no communication response Else Return with Success and the data from the last response processed Endif Endif
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
60
Individual Device Response Processing If the request message is targeted to a specific device (ex. $10, $11, $18, $28, $40, ) Process the response from the controller on the vehicle communication link If a positive response was received (Response Message ID = Mode Number + $40) Return with Success and the positive response data Endif If a negative response was received (Response Message ID = 0x7F) If the last byte of the response is a $23 (Routine Not Complete) Wait up to one more second for an additional (positive/negative) response
(continued)
If no more responses are received (in the 1 second) Return with failed (negative response) and the data from the (0x7F . . . 0x23) response Endif Endif If the Response Message target address does not equal the Request Message source address Keep attempting to process responses from the controller If no more responses are received (in the remaining amount of time) Return with failed (negative response) and the data from the mis-matched target/source response Endif Endif Endif If no response was ever received from the individual device Return with a No Communication response Endif Special Mode $36 Response Processing If a positive response was received (Response Message ID = $76) If response code data byte is a $78 or a $6F (Response Data Byte #2 action not yet complete) Keep attempting to process responses from the controller until a true positive or negative is received Endif Endif Endif
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
61
Pseudo Code: XX 01 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Set global source address to value in AC0 If AC1 = 00 Turn periodic 3F transmission to all devices (Target address = "FE") OFF Else Turn periodic 3F transmission to all devices (Target address = "FE") ON Endif AC1 = 00 Goto step specified by goto field one (G1) Typical Interpreter Line: Step 01 Op-Code 01 Action Fields F0 01 00 00 Goto Fields 00 00 0 00 00 00
00 02
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
62
Note: This Op-Code is NOT functional within the software application (i.e. A request to initiate a
Diagnostic Operation Mode will never be sent out over the vehicle communication link.) The response processing will be based on GOTO field G1. The 10 Op-Code is used to inform devices on the serial data link that the tool is ready to start diagnostic procedures using the link and the devices on the link may need to alter their normal operation. (This Op-Code is seldom used in programming. It was used only by truck in the 1995 model year.) AC0 is used to set the Target Device ID. AC1 is the level of diagnostic operations to be performed. See XDE - 3001B page 93 for a list of level operation codes. Action Fields: AC0: AC1: AC2: AC3: Target Device ID 00 Default (See XDE-3001B for details) 00 - Not used 00 - Not Used
Build message 10 as indicated in the table below Request Byte 1 2 3 4 5 6 Pseudo Code: XX 10 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 N/A - Set the target device ID to value in AC0 N/A Set the diagnostic operation level (within the request) to AC1 N/A Send Diagnostic message to inform devices on the link N/A Goto Class 2 Response Processing This Op-Code is NOT supported. The response processing will be based on GOTO field G1. Typical Interpreter Line: Step 01 Op-Code 10 Action Fields 10 90 00 00 Goto Fields FF 99 00 00 00 00 Value 6C AC0 ## 10 AC1 CS Byte Description Format and type Target device ID Global source ID Initiate Diagnostic Operation Mode Level of diagnostic operation 1 byte message checksum (handled by the system)
50 02
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
63
Pseudo Code: XX 14 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Build Return to Normal Mode message as indicated in the table below Request Byte 1 2 3 4 5 Value 6C AC0 ## 14 CS Byte Description Format and type Target device ID Global source ID Clear Diagnostic Information Mode 1 byte message checksum (handled by the system)
Send Mode 14 message and receive the response Goto Class 2 Response processing If No response was received Goto step G1 Else Look for response byte 4 in goto fields If Response Byte 4 is found Goto appropriate step Else Goto step indicated by FF goto field Endif Endif Typical Interpreter Line: Step 1F Op-Code 14 Action Fields 10 00 00 00 Goto Fields 54 20 7F 1B FF 24 00 00 00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
64
Pseudo Code: XX 20 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Build Return to Normal Mode message as indicated in the table below Request Byte 1 2 3 4 5 Value 6C AC0 ## 20 CS Byte Description Format and type Target device ID Global source ID Return to Normal Communication Mode 1 byte message checksum (handled by the system)
Send Mode 20 message and receive the response Goto Class 2 Response processing Set the link to Normal Speed 10400 baud Wait 1000 milliseconds If No response was received Goto step G1 Else Look for response byte 4 in goto fields If Response Byte 4 is found Goto appropriate step Else Goto step indicated by FF goto field Endif Endif Typical Interpreter Line: Step 1F Op-Code 20 Action Fields 10 00 00 00 Goto Fields 60 20 7F 1C FF 24 00 00 00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
65
Pseudo Code: XX 27 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 If AC3 is not equal to 01 (send a Disable Normal Communications request) Set the Target Device ID to $FE (All devices) Send out a Mode $28 request (Disable Normal Communications) Set the Target Device ID to AC0 Part 1 Request Seed Build Security Access message 1 as indicated in the table below Request Byte 1 2 3 4 5 6 Value 6C AC0 ## 27 01 CS Byte Description Format and type Target device ID Global source ID Security access message mode Security access request number 1 byte message checksum (handled by the system)
Send Security Access message 1 to request seed and receive response If Message 1 Response Is Positive If Message 1 Response Contains a Seed If Both Bytes of the Seed (response bytes 6 & 7) Are Zeros (controller already unlocked) Set response code to 34 Done - Goto Process Response Code Else If Security Algorithm (AC1) Not Yet Used Use specified security algorithm (AC1) to determine device's key Goto Part 2 Send Key Else Use one's complement of seed to determine device's key Goto Part 2 Send Key EndIf EndIf Else Set response code to the last response byte (byte 6) EndIf Else
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
66
If Message 1 Response Is Negative Set response code to negative response code (last response byte) Else If No Response to Message 1 is received Set response code to NO Response (FD) Done - Goto Process Response Code Else Return with the failed error Done - Goto Process Response Code EndIf EndIf Endif
(continued)
If Security Key Was Not Determined and the Response from Message 1 reflects a Time Delay Not Expired If Message 1 Was Not Yet Sent 2 Times Wait 10 seconds (with tester present messages) Re-execute the Part 1 Request Seed logic Else Return with the failed error Done - Goto Process Response Code Endif Else Return with the failed error Done - Goto Process Response Code Endif Part 2 Send Key Build Security Access message 2 as indicated in the table below (when a Seed has been received) Request Byte 1 2 3 4 5 7 8 9 Value 6C AC0 ## 27 02 XX XX CS Byte Description Format and type Target device ID Global source ID Security access message mode Security access request number High byte of key Low byte of key 1 byte message checksum (handled by the system)
Send Security Access message 2 key response and receive response If Message 2 Response Is Positive If Response Byte 6 Is 34 (Box is now Unlocked) Set response code to 34 Done - Goto Process Response Code Else If Response Byte 6 Is 35 (Invalid Key) If Running on DPS Tool And One's Complement Not Yet Used Reset message 1 counter and try the Ones Complement Re-execute the Part 1 Request Seed logic Else Return with the failed error (Response Byte 6) Done - Goto Process Response Code Endif Else Return with the failed error (Response Byte 6) Done - Goto Process Response Code Endif Endif Else If Message 2 Response Is Negative Set response code to negative response code (Response Byte 4 = 0x7F)
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
67
Done - Goto Process Response Code Else If No Response to Message 2 is received Set response code to NO Response (FD) Done - Goto Process Response Code Else Return with the failed error Done - Goto Process Response Code EndIf Endif Endif Process Response Code If response code Is Found Goto appropriate step indicated in the goto field Else Goto step indicated by FF goto field Endif Typical Interpreter Line: Step 01 Op-Code 27 Action Fields 10 22 00 00 Goto Fields 7F 1A FD 1F FF 1F
(continued)
34 02
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
68
AC2: AC3:
Pseudo Code: XX 28 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Build Disable Communications message as indicated in the table below Request Byte 1 2 3 4 5 6 Value 6C AC0 ## 28 AC1 CS Byte Description Format and type Target device ID Global source ID Disable communication message mode Disable Level 1 byte message checksum (handled by the system)
Send Mode 28 message and get the response(s) Goto Class 2 Response Processing If No response was received Look for FD (no comm.) in goto fields If FD is found Goto appropriate step Else Goto step indicated by FF goto field Endif Else Look for response byte 4 in goto fields If Response Byte 4 is found Goto appropriate step Else Goto step indicated by FF goto field Endif Endif Typical Interpreter Line: Step 01 Op-Code 28 Action Fields 10 00 00 00 Goto Fields 7F 04 FD 1B FF 1D
68 02
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
69
Pseudo Code: XX 29 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Build Enable Communications message as indicated in the table below Request Byte 1 2 3 4 5 Value 6C AC0 ## 29 CS Byte Description Format and type Target Device ID Global source address Enable communications message mode 1 byte message checksum (handled by the system)
Set the link to Normal Speed 10400 baud Wait 750 milliseconds Send Mode 29 message and get the response(s) Goto Class 2 Response Processing If No response was received Goto step G1 Else Look for response byte 4 in goto fields If Response Byte 4 is found Goto appropriate step Else Goto step indicated by FF goto field Endif Endif Typical Interpreter Line: Step 08 Op-Code 29 Action Fields 10 00 00 00 Goto Fields 7F 14 FF 20 00 00
69 09
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
70
Pseudo Code: XX 31 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Build Start Diagnostic Routine message as indicated in the table below Request Byte 1 2 3 4 5 6 Value 6C AC0 ## 31 AC1 CS Byte Description Format and type Target device ID Global source ID Start diagnostic routine message mode Test number 1 byte message checksum (handled by the system)
Send Mode 31 message and get response Goto Class 2 Response Processing If No response was received Look for FD (no comm.) in goto fields If FD is found Goto appropriate step Else Goto step indicated by FF goto field Endif Else Look for response byte 4 in goto fields If Response Byte 4 is found Goto appropriate step Else Goto step indicated by FF goto field Endif Endif
71 09
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
71
AC3:
Pseudo Code: XX 34 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 If AC2 is Not Equal to 02 Set Transfer Type to value is AC3 Else Exclude Transfer Type from Message Endif If AC2=02 Build Download Request as indicated in the table below: Request Byte 1 2 3 4 5 Value 6C AC0 ## 34 CS Byte Description Format and type Target device ID Global source ID Request download message mode 1 byte message checksum (handled by the system)
Send Mode 34 message and receive response Goto Class 2 Response Processing Goto Mode 34 Response Processing Else Find the routine indicated by value AC1 Build Download Request as indicated in the table below, contents of the XX locations is detailed in pseudo code following the table Request Byte 1 2 3 4 5 6 7 8 9 10 11 Value 6C AC0 ## 34 AC3 XX XX XX XX XX CS Byte Description Format and type Target device ID Global source ID Request download message mode Transfer type High byte of number of data bytes Low byte of number of data bytes High byte of starting address Middle byte of starting address Low byte of starting address 1 byte message checksum (handled by the system) Page 72
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
If AC2=00 (Use address and length from the routine indicated by AC1) (continued) Copy high byte of routine length from the routine into message (should not exceed length in header) Copy low byte of routine length from the routine into message (should not exceed length in header) Copy high byte of RAM address to download routine (from routine) into message Copy middle byte of RAM address to download routine (from routine) into message Copy low byte of RAM address to download routine (from routine) into message Else If AC2=01 (Use address and length from the utility file header) Copy high byte of data length from the Header into the message Copy low byte of data length from the Header into the message ** Note: The data length value in the header can be changed via the $F5 Override the Utility File ** Message Length Field Op-Code. Copy high byte of data address information from the Header into the message Copy middle byte of data address information from the Header into the message Copy low byte of data address information from the Header into the message Endif AC2=00 Send Mode 34 message and receive response Goto Class 2 Response Processing Goto Mode 34 Response Processing Endif Mode 34 Response Processing If a positive response was received If AC2 = 2 (ignore transfer type, address and length information) Set the response code to response byte 5 Else Set the response code to response byte 6 Endif Else If a negative response was received Set the response code to the last response byte in the negative response message Else Set the response code to FD (no comm.) Endif Endif If the response code is 00 Goto step G1 Else Look for response code in the goto fields If the response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif Endif Typical Interpreter Line (ignore transfer type, address and length information): Step 10 Op-Code 34 Action Fields 10 00 02 00 44 11 Goto Fields 12 0D FD 22 FF 99 00 00
Typical Interpreter Line (use address and length information from the routine) : Step 10 Op-Code 34 Action Fields 10 03 00 01 44 11 Goto Fields 12 0D FD 22 FF 99 00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
73
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
74
AC3:
00 - Used to write Configuration / VIN / RSCOSN / data to a block (AC1) 01 - Used to configure a Module using the 3B mode by using data from a calibration file (AC1). Negative responses will be ignored. 02 - Used to reset (clear) all learned values associated with the data block to initial values as defined by the controller. The Block Number to reset is indicated by AC1. 03 - Used to write end model part number in binary coded decimal format. Usable option only when AC1 is 08. 04 - Used to write a routine from the utility file to a memory block, where AC2 is the routine number and AC1 is the block number. 05 - Used to configure a Module using the 3B mode by using data from a calibration file (AC1) that includes header information within the file. The header information will be skipped 12 bytes. Negative responses will be ignored. 06 - Used to configure a Module using the 3B mode by using data from a calibration file (AC1). A negative response will be processed and will halt the configuration data writing. 07 - Used to configure a Module using the 3B mode by using data from a calibration file (AC1) that includes header information within the file. The header information will be skipped 12 bytes. A negative response will be processed and will halt the configuration data writing. 08 Used to write data from a 256-byte internal storage buffer (AC2) to the block number identified in AC1.
Pseudo Code: XX 3B AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use Ignore Class 2 Response Processing If (AC3 = 01 or AC3 = 06) See example 2 of Pseudo Code Else If AC3 = 02 See example 3 of Pseudo Code Else If AC3 = 04 See example 4 of Pseudo Code Else If (AC3 = 05 or AC3 = 07) See example 5 of Psuedo Code Else If (AC3 = 00 or AC3 = 03) See example 1 of Pseudo Code ElseIf (AC3 = 08) See example 6 of Pseudo Code Endif Endif Endif Endif Endif
Example 1:
If AC3 = 00 or AC3 = 03, build Write Block of Memory message as indicated in the table below, contents of the XX locations is detailed in pseudo code following the table Request Byte 1 2 3 4 5 6 6 + N 1 6+N Value 6C AC0 ## 3B AC1 XX Byte Description Format and type Target Device ID Global source address Write block of memory mode Block number Data byte 1 The pseudo code below explains how the data portion of this request is filled Data byte N (maximum of 6) 1 byte message checksum (handled by the system) Page 75
XX CS
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
(continued) If the AC1 is set to $A4, $A5, $A6, $A8, $A9, $AA, or $AB and CAL ECU configuration data is available. Set the response code to 0x7B Else Set block number to AC1. Copy the appropriate data (see the Action Field table value descriptions above) Send 3B message and get response. If a positive or negative response was received Set the response code to Response Byte 4 Else Set the response code to FF Endif Endif Look for response code in the goto fields If the response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (AC3 = 00) Step 21 Op-Code 3B Action Fields 10 01 00 00 7B 22 Goto Fields 7F 24 FF 99 00 00 00 00
Typical Interpreter Line: (AC3 = 03) Step 21 Op-Code 3B Action Fields 10 08 00 03 7B 22 Goto Fields 7F 24 FF 99 00 00 00 00
Example 2:
If AC3 = 01 or AC3 = 06, build Write Block of Memory message as indicated in the table below, contents of the XX locations is detailed in pseudo code following the table Request Byte 1 2 3 4 5 6 6 + N 1 6+N Value 6C AC0 ## 3B XX XX Byte Description Format and type Target Device ID Global source address Write block of memory mode Block number Data byte 1 The pseudo code below explains how the data portion of this request is filled Data byte N (maximum of 6) 1 byte message checksum (handled by the system)
XX CS
Example of Calibration: 020784226552130000078501E200000000 (must be in binary format) Block count = 02 Block 1 Len. = 07 Block 1 = 84 22 65 52 13 00 00 Block 2 Len. = 07 Block 2 = 85 01 E2 00 00 00 00 Read calibration AC1 Set Block count based on byte 1 of calibration AC1 (each calibration consists of multiple blocks) Do While Block Count > 0 Copy Block # length bytes of calibration AC1 Block # into message (maximum of 6 data bytes plus one block ID, zero fill any unused bytes in the calibration file) Send Tester Present message to all devices (0xFE) Send 3B message
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
76
(continued) If (a negative response is received and AC3 = 06) End the Do While loop (no more data processing) Else (ignore any negative response) Endif If (no response is received) End the Do While loop Endif Subtract 1 from Block count Setup to get the next Block information (Length and Data) End While If (no response is received) Set the response code to FF Else If AC3 = 01 and all positive or negative responses were received Set the response code to 7B Else Set the response code to Response Byte 4 Endif Endif Look for response code in the goto fields If the response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: Step 21 Op-Code 3B Action Fields 40 01 00 01 7B 22 Goto Fields FF 99 00 00 00 00 00 00
Example 3:
If AC3 = 02, build Write Block of Memory message as indicated in the table below. Request Byte 1 2 3 4 5 6 Value 6C AC0 ## 3B AC1 CS Byte Description Format and type Target Device ID Global source address Write block of memory mode Block number 1 byte message checksum (handled by the system)
Send Mode 3B message with NO data bytes and receive response. If a positive or negative response was received Set the response code to Response Byte 4 Else Set the response code to FF Endif Look for response code in the goto fields If the response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
77
(continued) Typical Interpreter Line: Step 13 Op-Code 3B Action Fields 10 83 00 02 7B 14 Goto Fields 7F 5B FF 99 00 00 00 00
Example 4:
If AC3 = 04, build Write Block of Memory message as indicated in the table below. Request Byte 1 2 3 4 5 6 6 + N 1 6+N Value 6C AC0 ## 3B AC1 XX Byte Description Format and type Target Device ID Global source address Write block of memory mode Block number Data byte 1 The pseudo code below explains how the data portion of this request is filled Data byte N (maximum of 6) 1 byte message checksum (handled by the system)
XX CS
Set block number to AC1. Copy all data bytes of routine AC2 (up to 6 bytes) into message. Send Tester Present message to all devices (0xFE) Send 3B message and get response. If a positive or negative response was received Set the response code to Response Byte 4 Else Set the response code to FF Endif Look for response code in the goto fields If the response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: Step 21 Op-Code 3B Action Fields 40 B3 01 04 Goto Fields 7F 2E FF 99 00 00
7B 22
00 00
Example 5:
If AC3 = 05 or AC3 = 07, build Write Block of Memory message as indicated in the table below (contents of the XX locations is detailed in pseudo code following the table) This example is identical to Example 2 except that this usage expects a 12 byte header on the calibration data file. In this case, the operation of the data will begin at byte 13.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
78
(continued) Request Byte 1 2 3 4 5 6 6 + N 1 6+N Value 6C AC0 ## 3B XX XX Byte Description Format and type Target Device ID Global source address Write block of memory mode Block number Data byte 1 The pseudo code below explains how the data portion of this request is filled Data byte N (maximum of 6) 1 byte message checksum (handled by the system)
XX CS
Example of Calibration: 8888000100F4240041410000020784226552130000078501E200000000 (must be in binary format) Module Checksum Module ID Part Number Design Level Suffix Pad Bytes Block count Block 1 Length Block 1 Block 2 Length Block 2 = 8888 = 0001 = 00 F4 24 00 (16000000) = 41 41 (AA) = 00 00 = 02 = 07 = 84 22 65 52 13 00 00 = 07 = 85 01 E2 00 00 00 00
Read calibration AC1 Set Block count based on byte 13 of calibration AC1 (each calibration consists of multiple blocks) (skip the 12 byte header information) Do While Block Count > 0 Copy Block # length bytes of calibration AC1 Block # into message (maximum of 6 data bytes plus one block ID, zero fill any unused bytes in the calibration file) Send Tester Present message to all devices (0xFE) Send 3B message and process the response If (a negative response is received and AC3 = 07) End the Do While loop (no more data processing) Else (ignore any negative response) Endif If (no response is received) End the Do While loop (done) Endif Subtract 1 from Block count Setup to get the next Block information (Length and Data) End While If (no response is received) Set the response code to FF Else If AC3 = 05 and all positive or negative responses were received Set the response code to 7B Else Set the response code to Response Byte 4 Endif Endif Look for response code in the goto fields
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
79
If the response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: Step 21 Op-Code 3B Action Fields 40 01 00 05 7B 22 Goto Fields FF 99 00 00 00 00 00 00
(continued)
Example 6:
If AC3 = 08, build Write Block of Memory message as indicated in the table below. Request Byte 1 2 3 4 5 6 6 + N 1 6+N Value 6C AC0 ## 3B AC1 XX Byte Description Format and type Target Device ID Global source address Write block of memory mode Block number Data byte 1 The pseudo code below explains how the data portion of this request is filled Data byte N (maximum of 6) 1 byte message checksum (handled by the system)
XX CS
Set block number to AC1. If the storage location number (AC2) is valid Copy the data from the 256-byte storage location indicated by AC2 into the message. Note1: For the Class 2 protocol, the storage location should first be populated with the $3C OpCode for this exception to work; however, if the storage location is pre-populated with OpCode $54 or some other method, then see Note2. th Note2: The amount of data (length) stored in the storage location is located in the 7 storage buffer byte (buffer[6]). The reading/writing of data (for Class 2) can never be more than 6 data bytes. An example of 3 data bytes (0x12, 0x23, 0x34) stored in an internal storage location would be: StorageLocation: 0x12, 0x23, 0x34, 0x00, 0x00, 0x00, 0x03, . Else End with an error. Endif Send Tester Present message to all devices (0xFE) Send 3B message and get response. If a positive or negative response was received Set the response code to Response Byte 4 Else Set the response code to FF Endif Look for response code in the goto fields If the response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: Step 21 Op-Code 3B Action Fields 10 09 04 08 Goto Fields 7F 2E FF 99 00 00
7B 22
00 00 Page 80
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
AC2: AC3:
Pseudo Code: XX 3C AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Build Read Block of Memory message as indicated in the table below, contents of the XX locations is detailed in pseudo code following the table Request Byte 1 2 3 4 5 6 Value 6C AC0 ## 3C AC1 CS Byte Description Format and type Target address Global source address Read block of memory mode Block number 1 byte message checksum (handled by the system)
Send Mode 3C message and receive the response If Block Number is 01 Compare the Response Data bytes 1 through 6 against 0x00 plus VIT2 VIN bytes 1 through 5 Else If Block Number is 02 Compare the Response Data bytes 1 through 6 against VIT2 VIN bytes 6 through 11 Else If Block Number is 03 Compare the Response Data bytes 1 through 6 against VIT2 VIN bytes 12 through 17 Endif Endif If the Exception Is 01 (AC2=01) Display the VTD Pin value from response data bytes 1 - 4 (BCD) Endif If a Positive response is received and the storage location number (AC3) is valid Save the data of the response starting with the first Data Byte (after the Block Number in the response) to the 256-byte storage location indicated by AC3 th FYI: The amount of data (length) stored in the storage location is located in the 7 storage buffer byte (buffer[6]). The reading/writing of data (for Class 2) can never be more than 6 data bytes. An example of 3 data bytes (0x12, 0x23, 0x34) stored in an internal storage location would be: StorageLocation: 0x12, 0x23, 0x34, 0x00, 0x00, 0x00, 0x03, . Endif
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
81
(continued) If a VIN block comparison was successful or a response was received from a non-VIN block (01, 02, 03) Set the response code to Response Byte 4 Else If no response was received Set the response code to no comm. (FD) Else Set the response code to 05 (Comparison Failed) Endif Endif Look for response code in the goto fields If the response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: Step 21 Op-Code 3C Action Fields 10 01 00 04 7B 22 Goto Fields 7F 24 FD 30 FF 99 00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
82
Pseudo Code: XX 3E AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Build Read Data Block message Request Byte 1 2 3 4 5 6 Value 6C AC0 ## 3C AC1 CS Byte Description Format and Type Target Device ID Global Source ID Read Data Block Block Number to Read 1 byte message checksum (handled by the system)
Send Mode 3C message If there is a successful read response Determine the number of data bytes received from requested block Load a temporary buffer with the response data bytes Extract the new bit value from AC3 Extract the bit to modify from AC3 Reset the byte specified in AC2 with the new bit value Build Write Data Block message Request Value Byte Description Byte 1 6C Format and Type 2 AC0 Target Device ID 3 ## Global Source ID 4 3B Write Data Block 5 AC1 Block Number to Write 6 XX Data byte 1 . The pseudo code below explains how the data portion of this . request is filled 6+N1 XX Data byte N (maximum of 6) 6+N CS 1 byte message checksum (handled by the system) Send Mode 3B message
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
83
If there is a response to the write request (positive or negative) Set the response code to Response Byte 4 Else Set the response code to failed (FF) Endif Else (failed read request) Set the response code to failed (FF) Endif Look for response code in the goto fields If the response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: Step 04 Op-Code 3E Action Fields 10 08 02 15 Goto Fields 7F 99 FF 99 00 00
(continued)
7B 05
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
84
Real Data Format 000000000006102A020105FF Explanation: Target device is 10 and use mode 2A to read Dpid number 02 Read Routine (AC0) Example using 3C message: Target Address Length Device 00000000 0006 10 Read Mode 3C Block/Dpid Number 02 Data Rate 00 Number of Bytes to Pad 00 Pad Value 00
Real Data Format 000000000006103C02010000 Explanation: Target device is 10 and use mode 3C to read block number 02 NOTE: Mode 3C does not use data rate Write Routine (AC0+1) Example using 3B message: Target Address Length Device 00000000 0003 40 Write Mode 3B Block/Dpid Number 8E Number of Bytes to Pad 05 Pad Value 00
Real Data Format 000000000003103B8E0500 Explanation: Target device is 40 and use mode 3B to write data to block 8E AC1: AC2: AC3: Number of bytes to save Offset into the read message (3C or 2A) first saved byte = AC2. (AC2 = 1n) Offset into the outgoing message (3B or AE) saved data put into message starting at byte AC3. (AC3 = 1n)
Pseudo Code: XX 40 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Read Routine Data based on Routine # (AC0) (Target, Read Mode, Block/DPID, # to Pad, Pad Value)
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
85
Load the data storage buffer with value indicated in byte 6 of read routine (Pad Value) initialize (continued) Build the read message based on read Routine Data (AC0), Byte 2 (Read Mode) If the Read Mode is $3C Build Read Data Block message ($3C) Request Value Byte Description Byte 1 6C Format and Type 2 Routine Target Device ID data byte 1 3 ## Global Source ID 4 3C Read Data Block 5 Routine Block Number to Read data byte 3 6 CS 1 byte message checksum (handled by the system) Send Mode 3C message Else Build Read Diagnostic Data Packet message ($2A) Request Value Byte Description Byte 1 6C Format and Type 2 Routine Target Device ID data byte 1 3 ## Global Source ID 4 2A Read Data Block 5 Routine Data Rate data byte 4 6 Routine DPID to Read data byte 3 7 7+n-1 Routine DPID Padded values (0-5 = Number of Bytes to Pad (n) ) data byte (Routine data byte 5) 6 7+n CS 1 byte message checksum (handled by the system) Send Mode 2A message Endif If there is a successful (positive) read response Read Routine Data based on Routine # (AC0+1) (Target, Write Mode, Block/DPID, Rate, # to Pad, Pad Value) Load the data storage buffer with value indicated in byte 5 of write routine (Pad Value) initialization Load the Read data values (from $3C / $2A) into the data storage buffer for writing based on the Read and Write Offset values (AC2, AC3) Build the write message based on write Routine Data (AC0+1), Byte 2 (Write Mode) If the Write Mode is $3B Build mode 3B write message using buffer of saved bytes and padding bytes Request Value Byte Description Byte 1 6C Format and Type 2 Routine Target Device ID data byte 1 3 ## Global Source ID 4 3B Write Data Block 5 Routine Block Number to Write data byte 3
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
86
Data = read data and any padded data n = Bytes to write indicated by AC1 + Byte 4 of write routine 6+n CS 1 byte message checksum (handled by the system) Send Mode 3B write message If there is a response to the write request (positive or negative) Set the response code to Response Byte 4 Else Set the response code to failed (FF) Endif Else Build mode AE request device control message using buffer of saved and padding bytes Request Value Byte Description Byte 1 6C Format and Type 2 Routine Target Device ID data byte 1 3 ## Global Source ID 4 AE Write Data Block 5 Routine CPID Value data byte 3 6 6+n-1 <data> Data = read data and any padded data n = Bytes to write indicated by AC1 + Byte 4 of write routine 6+n CS 1 byte message checksum (handled by the system) Send Mode AE Device Control message <data> Set the response code to Response Byte 6 If there is a positive response to the device control request If the response code is E1 Indicate success Else Indicate failure Endif Endif Endif Endif If any of the Routine Data Reads failed Set the response code to failed (FF) Endif Look for response code in the goto fields If the response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: Using $3C and $3B message combination Step Op-Code Action Fields 04 40 01 01 03 02 Using $3C and $AE message combination Step Op-Code Action Fields 04 40 01 01 03 02
6 6+n-1
7B 05
Goto Fields 7F 06 FF 06 00 00
00 00
E1 05
Goto Fields E3 06 FF 06 00 00
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
87
AC2: AC3:
Pseudo Code: XX 52 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Build Read Checksum message as indicated in the table below: Request Byte 1 2 3 4 5 6 Value 6C AC0 ## 3C --CS Byte Description Format and Type Target Device ID Global Source ID Read Data Block Block number (01, 02, 03, 08, (82 or 8E)) 1 byte message checksum (handled by the system)
Set Block Number to 01 Send a mode 3C Read message for VIN bytes 1-5 and receive response If a valid response was not received, Goto Response Processing (end processing) Calculate checksum on received data bytes (6 data bytes) Set Block Number to 02 Send a mode 3C message for VIN bytes 6-11 and receive response If a valid response was not received, Goto Response Processing (end processing) Increase checksum by received data bytes (6 data bytes) Set Block Number to 03 Send a mode 3C message for VIN bytes 12-17 and receive response If a valid response was not received, Goto Response Processing (end processing) Increase checksum by received data bytes (6 data bytes) Set Block Number to 08 Send a mode 3C message for Part Number bytes 1-4 (USN) and receive response If a valid response was not received, Goto Response Processing (end processing) Increase checksum by received data bytes (4 data bytes) If AC1 = 8E Set Block Number to 8E Else Set Block Number to 82 Endif Send a mode 3C message for DVT Option bytes 1-4 and receive response If a valid response was not received, Goto Response Processing (end processing) Increase checksum by received data bytes
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
88
Add one (1) to the checksum value Build Write Checksum message as indicated in the table below: Request Byte 1 2 3 4 5 6 7 8 9 10 11 Value 6C AC0 ## 3B --RespData1 RespData2 RespData3 RespData4 Calculated CS CS
(continued)
Byte Description Format and Type Target Device ID Global Source ID Read Data Block Block number (82 or 8E) Response Data byte #1 from the Block Read (82 or 8E) Response Data byte #2 from the Block Read (82 or 8E) Response Data byte #3 from the Block Read (82 or 8E) Response Data byte #4 from the Block Read (82 or 8E) Calculated checksum value (blocks reads 01, 02, 03, ) 1 byte message checksum (handled by the system)
Set Block Number to 01 Send a mode 3B Write message Response Processing If a response was received (positive or negative) Set the response code to response message byte 4 Else Set the response code to no response (FD) (No Comm.) Endif Look for response code in the goto fields If the response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif
7B 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
89
Pseudo Code: XX 72 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 If AC1 is 00 Apply voltage to the pin based on AC0 (Pin Number) * When using Tech 2 Saturn/Catera adapter, voltage is always applied to DLC PIN #6 Else If AC1 is 01 Remove voltage from DLC pin based on AC0 (Pin Number) * When using Tech 2 Saturn/Catera adapter, voltage is removed from DLC PIN #6 Else Goto step specified in Goto field 1 (G1) (Invalid Action type AC1) Endif Endif If the Enable or Clear executes successfully Wait for 2 seconds Goto step specified in Goto field 1 (G1). Else Goto step specified in Goto field 3 (G3). Endif Typical Interpreter Line: Step 08 Op-Code 72 Action Fields 06 01 00 00 Goto Fields 00 5B 00 00 00 00
00 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
90
Pseudo Code: XX 84 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
If AC0 is $00 or in the range $10-$FF Turn OFF any previously set delay timer If AC0 is in the range $01-$0F Turn ON the delay timer based on a delay time of AC0 * 100ms (Time delay between an ECU response and any subsequent TESTER request) Endif Goto step specified by goto field one (G1)
Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 01 Op-Code 84 Action Fields 03 00 00 00 Goto Fields 00 00 00 00 00 00
00 02
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
91
Pseudo Code: XX A0 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Build Request High Speed message as indicated in the table below Request Byte 1 2 3 4 5 Value 6C AC0 ## A0 CS Byte Description Format and type Target device ID Global source ID. Request download message mode 1 byte message checksum (handled by the system)
Send Tester Present message to all devices (0xFE) Send Mode A0 message and receive response Goto Class 2 Response processing If No response was received Goto step G1 Else If AC3 = 00 Set the response code to response message byte 5 If the response code (response message byte 5) is equal to 0xBB Set the response code to 0xAA Endif Else Set the response code to response message byte 4 Endif Look for response code in the goto fields If the response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: Step 02 Op-Code A0 Action Fields 10 00 00 00 Goto Fields FF 99 00 00 00 00
AA 03
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
92
Pseudo Code: XX A1 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Build Start High Speed message as indicated in the table below Request Byte 1 2 3 4 5 Value 6C AC0 ## A1 CS Byte Description Format and type Target address Global source address Request download message mode 1 byte message checksum (handled by the system)
Send Tester Present message to all devices (0xFE) Send Mode A1 message and do not attempt to process a response (none expected). Delay for (0.6) seconds Send Tester Present message to all devices (0xFE) If the message (Begin High Speed Communications) was successfully transmitted Goto step specified in goto field 1 (G1) Else Set the response code to no response (FD) (No Comm.) (i.e. transmit failed) Look for response code in the goto fields If the response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif Endif Typical Interpreter Line: Step 1F Op-Code A1 Action Fields 10 00 00 00 Goto Fields FD 2C FF 99 00 00
00 20
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
93
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
94
Pseudo Code: XX AE AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Find the routine indicated by value AC2 and read the data from the routine Build Download Request as indicated in the table below, contents of the XX locations is detailed in pseudo code following the table Request Value Byte Description Byte 1 6C Format and type 2 AC0 Target device ID 3 ## Global source ID 4 AE Request download message mode 5 AC1 CPID Number 6 XX 1st byte of routine (AC2) The pseudo code below explains how the data portion of this request is filled 6+N XX Data byte N (maximum of 6) 6+N+1 CS 1 byte message checksum (handled by the system) Copy length bytes of routine AC2 into message (should not exceed length of 6 and some controllers may require 6 - zero fill if necessary within the routine) Send Mode AE message and receive response Set the response code to the sixth byte of the response data If a positive response was received (EE) and the sixth byte is E1 Mode AE PASSED Else Mode AE FAILED Endif Send Tester Present message to all devices (0xFE) Look for response code in the goto fields If the response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: Step 10 Op-Code AE Action Fields 10 03 02 00 E1 11 Goto Fields E4 0D FF 99 00 00 00 00 Page 95
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
*Note: A prolog and routine are both contained within the routine section of utility file; however, they are different. The prolog is a value that precedes each packet of information. With a routine, the data is downloaded to the controller only once. A prolog would remain constant during the downloading of a routine. (The Class 2 protocol uses routines. Use of prologs in Class 2 is not currently supported as it is not required.) Pseudo Code: XX B0 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Find the routine indicated by value AC1 Build Download message as indicated in the table below, contents of the XX locations is detailed in pseudo code following the table Request Byte 1 2 3 4 5 6 7 8 9 10 11 11 + N Value 6D AC0 ## 36 XX XX XX XX XX XX XX Byte Description Format and type Target device ID Global source ID Request download message mode Transfer type High byte of number of data bytes Low byte of number of data bytes High byte of starting address Middle byte of starting address Low byte of starting address Data byte 1 The pseudo code below explains how the data portion of this request is filled Data byte N Page 96
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
If this Message is Strictly Download Without Execution on Completion (AC3 = 0x00, 0x01, 0x80, 0x81) Set transfer type to 00 for download only (Byte 5 of Class 2 message) Else Set transfer type to 80 for download and execute (Byte 5 of Class 2 message) Endif Set the address bytes (for the mode $36 message) based on the routine address information. If the address information is 0xFFFFFFFF No address information will be included in the mode $36 message (Bytes 8, 9, 10 will be removed from the message) Endif If this Message is Strictly Execute with No Data Being Sent (AC3 = 0x02, 0x82) Set the length bytes (for the mode $36 message) to zero Set the data bytes (for the mode $36 message) to NULL (no data) Else Set the length bytes (for the mode $36 message) based on the routine length information Set the data bytes (for the mode $36 message) based on the routine data Endif Calculate the checksum for the message buffer Copy the two byte checksum to the end of the message buffer Send Tester Present message to all devices (0xFE) Send the mode $36 message and expect a response If the Response to the Above Message is a Success (0x76 .. 0x65 or 0x76 .. 0x73 or 0x76 .. 0x86) If this is a Download Then Send a Separate Message (AC3 = 0x01, 0x81) Build Download message as indicated in the table below, contents of the XX locations is detailed in pseudo code following the table (Length of 0x00, NO data bytes, transfer type is execute (0x80)) Request Byte 1 2 3 4 5 6 7 8 9 10 11 12 Value 6D AC0 XX 36 80 00 00 XX XX XX CS CS Byte Description Format and type Target device ID Global source ID Request download message mode Transfer type High byte of number of data bytes Low byte of number of data bytes High byte of starting address Middle byte of starting address Low byte of starting address High byte of checksum Low byte of checksum
If the Exception is 0x81 (AC3 = 01) Set the address bytes (for the mode $36 execute message) based on the routine address Else No address information will be included in the mode $36 message (Bytes 8, 9, 10 will be removed from the message) Endif Calculate checksum for message buffer Copy high byte of checksum into the end of the message buffer Copy low byte of checksum into the end of the message buffer Send the execute only message and expect a response Endif Endif
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
97
If a positive response was received (0x76) Set the response code to the sixth byte of the response Else If a negative response (0x7F) was received Set the response code to the fourth byte of the response Else If no response was received Set the response code to 0xFD (No Comm. Response) Else Set the response code to the sixth byte of the response Endif Endif Endif Look for response code in the goto fields If the response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: Step 10 Op-Code B0 Action Fields 10 01 00 81 Goto Fields 62 0D FD 20 7F 49
(continued)
65 11
FF 49
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
98
B2 Op-Code: Block Transfer to RAM and Save Two Byte Response - Mode 36
Supported By: Class 2 Interpreter 1 Description: The B2 Op-Code is used to build a mode 36 message for downloading a routine to control module RAM. Depending on the product being programmed this Op-Code may need to be preceded by a mode 34 message (see Op-Code 34). Using the exceptions the utility controls when the code downloaded to RAM is executed. The B2 Op-Code is functionally equivalent to the B0 Op-Code except two bytes are saved from the response (checksum). The B2 Op-Code uses the global source device ID for all messages. If a source device ID other than the current source device ID needs to be used, the Interpreter instructions should contain a 01 Op-Code prior to this Op-Code. Note: This OpCode uses the 2-byte storage buffers. For buffer usage information, see the section: Programming Buffers Recommended Usage Action Fields: AC0: AC1: AC2: AC3: Target Device ID Routine number to download ID for storage location of two response bytes (0x00 0x13) Exceptions 00-03. The RAM download address is determined from the routine section. 00 - Download routine and receive completion response but DO NOT execute 01 - Download routine and receive completion response then send separate execute message - The execute message will contain NO data bytes and also NO address information. 02 - Send execute message with zero length and with the address of the indicated routine 03 - Send routine with transmit type of execute Exceptions 80-83. The RAM download address is determined from the routine section. 80 - Download routine and receive completion response but DO NOT execute 81 - Download routine and receive completion response then send separate execute message - The execute message will contain NO data bytes and will have the address information. 82 - Send execute message with zero length and with the address of the indicated routine 83 - Send routine with transmit type of execute
Pseudo Code: XX B2 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Process the Op-Code $B0 pseudo code logic. If the response to the $36 message(s) is a Success (0x76 .. 0x65 or 0x76 .. 0x73 or 0x76 .. 0x86) Save two bytes from the response to internal local storage ID indicated by AC2 (bytes 7 & 8 of response are saved) Endif Look for response code in the goto fields (see Op-Code $B0 pseudo code) If the response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: Step 10 Op-Code B2 Action Fields 10 04 05 01 Goto Fields 62 0D FD 20 7F 49
65 11
FF 49
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
99
Pseudo Code: XX B3 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Build Download message as indicated in the table below, contents of the XX locations is detailed in pseudo code following the table Request Byte 1 2 3 4 5 6 7 8 9 10 11 11 + N 12 + N 13 + N Value 6D AC0 ## 36 00 00 20 XX XX XX XX Byte Description Format and type Target device ID Global source ID Request download message mode Transfer type High byte of number of data bytes Low byte of number of data bytes High byte of starting address Middle byte of starting address Low byte of starting address Data byte 1 The pseudo code below explains how the data portion of this request is filled Data byte N High byte of checksum Low byte of checksum
XX CS CS
The length (number of data bytes for the mode $36 message) is set to 32 decimal (0x0020). Set the address bytes (for the mode $36 message) based on the utility file address information. Calculate ones complement checksum for VIN bytes and calibration ID byte Copy the high byte of ones complement checksum into data byte 1 Copy the low byte of ones complement checksum into data byte 2 Copy zero into data byte 3 as the high byte of the VIN calibration ID Copy AC1 (Block ID) into data byte 4 as the low byte of the VIN calibration ID Copy the VIN data into message buffer starting at data byte 5
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
100
Calculate the checksum for the entire (Mode $36) message buffer Copy the two byte checksum to the end of the message buffer Send Tester Present message to all devices (0xFE) Send the mode $36 message and expect a response
(continued)
If the response to the $36 message(s) is a Success (0x76 .. 0x65 or 0x76 .. 0x73 or 0x76 .. 0x86) Set the response code to the sixth byte of the response Else If a negative response (0x7F) was received Set the response code to the fourth byte of the response Else If no response was received Set the response code to 0xFD (No Comm. Response) Else Set the response code to the sixth byte of the response Endif Endif Endif Look for response code in the goto fields If the response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: Step 08 Op-Code B3 Action Fields 10 02 00 00 Goto Fields FD 12 7F 4A FF 4A
65 09
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
101
*Note: A prolog and routine are both contained within the routine section of utility file; however, they are different. The prolog is a value that precedes each packet of information, which could be a routine that is downloaded. With a routine, the data is downloaded to the controller only once. A prolog would remain constant during the downloading of a routine.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
102
Pseudo Code: XX B4 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
(continued)
Find the calibration with ID of AC1 Set the packet length to number of data bytes in a message value in the Utility File header Note: ** The message data length value in the Utility File header can be over-written via the $F5 ** Override the Utility File Message Length Field Op-Code. Build Download message as indicated in the table below, contents of the XX locations is detailed in pseudo code following the table Request Byte 1 2 3 4 5 6 7 8 9 10 11 11 + N 12 + N 13 + N Value 6D AC0 ## 36 XX XX XX XX XX XX XX Byte Description Format and type Target device ID Global source device ID Request download message mode Transfer type High byte of number of data bytes Low byte of number of data bytes High byte of starting address Middle byte of starting address Low byte of starting address Data byte 1 The pseudo code below explains how the data portion of this request is filled Data byte N High byte of checksum Low byte of checksum
XX CS CS
If the Exception is Zero, Three or Four (AC3=00, AC3=03 or AC3=04) Set the transfer type to 0x00 (Download Only) Set the download message number of data bytes (2 bytes) based on the packet length Set the download message address bytes (3 byte addressing) based on the utility file address Note: The data bytes based on the calibration data (dynamic) Else (AC3=01 or AC3=02) Set the transfer type to 0x80 (Download and Execute) Find the routine section indicated by value in AC2 Set the download message number of data bytes (2 bytes) based on the packet length + the routine length + length size* + address size** * The length size for the calibration packet data (2 bytes) ** The address size for the calibration packet data is (2 bytes if AC3=02 or 3 bytes if AC3=01) Set the download message address bytes (2 or 3 bytes***) based on the routine address ** The number of address bytes is 2 if AC3=02. The number of address bytes is 3 if AC3=01. Note: The data bytes are based on the routine data (static) and the calibration data (dynamic) Endif Do while more calibration data to download If the GlobalHeaderLength is not 0 (download the calibration file into 2 parts header first) Set the Packet & Data length values based on the GlobalHeaderLength Decrement the GlobalHeaderLength by the number of header bytes to download Endif
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
103
If this is the last packet of a file to download (continued) If (AC3=01, AC3=02 or AC3=04) Change the packet size and download message length values based on the amount of data remaining Copy the remaining data into the message buffer Else Copy the remaining data into the message buffer and PAD with 0x00 Endif Else Copy the next block of data into the message buffer Endif Calculate the checksum for the entire (Mode $36) message buffer Copy the two byte checksum to the end of the message buffer Send Tester Present message to all devices (0xFE) Send the mode $36 message and expect a response If an error occurred End the calibration download Endif If the Exception is One (AC3=01) Calculate next calibration download address and copy into address position of message (2 bytes) Else If the Exception is Two (AC3=02) Calculate next calibration download address and copy into address position of message (3 bytes) Else If the Exception is Four (AC3=04) Calculate the next Mode $36 message address (increment the address based on the packet size) Endif If an error occurred End the calibration download Endif END Do-While processing If the response to the last $36 message(s) is a Success (0x76 .. 0x65 or 0x76 .. 0x73 or 0x76 .. 0x86) Set the response code to the sixth byte of the response Else If a negative response (0x7F) was received Set the response code to the fourth byte of the response Else If no response was received Set the response code to 0xFD (No Comm. Response) Else Set the response code to the sixth byte of the response Endif Endif Endif Look for response code in the goto fields If the response code is found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: Step 19 Op-Code B4 Action Fields 10 04 00 00 Goto Fields 80 0D FD 20 7F 28
86 26
FF 28
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
104
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
105
If no comm. occurred Check goto fields for an FD return code (G0, G2, G4, G6, or G8) If found Flag appropriate step to execute next and return Else Check goto fields for an FF return code (G0, G2, G4, G6, or G8) If found Flag appropriate step to execute next and return Else End programming with fatal error Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 28 Op-Code OP Action Fields B4 03 10 00 Goto Fields FD 12 FF 4A 00 00
65 2A
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
106
Negative Response: Response Byte 1 2 3 Value 7F XX XX Byte Description Negative Response Service ID Request Service ID Response Code
Pseudo Code: XX OP AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Get response for the request If a timeout occurred Goto No Communication Processing Endif If a negative response service ID is returned (negative response service ID $7F) If the negative response code = expected positive response service ID plus $40) Set 7f-special process flag **(see details below) Endif Return negative response Else Return positive response Endif
Page
107
(continued) If the response code is not found in the goto fields then the $FF goto will be used to determine the next Interpreter step. If the service request has a negative response code that is NOT the same as an expected positive response message response service ID plus $40: The Interpreter shall look for the FIRST occurrence of the response code in the goto fields to determine the next Interpreter step. If the response code is not found in the goto fields then the $FF goto will be used to determine the next Interpreter step.
Developers Note: This processing puts the requirement for the Interpreter into the hands of the developers who know what response codes are possible for a particular service request. When a developer is writing the Interpreter instructions the need for duplicate goto fields will be obvious and should not present any problems. Negative response processing Utility File Example and Pseudo Code Following is the message structure and utility line for pseudo code example below.
PositiveResponse
ServiceID $77
RequestMessage
ServiceID $37
NegativeResponse
If a PositiveResponse is received (ResponseServiceID is RequestMessageServiceID + $40). Use the first occurrence of the PositiveResponseServiceID ($77) to determine next step. (For this example the next step is Step 1B. ) Else a NegativeResponse was received (ResponseServiceID is $7F). If the NegativeResponseResponseCode equals the RequestMessageServiceID + $40. Use the second occurrence of ResponseCode ($77), or the $FF Goto field if only one occurrence of ResponseCode ($77) is found, to determine next step. (For this example the next step is Step 18.) Else. Use the ResponseCode to determine the next step. (For Response Code $41 in this example, the next step is Step 17.) Endif. Endif.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
108
Pseudo Code: XX 01 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
If AC0 is not equal to zero Set global target byte to value in AC0 Endif If AC1 is not equal to zero Set global source byte to value in AC1 Endif Goto step specified by goto field one (G1) Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 01 Op-Code 01 Action Fields 12 F0 00 00 Goto Fields 00 00 00 00 00 00
00 02
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
109
Pseudo Code: XX 01 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Goto step specified by goto field one (G1) Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 06 Op-Code 03 Action Fields 00 00 00 Goto Fields 00 00 00 00 00 00
01
00 07
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
110
AC2: AC3:
Pseudo Code: XX 10 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use KWP2000 Normal Response processing Build Start Diagnostic Session Request as indicated in the table below If (AC1 == 0) Request Byte 1 2 3 4 5 6 7 Value 80 ## ## 02 10 AC0 CS Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Start routine by local ID request service ID Diagnostic mode 1 byte message checksum
If (AC1 >= $01) & (AC1 <=$05) Request Byte 1 2 3 4 5 6 7 8 Value 80 ## ## 02 10 AC0 AC1 CS Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Start routine by local ID request service ID Diagnostic mode Baud rate Identifier 1 byte message checksum
Calculate checksum and copy into service request (byte 7) Send Start Diagnostic Session Request and receive response (up to 10 Bytes) Goto KWP2000 Response Processing If Start Diagnostic Session positive response is received Switch to baud rate specified by AC1
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
111
(continued) Look for Start Diagnostic Session positive response service ID ($50) in goto fields Else Look for Start Diagnostic Session negative response, response code in goto fields Endif If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 10 Op-Code 10 Action Fields 00 00 00 00 Goto Fields FF 2D 00 00 00 00
50 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
112
Pseudo Code: XX 11 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use KWP2000 Normal Response processing Build ECU Reset Service Request as indicated in the table below Request Byte 1 2 3 4 5 6 7 Value 80 ## ## 02 11 AC0 CS Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) ECU Reset service ID Reset mode 1 byte message checksum
Calculate checksum and copy into service request (byte 7) Send ECU Reset Service Request and receive response (up to 10 Bytes) Goto KWP2000 Response Processing If ECU Reset Service positive response is received Look for ECU Reset Service positive response service ID ($50) in goto fields Else Look for ECU Reset Service negative response, response code in goto fields Endif If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 10 Op-Code 11 Action Fields 01 00 00 00 Goto Fields FF 2D 00 00 00 00
51 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
113
Pseudo Code: XX 14 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use KWP2000 Normal Response processing Build Clear DTCs Service Request as indicated in the table below Request Byte 1 2 3 4 5 6 7 7 Value 80 ## ## 03 14 AC0 AC1 CS Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Clear DTCs service ID Group of diagnostic information (high byte) Group of diagnostic information (low byte) 1 byte message checksum
Calculate checksum and copy into service request (byte 7) Send Clear DTCs Service Request and receive response (up to 10 Bytes) Goto KWP2000 Response Processing If ECU Reset Service positive response is received Look for ECU Reset Service positive response service ID ($50) in goto fields Else Look for ECU Reset Service negative response, response code in goto fields Endif If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 2E Op-Code 14 Action Fields FF 00 00 00 Goto Fields 54 2F FF 33 00 00 00 00 00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
114
Pseudo Code: XX 20 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use KWP2000 Normal Response processing Build Stop Diagnostic Session Request as indicated in the table below Request Byte 1 2 3 4 5 6 Value 80 ## ## 01 20 CS Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Start routine by local ID request service ID 1 byte message checksum
Calculate checksum and copy into service request (byte 6) Send Stop Diagnostic Session Request and receive response (up to 10 Bytes) Goto KWP2000 Response Processing If Stop Diagnostic Session positive response is received Switch to default baud rate (10400Bd) Look for Stop Diagnostic Session positive response service ID ($60) in goto fields Else Look for Stop Diagnostic Session negative response, response code in goto fields Endif If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 10 Op-Code 20 Action Fields 00 00 00 00 Goto Fields FF 3D 00 00 00 00
60 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
115
Pseudo Code: XX 23 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use KWP2000 Normal Response processing Build Start Routine by Address Request as indicated in the table below, contents of the XX locations is detailed in pseudo code following the table Request Byte 1 2 3 4 5 6 7 8 9 10 Value 80 ## ## 5 23 XX XX XX XX CS Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Read Memory by Address request service ID High byte of address Middle byte of address Low byte of address Memory size 1 byte request checksum
If AC0 is equal to $00 Copy the global address into request starting at byte 6 Copy the global length (low byte) into request starting at byte 9 Else Find the routine indicated by the value in AC0 Copy the routine address into request starting at byte 6 Copy the routine length (low byte) into request starting at byte 9 Endif Calculate checksum and copy into service request byte 10 Send Read Memory By Address Request and receive response
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
116
(continued) Goto KWP2000 Response Processing If Read Memory By Address positive response is received If AC1 is equal to $00 If no data bytes received Set high byte of storage location identified by AC2 to 0 Set low byte of storage location identified by AC2 to 0 Else if 1 data byte received Copy data byte to high byte of storage location identified by AC2 Set low byte of storage location identified by AC2 to 0 Else Copy 1.data byte to high byte of storage location identified by AC2 Copy 2.data byte to low byte of storage location identified by AC2 Else Clear 256-byte data buffer identified by AC2 Copy over as many data bytes as received into data buffer identified by AC2 (max. 256) Look for Read Memory By Address Request positive response service ID ($63) in goto fields Else Look for Read Memory By Address Request negative response, response code in goto fields Endif If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 10 Op-Code 23 Action Fields 03 00 03 00 Goto Fields 10 0D FF 99 00 00
63 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
117
AC3
Pseudo Code: XX 27 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use KWP2000 Normal Response processing Build Security Access Request 1 as indicated in the table below Request Byte 1 2 3 4 5 6 7 Value 80 ## ## 02 27 ## CS Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Security access request service ID AC3 (1) Access mode - if AC3 = 0, this byte would be 1, if AC3 = 1, this byte would be 3, a. s. o.. 1 byte message checksum
Calculate checksum and copy into service request (byte 7) Send Security Access Request AC3 (1) for request seed and receive response (up to 10 Bytes) Goto KWP2000 Response Processing
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
118
(continued) If Security Access positive response AC3 (1) is received If both bytes of the seed (Security Access positive response bytes 3 & 4) are zeros and AC1 isn't 1 Set Security Access positive response service ID to success ($34) Indicate Security Access positive response received do not second Security Access Request AC3 (2) Else Use security algorithm corresponding to AC0 to determine ECU's key Build Security Access request AC3(2) as indicated in the table below Request Byte 1 2 3 4 5 6 7 8 9 Value 80 ## ## 04 27 ## XX XX CS Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Security access request service ID AC3 (2) Access mode - if AC3 = 0, this byte would be 2, if AC3 = 1 this byte would be 4, a. s. o. High byte of key Low byte of key 1 byte message checksum
Calculate checksum and copy into service request (byte 9) Send Security Access Request AC3 (2) for send key and receive response (up to 10 Bytes) Goto KWP2000 Response Processing Endif If Security Access positive response AC3 (2) is received Look for Security Access positive response (AC3) service ID ($34) in goto fields Else If Security Access negative response "Invalid Key - $35" is received Repeat entire security process using ones complement security algorithm If security still fails for "Invalid Key - $37" and ones complement was used Look for Security Access negative response AC3 (2) response code ($35) in goto fields Endif Else Look for Security Access negative response AC3 (2) response code in goto fields Endif Endif Else If Security Access negative response "Time Delay not Expired - $37" is received If ten second timer has not expired Delay 2 seconds Retry entire security process Else Look for Security Access negative response AC3 (1) response code ($37) in goto fields Endif Else Look for Security Access negative response AC3 (1) response code in goto fields Endif Endif If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all action and goto fields are hex numbers) Step 02 Op-Code 27 Action Fields 00 00 00 Goto Fields 37 13 FF 22 00 00
01
34 03
00 00 Page 119
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Pseudo Code: Use KWP2000 Normal Response processing Build Input/Output Control by Local ID Request as indicated in the table below Request Byte 1 2 3 4 5 6 7+N Value 80 ## ## 2+N 30 AC0 Control Options to Pass CS Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Start routine by local ID request service ID Routine local ID for routine to begin executing Data from routine indicated by value in AC1. Number of bytes (N) is 1 to 253. For no Control Options AC1 = 0, and N = 0.
If AC1 is not $00 Find routine indicated by value in AC1 to include in request as Control Options Copy entire Data Routine into request starting at byte 7 Endif Calculate checksum and copy into service request (byte 7 + N) Send Input/Output Control by Local ID Request and receive response (up to 10 Bytes) Goto KWP2000 Response Processing If Input/Output Control by Local ID positive response is received Look for Input/Output Control by Local ID positive response service ID ($70) in goto fields Else Look for Input/Output Control by Local ID negative response, response code in goto fields Endif If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 10 Op-Code 30 Action Fields 41 03 00 00 70 11 Goto Fields 10 0D FF 99 00 00 00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
120
Pseudo Code: XX 31 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Use KWP2000 Normal Response processing Build Start Routine by Local ID Request as indicated in the table below Request Byte 1 2 3 4 5 6 7+N Value 80 ## ## 2+N 31 AC0 Routine Entry Options to Pass CS Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Start routine by local ID request service ID Routine local ID for routine to begin executing Data from routine indicated by value in AC1. Number of bytes (N) is 1 to 253. For no Routine Entry Options AC1 = 0, and N = 0.
If AC1 is not $00 Find routine indicated by value in AC1 to include in request as Routine Entry Options Copy entire Data Routine into request starting at byte 7 Endif Calculate checksum and copy into service request (byte 7 + N) Send Start Routine by Local ID Request and receive response (up to 10 Bytes) Goto KWP2000 Response Processing If Start Routine by Local ID positive response is received Look for Start Routine by Local ID positive response service ID ($71) in goto fields Else Look for Start Routine by Local ID negative response, response code in goto fields Endif If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step Op-Code Action Fields Goto Fields 10 31 04 00 00 00 71 11 10 0D FF 99 00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
00 00 Page 121
Pseudo Code: XX 32 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use KWP2000 Normal Response processing Build Stop Routine by Local ID Request as indicated in the table below Request Byte 1 2 3 4 5 6 7 Value 80 ## ## 2 32 AC0 CS Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Stop routine by local ID request service ID Routine local ID for routine to stop executing 1 byte message checksum
Calculate checksum and copy into service request (byte 7) Send Stop Routine by Local ID Request and receive response (up to 10 Bytes) Goto KWP2000 Response Processing If Stop Routine by Local ID positive response is received Look for Stop Routine by Local ID positive response service ID ($72) in goto fields Else Look for Stop Routine by Local ID negative response, response code in goto fields Endif If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 11 Op-Code 32 Action Fields 03 00 00 00 Goto Fields 10 0D FF 99 00 00
72 12
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
122
Use KWP2000 Normal Response processing Build Request Routine Results by Local ID Request as indicated in the table below Request Byte 1 2 3 4 5 6 7 Value 80 ## ## 2 33 AC0 CS Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Request routine results by local ID request service ID Routine local ID for routine from which results are requested 1 byte message checksum
Calculate checksum and copy into service request (byte 7) Send Request Routine Results by Local ID Request and receive response (up to 10 Bytes) Goto KWP2000 Response Processing If Request Routine Results by Local ID positive response is received Look for Request Routine Results by Local ID positive response service ID ($73) in goto fields Else Look for Request Routine Results by Local ID negative response, response code in goto fields Endif If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 12 Op-Code 33 Action Fields 06 00 00 00 Goto Fields 23 0E 64 99 FF 97
73 13
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
123
Pseudo Code: XX 34 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use KWP2000 Normal Response processing Build Request Download Request as indicated below Request Byte 1 2 3 4 5 If AC3 is $01 Request Byte 6 7 8 9 10 11 12 Value XX XX XX AC2 XX XX XX Byte Description Memory address - high byte Memory address - middle byte Memory address - low byte Data Format Identifier Uncompressed memory size - high byte Uncompressed memory size - middle byte Uncompressed memory size - low byte Value 80 ## ## 01 34 Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Request download request service ID
Set the high byte of the memory address to the high byte of the global address set in a F1 Op-Code Set the middle byte of the memory address to the middle byte of the global address set in a F1 Op-Code Set the low byte of the memory address to the low byte of the global address set in a F1 Op-Code Set the Data Format Identifier to the value in AC2 Set the high byte of the memory size to the high byte of the global size set in a F2 Op-Code Set the middle byte of the memory size to the middle byte of the global size set in a F2 Op-Code Set the low byte of the memory size to the low byte of the global size set in a F2 Op-Code Endif Request Byte 6 or 13 Value CS Byte Description 1 byte request checksum
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
124
(continued) Calculate checksum and copy into the service request (byte 6 or 13) Send Request Download Request and receive response (up to 10 Bytes) Goto KWP2000 Response Processing If Request Download positive response is received Look for Request Download positive response Service ID ($74) in goto fields Else Look for Request Download negative response, response code in goto fields Endif If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 10 Op-Code 34 Action Fields 00 00 00 00 Goto Fields 10 0D FF 99 00 00
74 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
125
Pseudo Code: XX 37 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use KWP2000 Normal Response processing Build Request Transfer Exit Request as indicated in the table below Request Byte 1 2 3 4 5 6 Value 80 ## ## 01 37 CS Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Request Transfer Exit request service ID 1 byte request checksum
Calculate checksum and copy into the service request (byte 6) Send Request Transfer Exit and receive response (up to 10 Bytes) Goto KWP2000 Response Processing If Request Transfer Exit positive response is received Look for Request Transfer Exit positive response service ID ($77) in goto fields Else Look for Request Transfer Exit negative response, response code in goto fields Endif If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 10 Op-Code 37 Action Fields 02 04 00 01 Goto Fields FF 3D 00 00 00 00
77 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
126
Pseudo Code: XX 38 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use KWP2000 Normal Response processing Build Start Routine by Address Request as indicated in the table below, contents of the XX locations is detailed in pseudo code following the table Request Byte 1 2 3 4 5 6 7 8 9+N Value 80 ## ## 4+N 38 XX XX XX Routine Entry Options to Pass CS Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Start Routine by Address request service ID High byte of address Middle byte of address Low byte of address Data from routine indicated by value in AC1. Number of bytes (N) is 1 to 251. For no routine entry options AC1 = 0, and N = 0.
If AC0 is not equal to $00 Find the routine indicated by the value in AC0 Endif If AC3 is $00 Copy the routine address into request starting at byte 6 (or byte 7 for two byte addressing) Else Copy the global address into request starting at byte 6 (or byte 7 for two byte addressing) Endif
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
127
(continued) If AC1 is NOT $00 Find routine indicated by value in AC1 to include in request as Routine Entry Options Copy entire Data Routine into request starting at byte 9 Endif Calculate checksum and copy into service request byte ( 9 + N ) Send Start Routine by Address Request and receive response (up to 10 Bytes) Goto KWP2000 Response Processing If Start Routine by Address positive response is received Look for Start Routine by Address positive response service ID ($78) in goto fields Else Look for Start Routine by Address negative response, response code in goto fields Endif If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 10 Op-Code 38 Action Fields 20 00 00 00 Goto Fields 10 0D FF 99 00 00
78 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
128
Pseudo Code: XX 39 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use KWP2000 Normal Response processing Build Stop Routine by Address Request as indicated in the table below, contents of the XX locations is detailed in pseudo code following the table Request Byte 1 2 3 4 5 6 7 8 9 Value 80 ## ## 4 39 XX XX XX CS Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Start Routine by Address request service ID High byte of address Middle byte of address Low byte of address 1 byte request checksum
If AC0 is not equal to $00 Find the routine indicated by the value in AC0 Endif If AC3 is $00 Copy the routine address into request starting at byte 6 (or byte 7 for two byte addressing) Else Copy the global address into request starting at byte 6 (or byte 7 for two byte addressing) Endif Calculate checksum and copy into service request byte 9 Send Start Routine by Address Request and receive response (up to 10 Bytes) Goto KWP2000 Response Processing If Start Routine by Address positive response is received Look for Start Routine by Address positive response service ID ($79) in goto fields Else Look for Start Routine by Address negative response, response code in goto fields Endif
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
129
(continued) If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 10 Op-Code 39 Action Fields 02 00 00 00 Goto Fields 10 0D FF 99 00 00
79 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
130
Pseudo Code: XX 3A AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use KWP2000 Normal Response processing Build Request Routine Results by Address Request as indicated in the table below Request Byte 1 2 3 4 5 6 7 8 9 Value 80 ## ## 4 3A XX XX XX CS Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Request routine results by address request service ID High byte of address Middle byte of address Low byte of address 1 byte request checksum
Calculate checksum and copy into service request (byte 9) Send Request Routine Results by Local ID Request and receive response (up to 10 Bytes) Goto KWP2000 Response Processing If Request Routine Results by Local ID positive response is received Look for Request Routine Results by Local ID positive response service ID ($7A) in goto fields Else Look for Request Routine Results by Local ID negative response, response code in goto fields Endif If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 12 Op-Code 3A Action Fields 06 00 00 00 Goto Fields 23 0E 64 99 FF 97
7A 13
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
131
AC1: AC2:
AC3:
Pseudo Code: XX 3B AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use KWP2000 Normal Response processing Build Write Data by Local ID Request as indicated in the table below Request Byte 1 2 3 4 5 6 6+N Value 80 ## ## 2+N 3B XX Record Values 1 to N CS Byte Description Format byte for physical addressing Global target ID Global source byte Length of request from byte 5 up to checksum (not included) Write data by local ID request service ID Local identifier of data to download The pseudo code below explains how the Record Value portion of this request is filled. The maximum number of bytes is 253. N = VIN or part number length + routine length. 1 byte request checksum
If AC1 is not $00 If AC2 is $00 Find routine indicated by value in AC1 to include in request as Record Values if AC3 is $00 Use AC0 as local ID Copy entire Data Routine into request starting at first record value byte ElseIf AC3 is $01 Use first byte of routine as local ID
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
132
(continued) Copy remaining Routine Data into request starting at first record value byte Else ERR_FATAL Elseif AC2 is $01 if AC3 is $00 Use AC0 as local ID Copy ECU configuration Data into request starting at first record value byte Else ERR_FATAL Endif Elseif AC2 is $02 if AC3 is $00 Use AC0 as local ID Copy entire Module Data into request starting at first record value byte ElseIf AC3 is $01 Use first byte of Module as local ID Copy remaining Module Data into request starting at first record value byte Else ERR_FATAL Endif Else ERR_FATAL Else if AC3 is $00 Use AC0 as local ID If AC0 is 90 Copy the VIN into the request starting at byte 7 Elseif AC0 is 98 Copy the serial number into the request starting at byte 7 Elseif AC0 is 99 If AC2 is 6 Convert programming date into a 6 character ASCII string with format YYMMDD Copy the 6 character ASCII string into the request starting at byte 7 Else Copy the programming date into the request starting at byte 7 Endif Elseif AC0 < $E0 or AC0 > $EF ERR_FATAL Endif Else ERR_FATAL Endif Calculate checksum and copy into the service request (byte 6 + N) Send Write Data by Local ID Request and receive response (up to 10 Bytes) Goto KWP2000 Response Processing If Write Data by Local ID positive response is received Look for Write Data by Local ID positive response service ID ($7B) in goto fields Else Look for Write Data by Local ID negative response, response code in goto fields Endif If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 21 Op-Code 3B Action Fields 90 00 00 00 7B 22 Goto Fields FF 99 00 00 00 00 00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
133
Pseudo Code: XX 3B AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use KWP2000 Normal Response processing Build Write Data by Memory Address Service Request as indicated in the table below Request Byte 1 2 3 4 5 6 7 8 9 9+N Value 80 ## ## 5+N 3D XX XX XX N Record Values 1 to N CS Byte Description Format byte for physical addressing Global target ID Global source byte Length of request from byte 5 up to checksum (not included) Write Memory By Address request service ID Memory address - High byte Memory address - Middle byte Memory address - Low byte Memory size The pseudo code below explains how the Record Value portion of this request is filled. The maximum number of bytes is 250. N = VIN or part number length + routine length. 1 byte request checksum
If AC0 is $80 Copy the VIN into the service request starting at byte 10 Else If AC0 is $84 Copy the Manufacturer Hardware Number into the service starting at byte 10 Endif Endif
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
134
(continued) If AC3 is $01 If AC1 is not $00 Find routine indicated by value in AC1 to include in request as Record Values Copy the routine address into request starting at byte 6 (or byte 7 for two byte addressing) Endif If AC0 is $00 Do while more routine bytes downloaded If this is the last packet of the routine Copy the remaining routine into the data area of buffer Else Copy as many routine data bytes into the Write Memory By Address Service Request (starting at byte 10) as the utility file message length states (max. 250) Endif Copy number of data bytes into byte 9 Calculate checksum and copy into the Write Memory By Address Service Request Send Write Data by Memory Address Service Request and receive response If an error occurred End the routine download Endif End do while more routine bytes downloaded Else Copy number of data bytes into byte 9 Calculate checksum and copy into the Write Memory By Address Service Request Send Write Data by Memory Address Service Request and receive response Endif Else Copy the global address into request starting at byte 6 (or byte 7 for two byte addressing) If AC1 is not $00 Find routine indicated by value in AC1 to include in request as Record Values Copy entire Data Routine into request starting at next record value byte Endif Copy utility file message length into byte 9 Calculate checksum and copy into the service request (byte 9 + N) Send Write Data by Memory Address Service Request and receive response (up to 10 Bytes) Goto KWP2000 Response Processing If Write Data by Memory Address positive response is received Look for Write Data by Memory Address positive response service ID ($7D) in goto fields Else Look for Write Data by Memory Address negative response, response code in goto fields Endif If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 21 Op-Code 3D Action Fields 90 00 2B 00 Goto Fields FF 99 00 00 00 00
7D 22
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
135
Pseudo Code: XX 71 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use KWP2000 Normal Response processing Build Start Routine by Local ID Request as indicated in the table below Request Byte 1 2 3 4 5 6 7+N Value 80 ## ## 2+N 31 AC0 Routine Entry Options to Pass CS Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Start routine by local ID request service ID Routine local ID for routine to begin executing Data from routine indicated by value in AC1. Number of bytes (N) is 1 to 253. For no Routine Entry Options AC1 = 0, and N = 0.
If AC1 is not $00 Find routine indicated by value in AC1 to include in request as Routine Entry Options Copy entire Data Routine into request starting at byte 7 Endif Calculate checksum and copy into service request (byte 7 + N) Send Start Routine by Local ID Request and receive response (up to 10 Bytes) Goto KWP2000 Response Processing
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
136
(continued) If Start Routine by Local ID positive response is received Copy first byte of positive response data to high byte of storage location identified by AC2 Copy second byte of positive response data to low byte of storage location identified by AC2 Look for Start Routine by Local ID positive response service ID ($71) in goto fields Else Look for Start Routine by Local ID negative response, response code in goto fields Endif If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 10 Op-Code 71 Action Fields 04 00 01 00 Goto Fields 10 0D FF 99 00 00
71 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
137
Pseudo Code: XX 78 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use KWP2000 Normal Response processing Build Start Routine by Address Request as indicated in the table below, contents of the XX locations is detailed in pseudo code following the table Request Byte 1 2 3 4 5 6 7 8 9+N Value 80 ## ## 4+N 38 XX XX XX Routine Entry Options to Pass CS Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Start Routine by Address request service ID High byte of address Middle byte of address Low byte of address Data from routine indicated by value in AC1. Number of bytes (N) is 1 to 251. For no Routine Entry Options AC1 = 0, and N = 0.
If AC0 is not equal to $00 Find the routine indicated by the value in AC0 Endif
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
138
(continued) If AC3 is $00 Copy the routine address into request starting at byte 6 (or byte 7 for two byte addressing) Else Copy the global address into request starting at byte 6 (or byte 7 for two byte addressing) Endif If AC1 is NOT $00 Find routine indicated by value in AC1 to include in request as Routine Entry Options Copy entire Data Routine into request starting at byte 9 Endif Calculate checksum and copy into service request byte ( 9 + N ) Send Start Routine by Address Request and receive response (up to 10 Bytes) Goto KWP2000 Response Processing If Start Routine by Address positive response is received Copy appropriate response byte to high byte of storage location identified by AC2 Copy appropriate response byte to low byte of storage location identified by AC2 Look for Start Routine by Address positive response service ID ($78) in goto fields Else Look for Start Routine by Address negative response, response code in goto fields Endif If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 10 Op-Code 78 Action Fields 20 00 03 00 Goto Fields 10 0D FF 99 00 00
78 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
139
Pseudo Code: XX 81 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use KWP2000 Normal Response processing Wait for W5min idle time Send wake up pattern to the ECU Build Start Communication Request as indicated in the table below Request Byte 1 2 3 4 5 Value 81 ## ## 81 CS Byte Description Format byte for physical addressing and length Global target byte Global source byte Start communication request service ID 1 byte service request checksum
Calculate checksum and copy into the service request (byte 5) Send Start Communication Request and get the response (up to 10 Bytes) Goto KWP2000 Response Processing Set addressing mode and use of length information based on two returned key bytes Look for Start Communication positive response service ID ($C1) in goto fields If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 01 Op-Code 81 Action Fields 00 00 00 00 Goto Fields FF 99 00 00 00 00
C1 02
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
140
Pseudo Code: XX 82 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use KWP2000 Normal Response processing Build Stop Communication Request as indicated in the table below Request Byte 1 2 3 4 5 Value 81 ## ## 82 CS Byte Description Format byte for physical addressing Global target byte Global source byte Stop communication request service ID 1 byte service request checksum
Calculate checksum and copy into the service request (byte 5) Send Stop Communication Request and get the response (up to 10 Bytes) Goto KWP2000 Response Processing Look for Stop Communication positive response service ID ($C2) in goto fields If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 01 Op-Code 82 Action Fields 00 00 00 00 Goto Fields FF 09 00 00 00 00
C2 02
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
141
Pseudo Code: XX 83 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use KWP2000 Normal Response processing Build Access Communications Parameters Request 1 as indicated in the table below. Provided this request is done after security has passed the ECU will return the reprogramming timing parameters. Request Byte 1 2 3 4 5 6 Value 82 ## ## 83 00 CS Byte Description Format byte for physical addressing plus length Global target byte Global source byte Access communication parameters request service ID Timing parameter identifier 1 byte service request checksum
Calculate checksum and copy into the service request (byte 6) Send Access Communications Parameters Request 1 and get the response (up to 10 Bytes) Goto KWP2000 Response Processing If Access Communications Parameter Request 1 positive response is received Build Access Communications Parameters Request 2 as indicated in the table below Request Byte 1 2 3 4 5 6 7 8 9 10 11 Value 87 ## ## 83 03 XX XX XX XX XX CS Byte Description Format byte for physical addressing plus length Global target byte Global source byte Access communication parameters request service ID Timing parameter identifier P2 minimum P2 maximum P3 minimum P3 maximum P4 minimum 1 byte service request checksum
Copy P2 minimum from Access Communications Parameters Request 1 to Request 2 position 6 Copy P2 maximum from Access Communications Parameters Request 1 to Request 2 position 7 Copy P3 minimum from Access Communications Parameters Request 1 to Request 2 position 8 Copy P3 maximum from Access Communications Parameters Request 1 to Request 2 position 9
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
142
(continued) Copy P4 minimum from Access Communications Parameters Request 1 to Request 2 position 10 Calculate checksum and copy into the service request (byte 11) Send Access Communications Parameter Request 2 and get the response (up to 10 Bytes) Goto KWP2000 Response Processing Else Set accessing parameter list error Endif If Access Communication positive response 2 is received Set tester timing values as indicated in response 1 Look for Access Communication positive response 2 service ID ($C3) in goto fields Else Set error accessing parameter list Endif If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 01 Op-Code 83 Action Fields 00 00 00 00 Goto Fields FF 39 00 00 00 00
C3 02
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
143
Pseudo Code: XX 84 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use KWP2000 Normal Response processing Build Access Communications Parameters Request as indicated in the table below Request Byte 1 2 3 4 5 6 7 8 9 10 11 Value 87 ## ## 83 03 00 AC0 AC1 AC2 AC3 CS Byte Description Format byte for physical addressing plus length Global target byte Global source byte Access communication parameters request service ID Timing parameter identifier P2 minimum P2 maximum P3 minimum P3 maximum P4 minimum 1 byte service request checksum
If AC0, AC1, AC2 and AC3 are all $00 Set P2 maximum to 1 (25 ms) Set P3 minimum to 40 (20 ms) Set P3 maximum to 1 (250 ms) Set P4 minimum to 0 (0 ms) Endif Calculate checksum and copy into the service request (byte 11) Send Access Communications Parameter Request and get the response (up to 10 Bytes) Goto KWP2000 Response Processing If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 01 Op-Code 84 Action Fields 01 0A 78 00 Goto Fields FF 39 00 00 00 00
C3 02
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
144
4 byte naming convention = High, MidHigh, MidLow, Low Pseudo Code: XX 90 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Find the routine indicated by value AC0 Use KWP2000 Normal Response processing Build Transfer Data Request as indicated below Request Byte 1 2 3 4 5 Value 80 ## ## 4+N 36 Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Transfer Data Request Service ID
If AC3 is $00 or $40 For 2 bytes for address information: Request Value Byte Description Byte 6 XX Memory address - High byte 7 XX Memory address - Low byte 8 XX Data byte 1 The pseudo code below explains how the data portion of this request is filled 7+N XX Data byte N (N <= 252) 8+N CS 1 byte request checksum Set High byte of memory address to MidLow byte of routine address Set Low byte of memory address to Low byte of routine address
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
145
(continued) For 3 bytes for address information: Request Byte 6 7 8 9 8+N 9+N Value XX XX XX XX Byte Description Memory address - High byte Memory address - Middle byte Memory address - Low byte Data byte 1 The pseudo code below explains how the data portion of this request is filled Data byte N (N <= 251) 1 byte request checksum
XX CS
Set High byte of memory address to MidHigh byte of routine address Set Middle byte of memory address to MidLow byte of routine address Set Low byte of memory address to Low byte of routine address Else Do not include any address information in the Service Request Request Byte 6 5+N 6+N Endif Do while more routine to download If this is the last packet of the routine Change request length (byte 4) to size of last packet Copy the remaining routine into the data area of buffer Else Copy the next packet of routine into the data area of buffer starting at byte 6 or 10 Endif Calculate checksum and copy into the Transfer Data Service Request If AC3 is $40 or $41 Build Transfer Data Request as indicated below Request Byte 1 2 3 4 5 6 7 8 9 10 11 12 Note: Value 80 ## ## 12 34 XX XX XX 00 XX XX XX Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Request Download Request Service ID Global address - High byte Global address - Middle byte Global address - Low byte Data Format Identifier Uncompressed memory size - high byte Uncompressed memory size - middle byte Uncompressed memory size - low byte Value XX Byte Description Data byte 1 The pseudo code below explains how the data portion of this request is filled Data byte N (N <= 254) 1 byte request checksum
XX CS
Increment Global address If remaining data is less, use number of remaining bytes for Uncompressed memory size
Calculate checksum and copy into the Request Download service request Send the Request Download request and expect a response If an error occurred End the routine download Endif
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
146
Endif Send the Transfer Data Request and expect a response (up to 10 bytes) If AC3 is $00 or $40 Calculate the next download address Copy the next download address in the Service Request Endif If an error occurred End the routine download Endif If AC3 is $40 or $41 Build Request Transfer Exit Request as indicated below Request Byte 1 2 3 4 5 Value 80 ## ## 05 37 Byte Description
(continued)
Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Request Transfer Exit Request Service ID
Calculate checksum and copy into the Request Transfer Exit service request Send the Request Transfer Exit request and expect a response If an error occurred End the routine download Else Increment address used in Request Download service by the number of bytes transferred If remaining data is less than uncompressed memory size Use number of remaining bytes in Request Download service Endif Endif Endif End do while more routine to download If Transfer Data positive response is received Look for Transfer Data positive response service ID ($76) in goto fields Else Look for Transfer Data negative response, response code in goto fields Endif If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 10 Op-Code 90 Action Fields 01 00 03 00 Goto Fields FD 0D FF 20 00 00
76 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
147
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
148
(continued) Pseudo Code: XX 93 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Use KWP2000 Normal Response processing Build Transfer Data Request as indicated below Request Byte 1 2 3 Value 80 ## ## Byte Description Format byte for physical addressing Global target byte Global source byte
If AC3 is $02 or $42 Do not include any address information in the Service Request Request Byte 4 5 6 5+N 6+N Value 1+N 36 XX Byte Description Length of request from byte 5 up to checksum (not included) Transfer Data request service ID Data byte 1 The pseudo code below explains how the data portion of this request is filled Data byte N (N <= 254) 1 byte request checksum
XX CS
Else If the low nibble of exception value AC3 is $0 (AC3 is $00, $40, $80 or $C0) Set data address to address from the utility file Header Else If AC3 is $03 or $43 Set pointer of High byte of data address information as data packet checksum byte Set pointer Low byte of data address information as data packet message length Else Set data address to Global Address Endif Endif For 2 bytes for address information or for exception $03 or $43: Request Value Byte Description Byte 4 1+N Length of request from byte 5 up to checksum (not included) 5 36 Transfer Data request service ID 6 XX Data address information - High byte / data packet checksum byte 7 XX Data address information - Low byte / data packet message length 8 XX Data byte 1 The pseudo code below explains how the data portion of this request is filled 7+N XX Data byte N (N <= 252) 8+N CS 1 byte request checksum Set High byte of memory address to MidLow byte of address information Set Low byte of memory address to Low byte of address information
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
149
(continued) For 3 bytes for address information:: Request Value Byte Description Byte 4 1+N Length of request from byte 5 up to checksum (not included) 5 36 Transfer Data request service ID 6 XX Data address information - High byte 7 XX Data address information - Middle Byte 8 XX Data address information - Low byte 9 XX Data byte 1 The pseudo code below explains how the data portion of this request is filled 8+N XX Data byte N (N <= 251) 9+N CS 1 byte request checksum Set High byte of memory address to MidHigh byte of address information Set Middle byte of memory address to MidLow byte address information Set Low byte of memory address to Low byte of address information Endif Find the calibration file with ID of AC0 Do while more calibration file to transfer If this is the last packet of a file to transfer Change data packet length to size of last packet Copy the remaining data into the data area of buffer If AC3 is $03 or $43 Calculate checksum and move as data packet checksum byte Move packet length as data packet message length Endif Else Copy the next packet of data into the data area of buffer Endif If AC3 is $03 or $43 Calculate checksum and move as data packet checksum byte Move packet length as data packet message length Endif If exception value AC3 is greater than or equal to $80 Increment packet address by number of bytes transferred Endif Calculate checksum and copy into the Transfer Data Request If AC3 is $40, $41, $42, $43, $C0 or $C1 Build Transfer Data Request as indicated below Request Byte 1 2 3 4 5 6 7 8 9 10 11 12 Value 80 ## ## 12 34 XX XX XX 00 XX XX XX Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Request Download Request Service ID Global address - High byte Global address - Middle byte Global address - Low byte Data Format Identifier Uncompressed memory size - high byte Uncompressed memory size - middle byte Uncompressed memory size - low byte Page 150
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Note: Increment Global address (continued) If remaining data is less, use number of remaining bytes for Uncompressed memory size Calculate checksum and copy into the Request Download service request Send the Request Download request and expect a response If an error occurred End the routine download Endif Endif Send the Transfer Data Request and expect a response (up to 10 bytes) If AC3 is $40, $41, $42, $43, $C0 or $C1 Build Request Transfer Exit Request as indicated below Request Byte 1 2 3 4 5 Value 80 ## ## 05 37 Byte Description Format byte for physical addressing Global target byte Global source byte Length of request from byte 5 up to checksum (not included) Request Transfer Exit Request Service ID
Calculate checksum and copy into the Request Transfer Exit service request Send the Request Transfer Exit request and expect a response If an error occurred End the routine download Else Increment address used in Request Download service by the number of bytes transferred If remaining data is less than uncompressed memory size Use number of remaining bytes in Request Download service Endif Endif Endif If an error occurred End the calibration download Endif End do while more calibration to transfer If Transfer Data positive response is received Look for Transfer Data positive response service ID ($76) in goto fields Else Look for Transfer Data negative response, response code in goto fields Endif If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers. * An FD should be a goto field for a 93 Op-Code.) Step 19 Op-Code 93 Action Fields 02 04 00 00 Goto Fields 10 0D FD 20 FF 28
76 26
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
151
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
152
If no comm. occurred Set return code to FD Goto response code handling Endif Typical Interpreter Line: Step 28 Op-Code B0 Action Fields 10 01 00 00 Goto Fields FD 12 FF 4A 00 00
76 29
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
153
Negative Response: Response Byte 1 2 3 4 5 Pseudo Code: XX OP AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Value 7F XX XX XX XX Byte Description Negative Response Service ID Request Service ID Response Code Ignored by interpreter Ignored by interpreter
Get response for the request If a timeout occurred Goto No Communication Processing Else If a negative response service ID is returned (negative response service ID $7F) If the negative response code = expected positive response service ID plus $40) Set 7f-special process flag **(see details below) Endif Set return code to negative response code Else Set return code to positive response service ID Endif Goto response code handling Endif
Page
154
(continued) As indicated in the example below the second occurrence of the response code can occur anywhere in the remaining goto fields (note: For clarity, it is recommended that the duplicate response code goto fields be on the first line and not separated as on a continuation line using the F8 continuation OpCode). If the response code is not found in the goto fields then the $FF goto will be used to determine the next Interpreter step. If the service request has a negative response code that is NOT the same as an expected positive response message response service ID plus $40: The Interpreter shall look for the FIRST occurrence of the response code in the goto fields to determine the next Interpreter step. If the response code is not found in the goto fields then the $FF goto will be used to determine the next Interpreter step. Developers Note: This processing puts the requirement for the Interpreter into the hands of the developers who know what response codes are possible for a particular service request. When a developer is writing the Interpreter instructions the need for duplicate goto fields will be obvious and should not present any problems.
Negative response processing Utility File Example and Pseudo Code Following is the message structure and utility line for pseudo code example below.
PositiveResponse
ServiceID $77
RequestMessage
ServiceID $37
NegativeResponse
ResponseID $7F
RequestID $37
ResponseCode $77
Step 12
Op-Code 37
AC0 00
AC1 00
AC2 00
AC3 00
G0-G1 77-1B
G2-G3 41-17
G4-G5 72-17
G6-G7 77-18
G8-G9 FF-15
If a PositiveResponse is received (ResponseServiceID is RequestMessageServiceID + $40). Use the first occurrence of the PositiveResponseServiceID ($77) to determine next step. (For this example the next step is Step 1B. ) Else a NegativeResponse was received (ResponseServiceID is $7F). If the NegativeResponseResponseCode equals the RequestMessageServiceID + $40. Use the second occurrence of ResponseCode ($77), or the $FF Goto field if only one occurrence of ResponseCode ($77) is found, to determine next step. (For this example the next step is Step 18.) Else. Use the ResponseCode to determine the next step. (For Response Code $41 in this example, the next step is Step 17.) Endif. Endif.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
155
Pseudo Code: XX 01 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
If AC0 is true If AC0 is FE End programming with a fatal error Else Set Target Address to value in AC0 Endif Endif If AC1 is true Set Source Address to value in AC1 Endif Goto step specified by goto field one (G1) Typical Interpreter Line: Step 01 Op-Code 01 Action Fields 11 F1 00 00 Goto Fields 00 00 00 00 00 00
00 02
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
156
Action Fields: AC0: Diagnostic Operation Level 02 Disable all DTCs 03 enableDTCsDuringDeviceControl 00 - Not Used 00 - Not Used 00 - Not Used
Pseudo Code: XX 10 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Build message as indicated in the table below Request Byte 1 2 Value 10 AC0 Byte Description Initiate Diagnostic Operation Request Service ID Diagnostic Operation Level
Send message Goto GMLAN Response Processing Typical Interpreter Line: Step 01 Op-Code 10 Action Fields 02 00 00 00 Goto Fields FF 22 00 00 00 00
50 02
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
157
Action Fields: AC0: AC1: AC2: AC3: 00 - Not Used 00 - Not Used 00 - Not Used 00 - Not Used
Pseudo Code: XX 14 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Build message as indicated in the table below Request Byte 1 Value 04 Byte Description Clear Diagnostic Information
Send message Goto GMLAN Response Processing Typical Interpreter Line: Step 01 Op-Code 14 Action Fields 00 00 00 00 Goto Fields FF 22 00 00 00 00
44 02
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
158
Build message as indicated in the table below Request Byte 1 2 Send message If positive response then If AC3 is false Use Data Buffer (256-byte buffer) Else Use Byte Buffer (2-byte buffer) Endif Save the data of the response starting with the first Data Byte (after the echo of the Data Identifier) to storage location indicated by AC1 (2 or 256 bytes max, fill with zero) Endif Goto GMLAN Response Processing Typical Interpreter Line: Step 06 Op-Code 1A Action Fields C1 01 00 00 Goto Fields FF 22 00 00 00 00 Value 1A AC0 Byte Description Read Data by Identifier Request Service ID Data Identifier
5A 07
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
159
Action Fields: AC0: AC1: AC2: AC3: 00 - Not Used 00 - Not Used 00 - Not Used 00 - Not Used
Pseudo Code: XX 20 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Build message as indicated in the table below Request Byte 1 Value 20 Byte Description Read Data by Identifier Request Service ID
If we are currently processing Part 2 of the utility file Send message Else Abort the utility file processing (fatal error) Endif Goto GMLAN Response Processing Typical Interpreter Line: Step 06 Op-Code 20 Action Fields 00 00 00 00 Goto Fields FD 12 FF 22 00 00
60 07
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
160
Action Fields: AC0: AC1: AC2: AC3: PID high byte PID low byte ID for storage location of response bytes (0x00 0x13) Exceptions: 00 Use the 256-byte Data Buffer 01 Use the 2-byte Data Buffer Pseudo Code: XX 22 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Build message as indicated in the table below Request Byte 1 2 3 Send message If positive response then If AC3 is equal to 0x01 Use Byte Buffer (2-byte buffer) Else Use Data Buffer (256-byte buffer) Endif Save the data of the response starting with the first Data Byte (after the echo of the PID) to storage location indicated by AC2 (2 or 256 bytes max, fill with zero) Endif Goto GMLAN Response Processing Typical Interpreter Line: Step 06 Op-Code 22 Action Fields C1 01 05 00 Goto Fields FF 22 00 00 00 00 Value 22 AC0 AC1 Byte Description Read Data by Parameter Identifier Request Service ID Parameter Identifier high byte Parameter Identifier low byte
62 07
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
161
AC2:
AC3:
Pseudo Code: XX AE AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Build message as indicated in the table below Request Byte 1 2 3 4 5 6 7 Value AE AC0 AC1 SC SC SC SC Byte Description Request Device Control CPID Number Security Access Device Control Trigger Security Code (MSB) SPS = VIT2 / DPS = manual entry Security Code SPS = VIT2 / DPS = manual entry Security Code SPS = VIT2 / DPS = manual entry Security Code (LSB) SPS = VIT2 / DPS = manual entry
If AC1 equals 20, 40 or 80 If AC2 equals 01 Set the SecurityCode to the Security Code 1 ElseIf AC2 equals 02 Set the SecurityCode to the Security Code 2 Endif Copy SecurityCode (ASCII) into message bytes 4 7 Else End with error Endif Send message Goto GMLAN Response Processing Typical Interpreter Line: Step 10 Op-Code 25 Action Fields 01 80 01 01 Goto Fields E3 0D FD 20 FF 2B
EE 11
00 00 Page 162
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Action Fields: AC0: Security Algorithm 00 - Ones Complement (Default Security Algorithm) 01 - to FE Production Algorithm (Production Security Algorithms) 00 - Security level 1 (level $01 and $02 get seed/send key) 01 - Security level 3 ( DVT level $03 and $04 DVT get seed/send key) XX Security level (2*XX + 1) Example : $7D = security level $FB ($FB and $FC get seed/send key) 00 GM Security Algorithm, Security Key Calculation References the original GMLAN Algorithms Security Table GMLAN-0 01 Not implemented: GM Security Algorithm, Security Key Calculation in other source 02 Not implemented: Non GM Security Algorithm, Security Key Calculation in other source 03 Non GM Security Algorithm, Security Key Calculation 10 GM Security Algorithm, Security Key Calculation References the new GMLAN Algorithms Security Table GMLAN-1 Exceptions: 00 Don't send key if seed is 0 (according to specification) 01 Send key even if seed is 0
AC1:
AC2:
AC3:
Pseudo Code: XX 27 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Build Security Access Request 1 as indicated in the table below Request Byte 1 2 Value 27 XX Byte Description Security Access Request Service ID AC1 (1) Access mode if AC1 = 0, this byte would be 1, if AC1 = 1 this byte would be 3, etc.
Send Security Access Request 1 for request seed and receive response
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
163
(continued) If Security Access positive response 1 is received If both bytes of the seed (Security Access positive response bytes 3 & 4) are zeros and exception isn't 1 Indicate Security Access positive response received do not second Security Access Request 2 Else Use security algorithm corresponding to AC0 to determine ECU's key (For GMLAN Security Algorithms, the High Nibble of AC2 will also be evaluated to determine which GMLAN Security Table to reference --- Table 0 (GMLAN-0) or Table 1 (GMLAN-1).) Build Security Access request 2 as indicated in the table below Request Byte 1 2 3 4 Value 27 XX XX XX Byte Description Security Access Request Service ID AC1 (2) Access mode if AC1 = 0, this byte would be 2, if AC1 = 1 this byte would be 4, etc. High byte of key Low byte of key
Send Security Access Request 2 for send key and receive response Endif If Security Access positive response 2 is received Look for Security Access positive response 2 service ID (67) in goto fields Else If Security Access negative response "Invalid Key - 35" is received and ones complement was not used Repeat entire security process using ones complement security algorithm Else Look for Security Access negative response 2 response code in goto fields Endif Endif Else If Security Access negative response "Time Delay not Expired - $37" is received If ten second timer has not expired Delay 2 seconds Retry entire security process Else Look for Security Access negative response AC3 (1) response code ($37) in goto fields Endif Else Look for Security Access negative response AC3 (1) response code in goto fields Endif Endif If found Goto appropriate step Else Goto step indicated by FF goto field Endif Typical Interpreter Line: (all action and goto fields are hex numbers) Step 02 Op-Code 27 Action Fields 00 00 00 Goto Fields 37 13 FF 22 00 00
01
67 03
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
164
Page
165
(continued) If the high nibble of AC3 is 0 (0X) Find the routine indicated by value AC1 Set MemorySize to routine length ElseIf the high nibble of AC3 is 1 (1X) Set MemorySize to length from the utility file Header ElseIf the high nibble of AC3 is 2 (2X) Set MemorySize to Global Length (default 2X) ElseIf the high nibble of AC3 is 3 (3X) Find the calibration file indicated by value AC1 Set MemorySize to the size of the calibration file Else End with error (invalid high nibble of AC3) Endif If AC3 & 0F is true Set LengthSize to AC3 & 0F Else Set LengthSize to TypeOfAddressing Endif if LengthSize is 2 Copy High byte of MemorySize into message byte 3 Copy Low byte of MemorySize into message byte 4 Elseif LengthSize is 3 Copy High byte of MemorySize into message byte 3 Copy Middle byte of MemorySize into message byte 4 Copy Low byte of MemorySize into message byte 5 Elseif LengthSize is 4 Copy High byte of MemorySize into message byte 3 Copy MidHigh byte of MemorySize into message byte 4 Copy MidLow byte of MemorySize into message byte 5 Copy Low byte of MemorySize into message byte 6 Endif Send message Goto GMLAN Response Processing Typical Interpreter Line: Step 10 Op-Code 34 Action Fields 10 00 00 20 Goto Fields FF 22 00 00 00 00
74 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
166
AC1: AC2:
AC3:
Example of DID Calibration file: 88880002220000F424004141020784226552130000078501E200000000 (must be in binary format) Module Checksum Module ID Header Format ID SWMI Alpha Code Block count Block 1 Length Block 1 Block 2 Length Block 2 = 8888 = 0002 = 2200 = 00 F4 24 00 (16000000) = 41 41 (AA) = 02 = 07 = 84 22 65 52 13 00 00 = 07 = 85 01 E2 00 00 00 00 Page 167
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
(continued) Pseudo Code: XX 3B AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Build message as indicated in the table below Request Byte 1 2 3 Value 3B XX XX XX Byte Description Write Data by Identifier Data Identifier Data Byte 1 Data Byte ...
If AC2 is not zero and AC3 is 22 Open calibration AC2 Skip GlobalHeaderLength bytes Read BlockCount While BlockCount > 0 Read BlockLength Copy BlockLength bytes of calibration AC2 into message (first byte is Data Identifier) Send message If not a positive response is received Break while Endif Subtract 1 from BlockCount Loop Endif If high nibble of AC3 is 0 Set Data Identifier to AC0 If the low nibble of AC3 is 0 Copy internal VIT data based on AC0 into the message Send message Else (the low nibble of AC3 is 3 (ONLY supported for the Plant Manufacturing environment) Copy internal VIT data based on AC1 (Internal Data Specifier) into the message Send message Endif Endif If high nibble of AC3 is 1 Find the routine indicated by value AC1 If the low nibble of AC3 is 1 Set Data Identifier to first routine data byte Copy remaining routine data bytes into the message Send message Else (the low nibble of AC3 is 0) Set Data Identifier to AC0 Copy routine data into message Send message Endif Endif If high nibble of AC3 is 3 Set Data Identifier to AC0 Copy AC2 number of bytes from stored information where AC1 is the ID for saved bytes into the message (max 256 bytes) Send message Endif
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
168
(continued) If high nibble of AC3 is 4 Set Data Identifier to AC0 Place the last 8 digits of the VIN (internal data) into the message (Note: If the last 8 digits are 0x00 data, then simulate a positive response without sending the message) Endif If a valid AC3 was processed GoTo GMLAN Response Processing Else End with fatal error Endif
7B 22
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
169
If AC0 == 0 Use STmin from controllers flow control frame (default behavior) for the subnets specified in AC1 Else If AC0 == 1 Use STmin specified by AC2 for the subnets specified in AC1 Else Stop immediately Endif If setting STmin succeeded Goto step specified in goto field 1 (G1). Else Goto step specified in goto field 3 (G3). Endif Typical Interpreter Line: (all Action and Goto fields are hex numbers) Step 01 Op-Code 84 Action Fields 01 07 02 00 Goto Fields FF 22 00 00 00 00
00 02
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
170
Build message as indicated in the table below Request Byte 1 Send message If positive response then Save byte2 from the response to storage location indicated by AC0 (use zero as high byte) Endif Goto GMLAN Response Processing Value A2 Byte Description ReportProgrammedState
E2 07
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
171
Action Fields: AC0: AC1: DPID (Dynamic Parameter Identifier) ID for storage location of response bytes 0x00..0x13 256-byte Data Buffers (0..19 decimal) 90 VIN in VIT2 91 Vehicle manufacturer hardware number (VMECUHN) in VIT2 98 Repair shop code or serial number (RSCOSN) in VIT2 99 Programming date (PD) in VIT2 CB End model number (EMN) in VIT2 CC System supplier hardware number (SSECUHN) in VIT2 Number of bytes to store Exceptions: Bit 7: 0 Copy directly 1 Convert into decimal number ASCII string Bit 0..6 Start location of bytes to copy (0 refers to packet identifier)
AC2: AC3:
Pseudo Code: XX AA AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Build message as indicated in the table below Request Byte 1 2 2 Send message Value AA 01 AC0 Byte Description Read Data by Identifier Request Service ID Mode (single shot) Dynamic Packet Identifier
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
172
(continued) If response then If AC2 specifies more bytes to copy than available from start position (AC3 $ $7F) to end Set number of bytes to copy to number of available bytes Else Set number of bytes to copy to AC2 Endif If AC3 & $80 If AC2 <= 4 Treat data as a 1..4 byte number, convert into a string as decimal to temporary buffer Set number of bytes to copy to string length of string in temporary buffer Else Copy specified number of bytes into temporary buffer Endif If AC1 is in range $00..$13 Copy temporary buffer to one of the 256-byte Data Buffers (AC1 = index) Else if AC1 is $90 Copy temporary buffer to VIN in VIT2 Else if AC1 is $91 Copy temporary buffer to Vehicle Manufacturer ECU Hardware Number in VIT2 Else if AC1 is $98 Copy temporary buffer to Repair Shop Code Or Serial Number in VIT2 Else if AC1 is $99 Copy temporary buffer to Programming Date in VIT2 Else if AC1 is $CB Copy temporary buffer to End Model Number in VIT2 Else if AC1 is $CC Copy temporary buffer to System Supplier ECU Hardware Number in VIT2 EndIf Endif Goto GMLAN Response Processing Since the response is a UUDT frame, the SID position is occupied by the DPID. Hence, the fields G0, G2, etc. shall contain the DPID (see AC1) and NOT the expected response SID $EA to catch the positive case. Typical Interpreter Line: Step 06 Op-Code AA Action Fields 09 99 03 03 Goto Fields FF 22 00 00 00 00
09 07
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
173
Pseudo Code: XX AE AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Build message as indicated in the table below Request Byte 1 2 2+N Value AE AC0 Byte Description Request Device Control CPID Number Control Bytes Control Byte N (N from 0 to 5)
XX
Find the routine indicated by value AC1 Copy routine data into message (number of control bytes from 0 to 5 bytes max) Send message Goto GMLAN Response Processing
EE 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
174
Action Fields: AC0: Calibration ID 00 - Not Used 01 - FF Calibration ID Routine Number Exceptions: (Information is nibble coded) 0X Download 1X - Download and Execute 2X - Execute Only (do not include data into message) X0 - Increment address X1 - Keep address constant Exceptions: (Information is nibble coded) 0X - Use address from the routine indicated by AC1 (4 bytes) 1X - Use address from the utility file header (4 bytes) 2X - Use Global Address (see F1 Op-Code) (4 bytes) X0 - Use TypeOfAddressing bytes for address information X2 - Use 2 bytes for address information X3 - Use 3 bytes for address information X4 - Use 4 bytes for address information 4 byte naming convention = High, MidHigh, MidLow, Low
AC1: AC2:
AC3:
Pseudo Code: XX B0 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
175
(continued) For 2 bytes for address information: Request Value Byte Description Byte 1 36 Transfer Data 2 XX Level of Operation 00 Download 80 - Download and Execute 3 XX Starting Address (High byte) 4 XX Starting Address (Low byte) 5 XX Data Byte 1 Data Byte ... For 3 bytes for address information: Request Value Byte Description Byte 1 36 Transfer Data 2 XX Level of Operation 00 Download 80 - Download and Execute 3 XX Starting Address (High byte) 4 XX Starting Address (Mid byte) 5 XX Starting Address (Low byte) 6 XX Data Byte 1 Data Byte ... For 4 bytes for address information: Request Value Byte Description Byte 1 36 Transfer Data 2 XX Level of Operation 00 Download 80 - Download and Execute 3 XX Starting Address (High byte) 4 XX Starting Address (MidHigh byte) 5 XX Starting Address (MidLow byte) 6 XX Starting Address (Low byte) 7 XX Data Byte 1 Data Byte ... If AC2 & 30 is true Set Level of Operation to 80 (Level of Operation = Download and Execute) Else Set Level of Operation to 00 (Level of Operation = Download) Endif If AC3 & 30 is false Find the routine indicated by value AC1 Set StartingAddress to routine address Else If AC3 & 10 is true Set StartingAddress to address from the utility file Header Else Set StartingAddress to Global Address Endif Endif If AC3 & 0F is true Set LengthSize to AC3 & 0F Else Set LengthSize to TypeOfAddressing Endif
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
176
If AC2 & 20 is false (Not Execute Only) (continued) if AC0 (Calibration ID) is false Use data from the routine indicated by value AC1 Else Use data from the calibration file indicated by value AC0 Endif Do while more data to download if LengthSize is 2 Copy High byte of StartingAddress into message byte 3 Copy Low byte of StartingAddress into message byte 4 Elseif LengthSize is 3 Copy High byte of StartingAddress into message byte 3 Copy Middle byte of StartingAddress into message byte 4 Copy Low byte of StartingAddress into message byte 5 Elseif LengthSize is 4 Copy High byte of StartingAddress into message byte 3 Copy MidHigh byte of StartingAddress into message byte 4 Copy MidLow byte of StartingAddress into message byte 5 Copy Low byte of StartingAddress into message byte 6 Endif If this is the last packet to download or the GlobalHeaderLength is not 0 and splits the module Copy the remaining data into the message Else Copy the next block of data into the message Endif If AC2 & 0F is false Calculate next download address end if Send message If negative response received Break do while more data to download Endif End do while more data to download Else (Execute Only) if LengthSize is 2 Copy High byte of StartingAddress into message byte 3 Copy Low byte of StartingAddress into message byte 4 Elseif LengthSize is 3 Copy High byte of StartingAddress into message byte 3 Copy Middle byte of StartingAddress into message byte 4 Copy Low byte of StartingAddress into message byte 5 Elseif LengthSize is 4 Copy High byte of StartingAddress into message byte 3 Copy MidHigh byte of StartingAddress into message byte 4 Copy MidLow byte of StartingAddress into message byte 5 Copy Low byte of StartingAddress into message byte 6 Endif Send message Endif Goto GMLAN Response Processing Typical Interpreter Line: Step 10 Op-Code B0 Action Fields 10 00 01 10 Goto Fields 85 0D FD 20 FF 49
76 11
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
177
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
178
Pseudo Code: XX 50 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 If the 2 Bytes Stored in storage location ID (AC0) matches the 2 bytes in AC1 and AC2 Goto step specified in G1 Else Goto step specified in G3 Endif Typical Interpreter Line: Step 06 Op-Code 50 Action Fields 03 89 B9 00 Goto Fields 00 29 00 00 00 00
00 07
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
179
Note: This OpCode uses either the 2-byte or the 256-byte storage buffers. For buffer usage information, see the section: Programming Buffers Recommended Usage Action Fields: AC0: AC1: AC2: AC3: ID for saved bytes, only 0x00 0x13 IDs are supported. Calibration module ID of calculated checksum Checksum Type (00, 01, 02 see below) 00 - Not Used
Pseudo Code: XX 51 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 If AC2 is 0 (16-bit checksum) Sum up all data bytes of the module specified by AC1 as a 16-bit value Else Calculate the CRC-32 of the module specified by AC1 as a 32-bit value Endif If AC2 is 00 Compare calculated checksum with 2-byte storage location specified by AC0 Else If AC2 is 01 Complement checksum and compare with first 4 bytes of the 256-byte storage location specified by AC0 Else If AC2 is 02 Compare checksum with first 4 bytes of the 256-byte storage location specified by AC0 Else Set the compare to failed Endif If the compare succeeded Goto step specified in G1 Else Goto step specified in G3 Endif Typical Interpreter Line: Step 06 Op-Code 51 Action Fields 03 01 00 00 Goto Fields 00 29 00 00 00 00
00 07
00 00 Page 180
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Formats: ASCII, BCD = Binary Coded Decimal, USN = Unsigned Numeric, BIN = Binary or bit encoded.
... ...
0x13 0x14 0x81 0x82 0x83 0xE2 0xE3 Part Number Module ID 19 Part Number Module ID 20 - OR Part Number Module ID 1 Part Number Module ID 2 Part Number Module ID 3 Part Number Module ID 98 Part Number Module ID 99
... ...
VIN Manufacturer HW Number (End Model ECU Software Number) Supplier HW Number (Base Model ECU Hardware Number) Tire Type (e.g. P275/55R20) Note: This internal data is only supported in GM Vehicle Assembly Plants. Comparison of this data in a Service environment is treated as an invalid exception and results in termination of utility file execution with error.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
181
0x45
0x46
0x47
0x48
0x49
TPM tire placard data Note: This internal data is only supported in GM Vehicle Assembly Plants. Comparison of this internal data in a Service environment is treated as an invalid exception and results in termination of utility file execution with error. Diesel Injector Mass Adjustment (IMA) or Injector Quantity Adjustment (IQA) data. Note: This internal data is only supported in GM Vehicle Assembly Plants. Comparison of this internal data in a Service environment is treated as an invalid exception and results in termination of utility file execution with error. Transfer Case Control Module B-Cal (spring rate) data. Note: This internal data is only supported in GM Vehicle Assembly Plants. Comparison of this internal data in a Service environment is treated as an invalid exception and results in termination of utility file execution with error. Key Fob data. This internal data specifier is used to program key fob data into a controller on the vehicle. Note: This internal data is only supported in GM Vehicle Assembly Plants. Comparison of this internal data in a Service environment is treated as an invalid exception and results in termination of utility file execution with error. Engine Serial Number. . Note: This internal data is only supported in GM Vehicle Assembly Plants. Comparison of this internal data in a Service environment is treated as an invalid exception and results in termination of utility file execution with error.
Pseudo Code: XX 53 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Set Data2 to stored information indicated by AC0 If AC3 is 00 Set Data1 to internal data (VIT2) where AC1 identifies the information Else If AC3 is 01 Set Data1 to routine data indicated by AC1 Else If AC3 is 02 Set Data1 to stored information indicated by AC1 Endif If AC2 is not 00 Convert Data1 using the conversion format indicated by AC2 Endif If all bytes in Data1 (max. 256 bytes) matches the bytes in Data2 Goto step specified in G1 Else Goto step specified in G3 Endif Typical Interpreter Line: Step 06 Op-Code 53 Action Fields 00 02 00 00 00 07 Goto Fields 00 29 00 00 00 00 00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
182
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
183
(continued) If AC2 is $08 (Copy the data from one buffer to another) Copy the complete set of data from storage buffer ID (AC1) into storage buffer (AC0) Else If AC2 is $06 (Load routine data into Data Buffer specified by AC0) Read routine data based on Routine # (AC1) Store the routine data into storage buffer (max. 256 bytes) Else If AC2 is $07 (vehicle assembly plant programming only) (Load appropriate internal data into Data Buffer specified by AC0) Else Change storage buffer data using operation indicated by AC2 (use AC1 and AC3 information appropriately) Endif Goto step specified in G1 Typical Interpreter Line: Step 06 Op-Code 54 Action Fields 00 01 00 01 Goto Fields 00 00 00 00 00 00
00 07
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
184
Action Fields: AC0: AC1: Use RPO data from the routine indicated in this byte Format Byte: 00 = RPO strings formatted using the General Assembly Test System (GATS) option processing format (see appendix H for examples). 01-FF reserved for future use. 00 - Not Used 00 - Not Used
AC2: AC3:
Pseudo Code: XX 55 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 In Vehicle Assembly plants the following logic is executed: Obtain RPO string from routine indicated by AC0 Compare RPO string against vehicle build data If compare succeeded Goto step specified in G1 Else Goto step specified in G3 In Service the following logic is executed: Goto step specified in G5 Typical Interpreter Line: Step 06 Op-Code 55 Action Fields 01 00 00 00 Goto Fields 00 29 00 35 00 00
00 07
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
185
Pseudo Code: XX 56 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 If the Service Interpreter is being run (DPS and SPS) Goto step specified in G1 Else if the Manufacturing Interpreter is being run (Vehicle Assembly Plant Tool) Goto step specified in G3 Else if the FCP Interpreter is being run (Connected Vehicle FCP) Goto step specified in G5 Endif Typical Interpreter Line: Step 06 Op-Code 56 Action Fields 00 00 00 00 Goto Fields 00 09 00 11 00 00
00 07
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
186
Pseudo Code: End reprogramming and return to the main software for error processing. Typical Interpreter Line: Step 98 Op-Code EE Action Fields 00 00 00 00 Goto Fields 00 00 00 00 00 00
00 00
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
187
Pseudo Code: XX F1 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
MidHigh byte of global address equals AC0 MidLow byte of global address equals AC1 Low byte of global address equals AC2 High byte of global address equals AC3 Goto step specified in G1 Typical Interpreter Line: Step 08 Op-Code F1 Action Fields 2F FF F0 00 Goto Fields 00 00 00 00 00 00
00 09
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
188
Pseudo Code: XX F2 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
MidHigh byte of global length equals AC0 MidLow byte of global length equals AC1 Low byte of global length equals AC2 High byte of global length equals AC3 Goto step specified in G1 Typical Interpreter Line: Step 08 Op-Code F2 Action Fields A0 00 00 Goto Fields 00 00 00 00 00 00
01
00 09
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
189
Pseudo Code: XX F2 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
MidHigh byte of global header length equals AC0 MidLow byte of global header length equals AC1 Low byte of global header length equals AC2 High byte of global header length equals AC3 Goto step specified in G1 Typical Interpreter Line: Step 08 Op-Code F3 Action Fields 00 14 00 Goto Fields 00 00 00 00 00 00
00
00 09
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
190
Pseudo Code: XX F4 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
Calculate time frame by (AC0 * 256) + AC1 Do until time frame expired Receive response and disregard End Do processing Goto step specified in G1 Typical Interpreter Line: Step 19 Op-Code F4 Action Fields 01 2C 00 00 Goto Fields 00 00 00 00 00 00
00 20
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
191
Note: The first (G0) byte of the Goto Field is always set to 0x00 because it is not used (don't care). Action Fields: AC0: AC1: AC2: AC3: High byte of data message length Low byte of data message length 00 Not Used 00 Not Used
Pseudo Code: XX F5 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9
If the Length is Zero (AC0=00 and AC1=00) Set the Utility File Data Message Length to the original utility file value Else Set the Utility File Data Message Length to the value defined by AC0 and AC1 ((AC0 * 256) + AC1) Endif Goto step specified in G1 Typical Interpreter Lines: Switch to new Data Message Length (0x0480) Step Op-Code Action Fields 08 F5 04 80 00 00
00 09
Goto Fields 00 00 00 00 00 00
00 00
Revert back to the default Data Message Length (defined within the utility file) Step Op-Code Action Fields Goto Fields 0A F5 00 00 00 00 00 0B 00 00 00 00 00 00
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
192
Action Fields: AC0: AC1: AC2: AC3: 00 - Not Used 00 - Not Used 00 - Not Used 00 - Not Used
Pseudo Code: XX F7 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Goto next step number (Example: If the current utility file step is 09, then the next step executed will be 0A.) Typical Interpreter Line: Step 09 Op-Code F7 Action Fields 00 00 00 00 Goto Fields 00 00 00 00 00 00
00 00
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
193
Pseudo Code: XX F8 AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 If this Op-Code is used as a continuation of the goto fields the Interpreter will check to see if the F8 Op-Code is present before checking the goto fields. If the F8 is not present an Interpreter error will occur. If a previous utility file step attempts to GOTO a step with Op-Code $F8, then an Interpreter error will occur. Typical Interpreter Line: Step 08 09 Op-Code C0 F8 Action Fields 01 39 F4 02 00 00 00 00 Goto Fields 05 0D 04 0E FD 20 15 12 01 0F FF 99 00 00 00 00
06 11 AA 12
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
194
Pseudo Code: XX FB AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 If the Counter Value is $FF (counter reset) Load the counter ID and set the loop limit Endif Decrement the Counter Value If the Loop Counter Is Greater Than Zero Goto step specified in G1 Else Goto step specified in G3, counter has expired Endif Typical Interpreter Line: Step 98 Op-Code FB Action Fields 01 03 00 00 Goto Fields 00 0D 00 00 00 00
00 10
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
195
AC2: AC3:
Pseudo Code: XX FC AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 Pause for AC0 Seconds/Minutes (based on AC3) If the communication protocol is Class 2 If AC1 is 01 Send Tester Present messages during the delay time Endif Else Send Tester Present messages during the delay time Endif Goto step specified in G1 Typical Interpreter Line: Step 08 Op-Code FC Action Fields 01 00 00 00 Goto Fields 00 0A 00 00 00 00 00 00 00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
196
Pseudo Code: XX FD AC0 AC1 AC2 AC3 G0-G1 G2-G3 G4-G5 G6-G7 G8-G9 If AC0 is $FF Reset all loop counters (set the value of each loop counter to 0xFF) Else Reset loop counter with ID of AC0 (set the value to 0xFF) Endif Goto step specified in G1 Typical Interpreter Line: Step 08 Op-Code FD Action Fields 06 00 00 00 Goto Fields 00 00 00 00 00 00
00 0B
00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
197
Pseudo Code: End reprogramming and return success Typical Interpreter Line: Step 98 Op-Code FF Action Fields 00 00 00 00 Goto Fields 00 00 00 00 00 00 00 00 00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
198
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
199
Prior to release of any interpreter/documentation updates any affected groups that use an interpreter-based software must be notified. The key to the process is the detail of the request from the engineering group. If the request is lacking in any way, GM Customer Care & Aftersales personnel will not be able to accurately include the OpCode in the Interpreter.
Note: Once an Interpreter is released, GM Customer Care & Aftersales cannot modify an existing OpCode/exception combination unless the original functionality is unaffected. It is GM Customer Care & Aftersales responsibility to verify that the existing support provided by the Op-Code still works properly. If this is not possible, for any reason, then the Op-Code/exception combination cannot be changed. GM Customer Care & Aftersales should always plan to create a new Op-Code or a new exception to an existing Op-Code when new Interpreter functions are needed. This rule can only be violated when the change has NO impact on existing Interpreter Op-Code function.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
200
Appendixes
A - UART Interpreter Examples B - Class 2 Interpreter Examples C - Keyword Protocol 2000 Interpreter Examples D - Abbreviations and Acronyms E - Revision Log F - Related Documents
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
201
The first step is a 05 Op-Code (Ram Download Request). The tool will send an ALDL mode 5 message. The 01 exception tells the interpreter to wait for an F0 poll before sending the mode 5 message. For this example assume an AA response was received from the device, after the mode 5 message was sent, the interpreter would jump to the step specified after the AA in the goto fields (step 02). If a 05 response were received, the interpreter would jump to step 04. A 09 response would jump to step 05 and any other responses would jump to step 06. Step 02 Op-Code C0 Action Fields 02 03 F4 00 AA 03 Goto Fields 05 04 FF 06 00 00 00 00
This step is a C0 Op-Code that is used to Download Routines to RAM and then execute the routines. The line instructs the interpreter to send routine 02 to device ID F4 using routine 03 as the prolog. Prologs are only used when a routine is larger then the maximum routine packet size. Prologs generate responses for the device as the pieces of a routine are being downloaded to RAM. All of the routines are contained in the routine section of the Utility Files. After all of the routine is downloaded the device will execute the routine and a response will be returned. Assume that an AA is returned from the device, so step 03 (Goto field 1) will be the next step interpreted. Step 03 Op-Code D0 Action Fields 01 39 F4 01 06 07 Goto Fields 15 04 FF 05 00 00 00 00
The next Op-Code to execute is D0 (Download Calibration / Software file). The tool will send to device F4 the file with ID 01 and since the exception 01 is specified, 39 will be the prolog. After the file is downloaded to the device a response will be returned to the tool. Assume a 15 is returned, the Goto field 2 will be the next step executed (04). This return is an error and will cause the process to loop. See the next Op-Code. If a 06 was returned then the programming event would be a success and the process would end (see step 07). If any other return value were returned then Goto step 3 (05) would be executed. This will signal that the programming event has failed and the module should to be replaced (see step 05). Step 04 Op-Code FB Action Fields 01 03 00 00 00 02 Goto Fields 00 05 00 00 00 00 00 00
If this step is executed the counter 01 is set to 03 and the interpreter will jump to the step specified in Goto step 1 (02). Each subsequent time this step is executed, counter 01 will be decremented by one. If the counter is above zero the first Goto step (02) is executed again. If the counter is zero, meaning that the counter has expired, the step specified in Goto step 2 (05) is executed. Step 05 Op-Code EE Action Fields 00 00 00 00 00 00 Goto Fields 00 00 00 00 00 00 00 00
This step is executed if an error has occurred during the programming process and the replace module message should be displayed. Step 06 Op-Code EE Action Fields 01 00 00 00 00 00 Goto Fields 00 00 00 00 00 00 00 00
This step is executed if an error has occurred during the programming process. The 01 in AC0 indicates that a message instructing the user to replace the control module should be displayed on the error screen. Step 07 Op-Code FF Action Fields 00 00 00 00 00 00 Goto Fields 00 00 00 00 00 00 00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
202
The first step is a 01 Op-Code (Setup Global Variables). The tool sets the global tester ID to the value in AC0 ('F1'). The zero in AC1 instructs the tool to turn the periodic transmission of 3F messages off. The step then goes to the step indicated by the value in G1 ('02'). Step 03 Op-Code 28 Action Fields 10 00 03 00 68 04 Goto Fields FD 14 FF 16 00 00 00 00
Step 3 is an example of an Op-Code 28, which is used to disable normal communications. The 10 in AC0 is used by the tool as the target address of the mode 28 message. The 00 in AC1 instructs the tool to disable normal class 2 communications. The 03 in AC2 is used as a time-out (3 * 50ms) value used while waiting for multiple devices to respond to the mode 28 message. The variable time-out should be used whenever a message is sent to all devices ("FE") and the default time-out of 250ms is not acceptable. The tool will keep looping while it receives successful mode 28 responses or until the time-out value is exceeded without another response being returned. Step 09 Op-Code A0 Action Fields 10 FE 05 00 AA 0A Goto Fields BB 12 FF 0D 00 00 00 00
Step 9 is an Op-Code A0 that is used to request high-speed communications. The 10 is used by the tool as the target address of the mode A0 message. The 05 in AC2 is used by the tool to determine the number of 50ms increments to wait (5 * 50ms) for all devices to respond to the mode A0 message. In this case, the tool will process all responses until an error is received or 250ms have elapsed without another response. The 00 in AC3 instructs the tool to look at response byte 5 for the next goto step to execute. Step 1A Op-Code B0 Action Fields 10 02 00 83 73 26 Goto Fields 74 28 FF 29 00 00 00 00
Step 1A is an example of an Op-Code B0 which is used to download routines to RAM using mode 36 messages. The value in AC0 is used as the target address in the mode 36 message. The value in AC1 indicates the routine number, from the routine section of the Utility File, to download to the control module. The tool parses through the Utility File to find the routine corresponding to the value in AC1. The value in AC3 is used to determine the maximum packet length and transmit type to use in the message. Since the value is 83, which is greater than 80, the tool uses 4000 bytes as the maximum packet length. The 83 also indicates to the tool to send the mode 36 messages with a transmit type of download and execute. Step 06 Op-Code B4 Action Fields 10 01 03 01 73 07 Goto Fields FF 09 00 00 00 00 00 00
Step 06 is an example of an Op-Code B4 that is used to download calibrations to the control module using mode 36 messages. The value in AC0 is used as the target address in the mode 36 message. The value in AC1 corresponds to the calibration ID for the calibration to be downloaded. The value in AC2 identifies the routine number to use as a data prolog while downloading the calibration to the control module. The value in AC3 is used to determine the type of download strategy to use during programming. In this example, 01 indicates the tool should use car platform strategies with two byte addressing. Step 07 Op-Code EE Action Fields 01 00 00 00 00 00 Goto Fields 00 00 00 00 00 00 00 00
This step is executed if an error has occurred during the programming process. The 01 in AC0 indicates that a message instructing the user to replace the control module should be displayed on the error screen. Step 08 Op-Code FF Action Fields 00 00 00 00 00 00 Goto Fields 00 00 00 00 00 00 00 00
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
203
Appendix C - KWP2000 Interpreter Example Example Utility File (with Control Routines) 0 0 0 0 0 7 F 0 0 7 0 A 0 0 0 5 4 F 1 0 5 0 9 8 0 0 3 0 0 0 0 3 0 4 0 0 0 1 7 9 0 0 4 5 0 0 C 0 0 F 0 0 0 5 9 0 1 1 0 3 F 0 0 0 E 0 0 0 0 0 0 0 0 0 0 8 8 0 1 3 0 0 9 0 0 0 6 A 0 1 F 0 0 0 0 0 0 E B 0 0 F 0 0 0 8 0 0 5 3 F F 0 0 0 0 F 0 0 C 5 7 1 9 0 0 0 B 0 0 B 6 3 0 0 0 7 0 0 0 0 7 3 4 0 0 4 1 0 1 0 0 2 4 9 0 0 2 0 0 0 0 0 3 9 0 0 7 6 0 3 0 0 6 0 0 0 0 F 0 0 0 0 3 0 0 0 2 D 0 0 0 0 5 0 0 0 0 0 0 0 0 0 3 0 2 0 0 8 0 0 0 0 6 0 0 0 0 F 0 0 0 4 D 0 0 0 0 F 7 0 0 0 E 0 0 0 0 0 9 0 0 0 A 0 0 0 0 9 3 4 0 0 4 0 0 0 6 0 0 0 0 0 3 0 0 3 7 0 1 0 0 0 2 0 0 8 0 0 0 0 0 1 4 2 0 3 5 0 0 9 0 A E 0 0 1 3 0 0 0 0 8 D 0 0 0 7 0 0 0 A 9 A B 0 0 0 0 0 0 F 3 C 8 0 0 8 0 0 0 F 2 4 0 0 0 3 0 7 0 0 A 3 0 0 0 3 6 3 0 0 5 6 0 0 0 0 3 0 0 0 B 4 2 0 0 8 4 A 0 0 3 5 0 0 C F 0 F 0 0 9 0 0 2 3 F 0 D 0 0 9 0 0 8 0 0 0 0 0 0 C 0 0 1 4 9 0 8 0 0 D 0 2 1 F 0 0 3 0 0 D 2 0 0 F 0 0 6 9 0 4 0 0 0 0 0 0 0 E 0 4 0 0 0 9 0 0 8 E 0 E 0
Following are the explanations of how a reprogramming tool would flow through the lines of the Interpreter Instructions from the example Utility File above. The first highlighted section above represents the Header Information. The middle section (not highlighted) contains the Interpreter Instructions. The second highlighted section is the Control Routine section. In this example the Control Routine section contains two routines. The example data is not for a particular ECU it is strictly for explanatory purposes. The data in the Interpreter Instructions is hexadecimal values.
Step XX 01
Op-Code OP 01
Step $01 is a 01 Op-Code (Setup Global Variables). The tester sets the global target byte to the value in AC0, or $10, and the global source byte to the value in AC1, or $F1.
Step XX 02
Op-Code OP 81
Step $02 is an example of a Start Communications Op-Code (81). If the positive response service ID of $C1 is returned this step goes to step $03. For any other response values the tester uses the $FF goto value and jumps to step $09.
Step XX 03
Op-Code OP 83
Step $03 is an example of an Access Communication Parameter Op-Code (83) which is used to setup the optimum reprogramming times. If the positive response service ID of $C3 is returned this step goes to step $04. For any other response values the tester uses the $FF goto value and jumps to step $09.
Step XX 04
Op-Code OP 27
Step $04 is an example of a Security Access Request Op-Code (27) which is used to unlock an ECU for reprogramming. The value in AC0 represents the algorithm that is used on the seed to determine the key. The tester uses the response bytes to determine the next step to execute. If the positive response byte service ID of $67 is returned this step goes to step $05. If the security request fails for either a "required time
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
204
(continued) delay not expired" or "security access denied" error this step jumps to step $08. For any other response values the tester uses the $FF goto value and jumps to step $09.
Step XX 05
Op-Code OP 31
Step $05 is an example of a Start Routine by Local Identifier Op-Code (31). This step is used to start executing a routine that is embedded in the ECU's memory. The local Identifier of the routine to execute is contained in AC0; this example starts routine $03. If the positive response service ID of $71 is returned this step goes to step $06. If a "No Communications" error occurred then this step goes to $08. For any other response values the tester uses the $FF goto value and jumps to step $09.
Step XX 06
Op-Code OP 34
Step $06 is an example of a Download Request Op-Code (34). If a positive response service ID of $74 is returned this step goes to step $07. For any other response values the tester uses the $FF goto value and jumps to step $09.
Step XX 07
Op-Code OP 93
Step $07 is an example of a Transfer Calibration Op-Code (93) which is used to transfer calibration files to an ECU. This step will transfer the calibration with a calibration ID equal to the value in AC0 ($01). If the positive response byte $73 is returned indicating the ECU is ready for the next block this Op-Code continues with the transfer until the entire calibration is transferred to the ECU. When the calibration is completely transferred if a positive response code $73 is returned this step goes to step $0A. If either a "No Communications" or a "Block Transfer Data Checksum" error occurs then this step goes to $08. For any other response values the tester uses the $FF goto value and jumps to step $09.
Step XX 08
Op-Code OP FB
Step $08 is an example of a Set and Decrement Counter Op-Code (FB) which is used to perform loop processing in a Utility File. This Op-Code sets or decrements (if counter was previously set) counter $01 (AC0). This step will goto step $04 (G1) if counter $01 is greater than zero otherwise this step will goto step $09 (G3) if counter $01 is zero. To reset a counter, so it can be reused for another loop, a $FD Op-Code should be issued for the counter number to reset.
Step XX 09
Op-Code OP EE
Step 09 is an End with Error Op-Code (EE) that is used to indicate a reprogramming event ended with an error. The $01 in AC0 is used to toggle the display of a message instructing the user to replace the ECU on the error screen ($01 - display message, $00 - do not display message).
Step XX 0A
Op-Code OP FF
This step is an example of a Programming Successful Op-Code (FF) that is used to indicate a successful completion of a reprogramming event.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
205
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
206
Version
1.0 1.1 1.2 1.3 1.4
Author Rick Kacel Andrea Merrick John Cline Erwin Frank Setterlun Initial Release Added assumption
Comments
Fixed Flowcharts and miscellaneous changes Several Modifications 256 Byte internal data buffers update.
Related Documents GMW3110 GMLAN Enhanced Diagnostic Test Mode Specification Version 1.4, 1.5Service Programming System (SPS) Interpreter Programmers Reference Manual Version Date: November 13, 2003
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
207
Assumptions
This file represents the programming of a module with one Operating Software module and 2 Calibration Software modules. Please use this as an example for setting up a utility program.
The ECUs security algorithm number ($00 - $FF) has already been assigned by GM SPO CCA for levels 1&2. The example ECU is a simple, straightforward implementation. The ECU has only one type of Flash memory. A Flash routine, included in the Utility file, is downloaded to the ECU and handles the programming of the Operating software and Calibration modules. The Utility file is being executed to program the ECU either for the first time, or as an update to the Operating software or Calibration modules. If the Operating software for the ECU is downloaded, all Calibration modules for the ECU will be downloaded. This ensures consistency. If one Calibration module needs to be updated, all Calibration modules for the ECU will be downloaded. The VIN number, the Tester Serial number, and the Programming date need to be programmed into ECU memory after a successful programming event. The ECU supports the GMLAN CAN protocol. The ECU sends a $7F $31 response if the software part number is requested and the software has not been programmed in the box. The Module IDs of the calibration files should be assigned to align with the order the files will be downloaded. Module ID $01 is reserved for the primary Operational Software as stated in GMW311
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
208
Programming Flow
Utility File Start
OpCode - $34
Step $08
Retry3
PreSteps
The programming application tool executes several GMLAN service messages before the first Interpreter instruction is executed. See the GMLAN message flow diagrams in this document or GMW 3110 for more information.
Step $09
Retry3
Start
OpCode - $27
SecurityAccess $27 Service SPSRequestSeed SecurityAccess $27 Service SPSSendKey
Step $02
Perform Seed & Key
Retry1 Error
Step $0B
Retry3
SetUp
OpCode - $34 RequestDownload $34 Service
Step $03
Retry3
Retry3 Error
Step $04
Retry3
Step $0D
Retry3
Step $05
Request the Operating Software Part Number
Step $0E
Download the 2nd Calibration
Retry3 Error
ProgState
ProgCal Values Equal
Step $06
Evaluate the Part Number
OpCode - $A2
ReportProgrammedState $A2 Srvc
Step $0F
Retry2
ProgOp
Step $07
Set Global Header Length
Step $10
Evaluate Programmed State
Error
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
209
Executed by the programming application prior to Part 2 of the Utility file Success
ReturnToNormalMode$20 Service
Pre-Step
Reset
Step $1C
Exit Interpreter with Success
Pre-Step
Bus Wakeup (Occurs Automatically by the Programming Tool)
Exit
Pre-Step
Get CAN IDs
Error Part 2
OpCode - $3B
WriteDataByidentifier$3B Service
Step $11
Write the VIN
Retry4 Error
Step $1D
Exit Interpreter with Error
OpCode - $3B
Step $12
Retry4
Exit
OpCode - $3B
WriteDataByidentifier$3B Service
Step $13
Retry4
Success
Step $15
Retry Delay for 1 Second
Step $17
Retry Delay for 1 Second
Step $19
Retry Delay for 1 Second
Step $1B
Retry Delay for 1 Second
Jump toStart
Jump toProgState
Jump toSetUp
Jump toPart2
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
210
Step $01
OpCode $01
AC3
Set to $00. Goto Fields
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
211
Step $02
OpCode $27
AC1
Set to $00.
AC3
A $00 tells the Interpreter to disable sending the key if the seed returned by the ECU is 0, indicating that the ECU is not currently protected.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
212
Step $03 SetUp Prepare to Download Flash Routine #1 from Utility File
The Flash routine resides within the Utility file archive, and is given a numeric value (1, 2, etc). The routine is downloaded from the Utility file to the ECU, and erases and writes data to the Flash memory device. It is downloaded and placed into RAM by the bootloader software. The flash routine usually has two components: one that erases memory and one that writes memory. The Utility file has information about the length of the routine. The Bootloader has information about each of the components. In some cases the Flash routine is embedded into the Bootloader software and permanently resides in the ECU.
OpCode $34 Action Fields AC0 $00 AC1 $01 AC2 $00 AC3 $00 $74 G1 $04 G2-G3 $FD Retry3 Goto Fields G4-G5 $FF Error G6-G7 00 00 G8-G9 00 00
Step $03
AC1
AC1 is the Routine number identifier so that the Interpreter retrieves the correct Flash routine from the Utility file. In this example the routine number is 1.
AC2
Set to $00
AC3
The upper nibble of AC3 tells the Interpreter where to get the length. In this case it is retrieved from the Routine number specified in AC1 ($0X). The lower nibble of AC3 determines how many bytes represent the address. In this example, the address length is specified by the Utility file header in the Type of Addressing field ($X0).
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
213
Step $04
OpCode $B0
AC1
Specifies the Flash routine number to be downloaded. In this example, the Flash routine is embedded in Routine #1.
AC2
The upper nibble specifies the subfunction value for the TransferData $36 service. It determines what action to take after the download is complete. In this example the Flash routine is being downloaded, not executed, so it is set to download only ($0X). The lower nibble determines if the address is incremented or held constant. Since the Flash routines are being downloaded to RAM, the value ($X0) is set to increment the address for storage after every $36 message. The address is incremented by the number of bytes in each download.
AC3
The upper nibble of AC3 tells the Interpreter where to get the start address. In this case it is retrieved from the Routine number specified in AC1 ($0X). The lower nibble of AC3 determines how many bytes represent the address. In this example, the address length is specified by the Utility file header in the Type of Addressing field ($X0).
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
214
Step $05
OpCode $1A
AC1
Specifies the buffer in the Interpreter program to store the software part number information. In this example, it is Data Buffer #1.
AC3
AC3 determines if a 256-byte or a 2-byte data buffer is to be used. In this example, a 256-byte buffer is being used since the part number is more than two bytes.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
215
Step $06
AC1
Specifies the Module ID to use for the comparison. In this example, the Operating software part number is being compared, so the module ID is always 1.
AC2
Set AC2 to $01 if the part number is reported by the ECU as a 4 byte hex value. Set to $00 if the part number is reported out in ASCII format. In this example, it is reported by the ECU in hexadecimal and must be converted for comparison.
AC3
The value in AC3 tells the Interpreter where to get the part number for comparison. Set to $00 for this example to tell the interpreter to get it from the VIT2 table.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
216
Step $07
OpCode $F3
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
217
Step $08
OpCode $34
AC1
AC1 is set to $00 in this example based on the value in AC3.
AC2
Set to $00.
AC3
The upper nibble of AC3 tells the Interpreter where to get the length. In this case its from the header of the Utility file ($1X). The lower nibble of AC3 determines how many bytes represent the length. In this example, the address length is specified by the Utility file header in the Type of Addressing field ($X0).
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
218
Step $09
AC1
Set to $00. This is not a Routine being downloaded.
AC2
The upper nibble specifies the subfunction value for the TransferData $36 service. It determines what action to take after the download of data is complete. In this example the Operating software is being downloaded, so it is set to download only ($0X). The lower nibble determines if the address is incremented or held constant. In this example, it is held constant ($X1). The ECU is placing the data where it belongs and wants the $36 message to put each block of data into the same location in RAM for processing.
AC3
The upper nibble of AC3 tells the Interpreter where to get the start address. In this case its from the header of the Utility File ($1X). The lower nibble of AC3 determines how many bytes represent the address. In this example, the address length is specified by the Utility file header in the Type of Addressing field ($X0).
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
219
Step $0A
OpCode $F3
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
220
Step $0B
OpCode $34
AC1
AC1 is set to $00 in this example based on the value in AC3.
AC2
Set to $00.
AC3
The upper nibble of AC3 tells the Interpreter where to get the length. In this case its from the header of the Utility file ($1X). The lower nibble of AC3 determines how many bytes represent the length. In this example, the address length is specified by the Utility file header in the Type of Addressing field ($X0).
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
221
Step $0C
OpCode $B0
AC1
AC0 set to $00. This is not a Routine being downloaded.
AC2
The upper nibble specifies the subfunction value for the service TransferData $36. It determines what action to take after the download of data is complete. In this example the first Calibration module is being downloaded, so it is set to download only ($0X).
The lower nibble determines if the address is incremented or held constant. In this example, it is held constant ($1). The ECU is placing the data where it belongs and wants the $36 message to put each block of data into the same location in RAM for processing.
AC3
The upper nibble of AC3 tells the Interpreter where to get the start address. In this case its from the header of the Utility file ($1X). The lower nibble of AC3 determines how many bytes represent the address. In this example, the address length is specified by the Utility file header in the Type of Addressing field ($X0).
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
222
Step $0D
OpCode $34
AC1
AC1 is set to $00 in this example based on the value in AC3.
AC2
Set to $00.
AC3
The upper nibble of AC3 tells the Interpreter where to get the length. In this case its from the header of the Utility file ($1X). The lower nibble of AC3 determines how many bytes represent the length. In this example, the address length is specified by the Utility file header in the Type of Addressing field ($X0).
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
223
Step $0E
OpCode $B0
AC1
AC0 set to $00. This is not a Routine being downloaded.
AC2
The upper nibble specifies the subfunction value for the service TransferData $36. It determines what action to take after the download of data is complete. In this example the second Calibration module is being downloaded, so it is set to download only ($0X).
The lower nibble determines if the address is incremented or held constant. In this example, it is held constant ($1). The ECU is placing the data where it belongs and wants the $36 message to put each block of data into the same location in RAM for processing.
AC3
The upper nibble of AC3 tells the Interpreter where to get the start address. In this case its from the header of the Utility file ($1X). The lower nibble of AC3 determines how many bytes represent the address. In this example, the address length is specified by the Utility file header in the Type of Addressing field ($X0).
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
224
Step $0F
OpCode $A2
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
225
Step $10
OpCode $50
AC1, AC2
AC1 is the most significant byte (MSB), and AC2 is the least significant byte (LSB) of the vale used for comparison. In this example, the Fully Programmed value of $0000 is used.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
226
Please Note: The programming application will automatically send service messages ReturnToNormalMode $20, and ReadDataByIdentifier $1A, DID $B0 (ECUDiagnosticAddress) before Part 2 of the utility file is processed. If an ECU needs additional time after a reset and prior to the VIN write, a delay should be includes in the Utility file as the first step of Part 2.
OpCode $3B Action Fields AC0 $90 AC1 $00 AC2 $00 AC3 $00 G0-G1 $7B $12 G2-G3 $FD Retry4 Goto Fields G4-G5 $FF Error G6-G7 00 00 G8-G9 00 00
Step $11
AC1
AC1 specifies where to get the VIN data. When set to $00, the Interpreter uses internal data that is stored by the test tool or the manufacturing device. The VIN number was previously retrieved from the system (see assumptions).
AC2
Set to $00.
AC3
Set to $00, which tells the Interpreter to use internal data.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
227
Step $12
OpCode $3B
AC1
AC1 specifies where to get the data. When set to $00, the Interpreter uses internal data that is stored by the test tool or the manufacturing device. The data was previously retrieved from the system (see assumptions).
AC2
Set to $00.
AC3
Set to $00 that tells the Interpreter to use internal data.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
228
Step $13
OpCode $3B
AC1
AC1 specifies where to get the data. When set to $00, the Interpreter uses internal data that is stored by the test tool or the manufacturing device. The data was previously retrieved from the system (see assumptions).
AC2
Set to $00.
AC3
Set to $00 that tells the Interpreter to use internal data.
G2-G3
If response $FD is returned, then a timeout has occurred. Go to step Retry4.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
229
Step $14
OpCode $FB
AC1
This is the initial value of the counter.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
230
Step $15
OpCode $FC
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
231
Step $16
OpCode $FB
AC1
This is the initial value of the counter.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
232
Step $17
OpCode $FC
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
233
Step $18
OpCode $FB
AC1
This is the initial value of the counter.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
234
Step $19
OpCode $FC
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
235
Step $1A
OpCode $FB
AC1
This is the initial value of the counter.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
236
Step $1B
OpCode $FC
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
237
Step $1C
OpCode $FF
Goto Fields
G0-G1, G2-G3, G4-G5, G6-G7, G8-G9 Not used
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
238
Step $1D
OpCode $EE
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
239
Label
Start SetUp
Step#
01 02 03 04 05 06
Action Fields
01_SetupGlobalVariables (11; F1) 27_SecurityAccess (68) 34_RequestDownload (00; 01; 00) B0_BlockTransferToRam (00; 01; 00; 00) 1A_ReadDataByIdentifier (C1; 01; 00) 53_CompareData (01; 01; 01; 00) F3_SetGlobalHeaderLength (00; 00; 32; 00) 34_RequestDownload (00; 00; 10) B0_BlockTransferToRam (01; 00; 01; 10) F3_SetGlobalHeaderLength (00; 00; 00; 00) 34_RequestDownload (00; 00; 10) B0_BlockTransferToRam (02; 00; 01; 10) 34_RequestDownload (00; 00; 10) B0_BlockTransferToRam (03; 00; 01; 10) A2_ReportProgrammedStateSave2 (02) 50_CompareBytes (02; 00; 00) 3B_WriteDataByIdentifier (90; 00; 00; 00) 3B_WriteDataByIdentifier (98; 00; 01; 00) 3B_WriteDataByIdentifier (99; 00; 00; 00) FB_SetAndDecCounter (01; 03) FC_DelayForSeconds (01; 00; 00) FB_SetAndDecCounter (02; 03) FC_DelayForSeconds (01; 00; 00) FB_SetAndDecCounter (03; 03) FC_DelayForSeconds (01; 00; 00) FB_SetAndDecCounter (04; 03) FC_DelayForSeconds (01; 00; 00) FF_EndWithSuccess () EE_EndWithError (00)
Goto Fields
(00:Next) (67:Next; FD:Retry1; FF:Error) (74:Next; FD:Retry3; FF:Error) (76:Next; FD:Retry3; FF:Error) (5A:Next; 31:ProgOp; FD:Retry3; FF:Error) (00:ProgCal; 00:Next) (00:Next) (74:Next; FD:Retry3; FF:Error) (76:Next; FD:Retry3; FF:Error) (00:Next) (74:Next; FD:Retry3; FF:Error) (76:Next; FD:Retry3; FF:Error) (74:Next; FD:Retry3; FF:Error) (76:Next; FD:Retry3; FF:Error) (E2:Next; FD:Retry2; FF:Error) (00:Success; 00:Error) (7B:Next; FD:Retry4; FF:Error) (7B:Next; FD:Retry4; FF:Error) (7B:Success; FD:Retry4; FF:Error) (00:Next; 00:Error) (00:Start) (00:Next; 00:Error) (00:ProgState) (00:Next; 00:Error) (00:SetUp) (00:Next; 00:Error) (00:Part2) () ()
ProgOp
07 08 09
ProgCal
0A 0B 0C 0D 0E
ProgState Part2
0F 10 11 12 13
14 15 16 17 18 19 1A 1B 1C 1D
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
240
$100
Responses only from Type A&B ECUs with Permanent CAN ID and Device ID
All nodes Read Databyte Identifier $B0 Return ECU Diagnostic Address
Responses only from Type A&B ECUs Type A&B ECUs Respond with Permanent CAN ID Type C ECUs Respond with Device ID + $300
$101$FE
$A2
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
241
These messages are sent and received by the programming application based on the Interpreter instructions in the Utility file
Specific ECU is targeted for flash programming. Note that not all Interpreter step output messages on the GMLAN bus External Programmer ECU Module
Request Download
ECU CANID $XXX .. .. $36 $00 .. ..
Transfer Data
Request Download
ECU CANID $XXX .. .. $36 $00 .. ..
Transfer Data
Continued
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
242
External Programmer
ECU Module
Request Download
ECU CANID $XXX .. .. $36 $00 .. ..
Transfer Data
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
243
Jay Wells Jay Wells Jerry Anderson Jerry Anderson Jerry Anderson Jay Wells
Jay Wells Dennis Pesonen Dennis Pesonen Dennis Pesonen Philip Barone Philip Barone Philip Barone
01/27/98 09/21/98
Greg Powell
10/6/98
Greg Powell Greg Powell Greg Powell Greg Powell Greg Powell
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Added AC3 option in Op-Code 27 for security level 2. Added AC3 option x03 to OpCode 93. These changes were for SAAB.
GMLAN B0 Op-Code Mode 36 Block Transfer to RAM changed. Exceptions have changed from the beta version of the document. Accepted changes from 3/23/00. Added 04 Byte address to utility file header. Removed Class 2 indication from Op-Code F1. Updated footer for 1993-2000. Revised Table of Contents to show Interpreter 2 Add Op-Code 3E and 40 to Class 2 interpreter 1 Move UART Op-Code A3 to proper location Remove initials DH from GMLAN Op-Code 34 Correct description for GMLAN Op-Code F2 Add KWP2000 Op-Code 02 Add Op-Code F3 to Communications Independent Op-Codes Update GMLAN Op-Code B0 description Update KWP2000 Op-Code 27 for valid security algorithm range Update UART Op-Code 0C description Added GMLAN Interpreter to Op-Codes 50, 51, EE, F7, F8, FB, FC, FD and FF Added Blocks 22, 23 and 24 to Class 2 Op-Code 3B Removed Target ID from GMLAN Op-Codes Added Target ID to GMLAN Setup Global Variables Changed GMLAN Op-Codes 34, B0 exception handling from bit to nibble coded Added GMLAN example Removed GMLAN Op-Code 27 5 tries 2 second wait logic Added note for FC Op-Code AC1 and AC3 Updated Class 2 Op-Code 27 (Perform Security) pseudo-code Added Exception to Mode 1A Read Data by Identifier to identify storage location 2 bytes byte buffer or 10 bytes data buffer. Changed Compare Data Op-Code 52 to 53 (had same value as Class2 Write Checksum to Block 82) Added more detailed description for Op-Code 90 Transfer a Routine to ECU (2 3 byte address information) Added more detailed description for Op-Code 93 Transfer a Calibration File to ECU (2 3 byte address information) Modified GMLAN Op-Code AE Request Device Control to allow 0 to 5 control bytes Documented the block descriptions (AC1) for the Class2 3B Op-Code. Updated KWP2000 3B Op-Code description Fixed GMLAN example step 4 G1 jump to 05 Updated Format of Header definition (Utility File module ID = 0x0000) Added GMLAN Op-Code 3B write multiple DIDs via calibration file support Added more detailed description to Common Op-Code 51 Compare Checksum Updated Op-Code 3C logic to reflect what is actually being done. Added Class 2 support for the F3 Op-Code Set Global Header Length. Added Global Header Length descriptions & logic to the Class 2 B4 Op-Code. Updated Op-Code $53 to change VIT2 compare reference values used within the AC1 field to reference the Part #, VIN, information. Previous documentation was incorrect and also updated to allow for future P/N expandability. Added KWP2000 Op-Code $84 to Set Communications Parameters. Updated KWP2000 Op-Code $3B Write Data by Local ID added conversion of programming date into a 6 character ASCII string formatted as YYMMDD if AC0 is $00, AC1 is $99, AC2 is $06 and AC3 is $00. Changed GMLAN 3B Op-Code Mode 3B Write Data by Identifier to support access to 20 bytes buffers Added Common 54 Op-Code Change Data Changed F7 Op-Code description to match existing code behaviour (from should never the destination to goto step G1) Modified FC Op-Code to indicate support for Delay For Minutes for KWP2000 protocol. Modified Class 2 Op-Code $27 to document retry logic for a TIME DELAY NOT EXPIRED response condition. Added KWP2000, new 23 Op-Code SR 23 to Read Memory by Address and Save Bytes Added KWP2000, 3B Op-Code, new AC2 $02 Use module for record values Added KWP2000, 10 Op-Code, new AC1 Baud rate Identifier Added KWP2000, 27 Op-Code, new AC2 Security IDs Changed FB Op-Code Set and Decrement Counter description to match existing code behaviour
04/29/02 04/29/02
Dirk Heinemann Dirk Heinemann Dirk Heinemann Jun Bradburn David Setterlun Dirk Heinemann Dirk Heinemann Dirk Heinemann Dirk Heinemann Dirk Heinemann
07/08/02 07/08/02 09/20/02 09/20/02 10/30/02 11/21/02 11/21/02 11/21/02 11/21/02 12/04/02
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
245
Dirk Heinemann Dirk Heinemann Dieter Rapp Dieter Rapp Dieter Rapp Dieter Rapp Dieter Rapp Dieter Rapp David Setterlun
12/04/02 12/04/02 05/19/03 05/19/03 05/19/03 05/19/03 05/19/03 05/20/03 22 May 2003
Dieter Rapp Dieter Rapp Dieter Rapp Dieter Rapp Dieter Rapp Dieter Rapp Dieter Rapp Dieter Rapp Dieter Rapp Setterlun
06/30/03 06/30/03 06/30/03 06/30/03 06/30/03 07/01/03 07/01/03 07/01/03 09/18/03 10/08/03
John Cline/ Lisa Cleaveland John Cline Dieter Rapp Dieter Rapp Dieter Rapp Dieter Rapp David Setterlun
David Setterlun
08/19/04
Updated KWP2000 90 Op-Code: SR 36 to Transfer a Routine to ECU added AC3 $40, $41 Updated KWP2000 93 Op-Code: SR 36 to Transfer a Calibration File to ECU added AC3 $40, $41, $42, $43, $C0, $C1 Updated KWP2000 10 Op-Code: Added baud rate switch Updated KWP2000 20 Op-Code: Added baud rate switch to 10400 Bd Updated KWP2000 3D Op-Code: new AC3 Multiple services to download Added KWP2000, new F4 Op-Code to Ignore Responses for a Specified Number of Milliseconds Updated Common 51 Op-Code: new AC2 Checksum Type Updated Common F7 Op-Code: Changed description to match existing code behaviour (always go to next step) - Updated common Op-Code $53 (Compare Data) to support 20 (decimal) Part Numbers (from 16). - Updated GMLAN Op-Code $3B (Write Data by Identifier) to support the data identifier 0xCB (End-Model Part Number). - Resolved a few minor spelling/grammar errors Seemed to have lost some of these fixes from Cline (13 Dec. 2002). Added UART $C4 Op-Code for Holden Telematics (Download Routine to RAM using Mode 20) Added UART $C5 Op-Code for Holden Telematics (Execute Routine using Mode 21) Added UART $D6 Op-Code for Holden Telematics (Erase Flash Block using Mode 22) Added UART $D7 Op-Code for Holden Telematics (Download Software Module using Mode 23) Added UART $D8 Op-Code for Holden Telematics (Execute Software Module using Mode 24) Added GMLAN $02 Op-Code for development use only (Send Single Frame) Added GMLAN $03 Op-Code for development use only (Re-Initialize Network for Programming) Updated GMLAN Op-Code $27 (Security Access): Added exception $01 send key even if seed is 0. Moved Op-Code $F4 from the KWP2000 section to the communication independent section. Added Op-Code $F5 (Common Op-Code) Override Utility File Message Length Field (Changes made based on Dieters 18-Sept-2003 interpreters document. Also, updated the copyright date within the footer. Reformat document - Remove 30 pages without losing content. Remove development only information from document. Update Copyright Information per GM management direction Added GMLAN Op-Code $84 (SetCommunicationParameters) to override STmin Updated KWP2000 Op-Code $27 (Security Access): Added special handling if AC1 is $01 send key even if seed is 0. Updated GMLAN Op-Code $27 (Security Access): Added handling of AC1 (security level) and AC2 (algorithm type - GM vs. non-GM). Added GMLAN Op-Code $AA Read Data By Packet Identifier. Update Op-Code $53 to support part number module IDs 1 through 99 by adding more VIT2 reference numbers 0x81-0xE3 (Mod IDs 01-99)). Update the copyright date. Update Op-Code $54 to not list $53 as the Op-Code (oops bug fix). Put in disclaimers stating that the following is not supported for SAE J2534 GMLAN interface types (code is not in VCS 4.0 yet): GMLAN Op-Code $84 GMLAN Op-Code $AA GMLAN Op-Code $27 (Security Level and Security Access support AC1/AC2) Common Op-Code $F5 (not supported for GMLAN J2534) Add documentation to Class 2 Op-Code $27 to state that a mode $28 will be sent out to all devices prior to the $27 $01 (update the interpreter documentation to be the same as the code). And also add support for AC3, so that if AC3 is set to 0x01, then the mode $28 will not be sent out.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
246
12/01/04
Dirk Heinemann
David Setterlun
03/08/05
04/21/05
Correct UART Op Code D7 AC1: description to reflect calibration number Corrected FC Op-Code description for Tester Present and Delay For Minutes.
- Update the copyright date (2005). - Update the complete Interpreter 1 Class 2 section to be more consistent with the newer interpreter documentation and to better document the logic within the VCS code. - Update the complete Independent opcode (common) section to be more consistent with the newer interpreter documentation and to ensure that it matches the VCS code. - Removed the disclaimers stating that certain functionality is not supported for SAE J2534. It is now supported with VCS 4.1: GMLAN Op-Code $84, GMLAN Op-Code $AA, GMLAN Op-Code $27 (Security Level and Security Access support AC1/AC2), Common Op-Code $F5 - Repage the TOC.
Setterlun
04/28/05
10/19/05 10/19/05
Setterlun
10/20/05
Cline
1/13/2006
Setterlun/Cline
5/09/2006
- Reformat the TOC (issues with Appendix D). *** Be carfull when updating Appendix D (GMLAN Utility File Guidelines) because of a FORMATTING conflict (Header 1, Header 2, usage) - - - DONT DO IT ! Added GMLAN Op-Code $20 Return to Mormal Mode. Fixed typo in GMLAN Op-Code $34 Request Download, changed AC3 description: Replaced 0X - Use length from the routine indicated by AC2 (2 bytes) by 0X - Use length from the routine indicated by AC1 (2 bytes). The routine is indicated by AC1, not by AC2. Four items (all very minor): 1) Misc. formatting pagebreak items, (continued) belongs on top of the next page. 2) Add the bubble comments by Dirk and Dieter into document text. 3) Put a disclaimer in the System Errors and Op-Code Failures section. 4) Updated comments for OpCodes that reference an index to state if that index is zero based or not (list acceptable values). OpCodes: UART OpCode $C2; Class 2 OpCode $B2; KWP2000 OpCodes $23, $71, $78; GMLAN OpCodes $3B; Common OpCode $54. 1. Update Copyright for 2006 2. Add 52 Op-Code 3. Add Appendix G 54 Op-Code Additional Information 4. Modify Caution message in 20 Op-Code 5. GMLAN 3B Op-Code Use VIN digits 10-17 (exception 4X) Add appendix H GATS Option string processing New RPO Op Code changed from 52 to 55 due to conflict with Class 2 Op Code 52 Modified document to expand 20 byte internal buffers to 256 byte buffers. Affected op-codes include KWP2000 op-code $23, GMLAN op-codes $1A, $3B, and $AA. Communications independent op-codes affected include $51, $53, and $54. Also made changes to Appendix G and Appendix H where the 20 byte buffers were referenced. Modified GMLAN op-code $34 pseudo code to correct refererence to AC1 (was AC2) when obtaining routine data. Modified op-code $54 to add new exception that allows data to be read in from a routine and stored into one of the 256 byte buffers. 1) GMLAN Mode 20 Update (ONLY allowed in Part 2 of a utility file). CR1627 2) Minor cosmetic updates to the 256 byte buffer changes (from Al). CR1635 3) Date/CoverPage/Revision Log/TOC update. 4) Pseudo code Update OpCode $54 loading buffer data via a routine. 5) Other very minor updates (cosmetic only) throughout the document. 6) Appendix G updates (Op-Code $54 changes) simplify. 1) Op Code $FF bar graph increments to 100% 2) Op Code $34 GMLAN length based on calibration option 3) Op Code $3B Class 2 add AC3 exception 6 and 7 4) Op Code $72 Class 2 Update for SAE J2534-1
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
247
Setterlun/Cline
6/20/2006
Setterlun/Cline Kacel/Cline Cline/Setterlun Cline/Setterlun Cline/Setterlun Cline Cline Cline/Koski Cline Cline/Setterlun
8/16/2006 9/20/2006 9/20/2006 9/20/2006 10/04/2006 4/01/2007 4/01/2007 4/01/2007 4/01/2007 4/01/2007
Setterlun
8/15/2007
Cline/Koski Cline/Wist Koski/Wist Cline/Setterlun A. Wist Setterlun/Wist Cline/Setterlun Cline Cline Setterlun
- Page 235 correct offset to routine in utility example - Page 235 correct TypeOfHeaderUtility value to 11 - Added GMLAN op-code $01 fatal error on Target Address FE and TIMEOUT description. - Changed GMLAN op-code $14 description to indicate physical addressed usage. - Changed GMLAN op-code $20 description to indicate development only usage. - Class 2 OpCode $3C and OpCode $3B Use of internal storage buffers to read/write data from these buffers. Appendix D GMLAN message flow steps $12 and $13 correct messages from $34 to $3B Add GMLAN Op Code $25 for Global A Security Code Modify all storage buffer values from 00-09 to 0x00 - 0x13 Add comments to GMLAN mode $27 for Timer Not Expired 37 functionality Remove GMLAN Development Op Codes $02 and $03 Add GMLAN Op Code $22 Read data by PID Per Devin Koski modify Op Code $25 action fields AC1, AC2 and AC3 Add Op Code $84 for Class 2 Set Communications Parameters Add delay - Update KWP2000 and GMLAN Op Code $27 security access information - Add clarification to the statement from the header which becomes from the utility file header where appropriate Update Op Code $51 text for 20 buffers. Add Class 2 to Op Codes $53 and $54 Spelling and grammar check. GMLAN Op Code $AA add note concerning optional interface support GMLAN Op Code $84 add note concerning assembly plant support GMLAN Op Code $3B Correct AC1 ID for saved bytes (0x00 0x13) Page 243 correct spelling of Cleaveland Class 2 Op Code $3B Correct AC3 and Example 6 storage buffer is AC2 Class 2 OpCodes 3B & 3C: Updated these OpCodes to better explain how data is read from and stored to one of the internal storage locations - - - specifically regarding the amount of data. GMLAN Op Code $25 Update Security Code Text description for AC2 to Security Code 1 or Security Code 2 Add Internal Data Specificers $44 (Tire Type) and $45 (TPIM placard data) to Op Code $53 and Op Code $54 Op Code $25 Update text for improved security code description GMLAN Op Code $27 Add Security Table GMLAN-1 information to AC2 and description Op Code $53/$54 Add Internal Data Specificer $46 (Diesel Injector Mass Adjustment) Op Code $54 Add AC2 exception $08 Copy the data from one storage buffer to another Op Codes $FB/$FD Increase loop counters from 10 to 20 ( 0x00 0x13) Update copyright for 2008 Add Op Code $56 Plant/Service/FCP Add note to Op Code $53 numeric part number names in DPS GMLAN Op Code $84 Add ESCAN link info. Minor Cosmetic Updates based on comments from Dirk (Setterlun) -- OpCode FF, GMLAN OpCode 20, Class 2 OpCode A8 My Update OpCode $53 comment (DPS). Add Internal Data Specifier support for GMLAN mode $3B per GM AVG request. Add documentation to clarify $3B usage and Data integration into $3B message. Replace all reference to GM Service Operations with GM Service and Parts Operations Add option to FD Op-Code to clear all counters per GM AVG. Update documentation to include default operation of counters.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
248
Cline/Setterlun
12/15/2008
Setterlun
04/01/2011
Add Programming Storage Buffers Recommended Usage section (beginning of this document) and appropriate Note updates to several OpCodes that use storage buffers: Class2: $B2 - Kwp2000: $23, $71, $78 GMLAN: $1A, $22, $A2, $AA Common: $50, $51, $53, $54. Add Note concerning Type C ECUs and OpCode $AA usage in part one of utility file Add Comments to Op Code $54 and GMLAN Op Code $3B for assembly plant data ID $46. Update GM Corporation to GM Company. Plant Manufacturing Specific Updates to: - GMLAN OpCode $3B (AC2, AC3==03 Update) Special Plant Data IDs. - OpCode $53 Added Internal Data Identifiers $47-$49 (plant only). - OpCode $54 AC1, AC2, AC3: Plant data IDs $47-$49 update. Minor Updates: (for April 1, 2011 document) - Copyright update, SPO changed to CCA, version/date updates, - KWP OpCode 84 P2Max resolution is 25ms not 250ms. - OpCode $54 shift actions are exceptions 04 or 05 (not 03 or 04).
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
249
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
250
GMLAN Example: Step 02 03 04 05 06 Op AC Goto 1A 03 09 00 00 5A 03 FD 12 FF 12 00 00 00 00 - Read DID $03 and place in storage buffer #09 upon a positive response, goto step 03 54 09 01 00 AA 00 04 00 00 00 00 00 00 00 00 - Set the second byte (01) of buffer #9 EQUAL (00) to a value of AA go to step #4 54 09 00 01 F0 00 05 00 00 00 00 00 00 00 00 - Set bits 0-3 of the first byte (00) of buffer #9 equal to zero (AND (01) with 0xF0) go to step #5 54 09 03 02 E0 00 06 00 00 00 00 00 00 00 00 - Set bits 5-7 of the fourth byte (03) of buffer #9 equal to one (OR (02) with 0xE0) go to step #6 3B 03 09 05 30 7B 07 FD 12 FF 12 00 00 00 00 - Write the first 05 bytes of data from storage location 09 to DID #03 upon a positive response, goto step 07
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
251
0x85
OR (02)
0xF0
0xF5
0xD3
0xFF
0x2C
See Comments
SHL (04) (shift left fill w/ 0x00) SHR (05) (shift right fill w/ 0x00)
N/A
See Comments
See Comments
N/A
See Comments
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
252
V:
The option string can contain several special characters to interpret portions of the build string. These characters allow greater flexibility when setting up the masks. Following is a description of how these wild card characters work. ? A question mark is used to indicate that any one character can occupy that position in the string. Matches occur for any single character in the same location of the string. An asterisk is used to indicate that any character can occupy that position and all the trailing positions in the string. Any number of characters are valid. All characters that follow an asterisk are ignored. These characters (where N represents any character) are used to indicate any single character in that position in the string that is not N. Matches occur for any single character in the same location of the string that is NOT that value.
^N
[M-N] These characters (where M and N represent any characters) are used to indicate a range of M to N inclusive. Matches occur for any character in the same location of the string that is in the range of M to N. ^[M-N] These characters (where N and M represent any characters) are used to indicate a "NOT" range of M to N inclusive. Matches occur for any character in the same location of the string that is NOT in the range of M to N. [M,N,O,...] These characters (where N, M and O represent any characters) are used to indicate a list of valid characters. Matches occur for any character in the same location of the string that matches M, N, O. More than three characters may be specified. ^[M,N,O,...] These characters (where N, M and O represent any characters) are used to indicate a list of invalid characters. Matches occur for any character in the same location of the string that is NOT M, N, O. More than 3 numbers may be specified. The option configuration string uses wild card and Boolean characters to interpret each part of the build data. These characters allow greater flexibility when setting up the masks. The following is a description of how these Boolean characters work. The previous section describes the wild card characters. This section describes the Boolean characters. & This character represents the Boolean "AND" operation. When used, if both operands are true, then the entire statement is true. This character represents the Boolean "OR" operation. When used, if either operand is true, then the entire statement is true.
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
253
This character represents the Boolean "NOT" operation. When used, if the operand is true, then the entire statement is false. If the operand is false, the entire statement is true. These characters represent that Boolean association rules apply. They are used to specify a grouping of conditions. Option String Examples Comments True if the RPOs L26 and OP1 exist in the build data. True if the RPOs L35 or OP4 exist in the build data. True if the RPO LY7 does not exist in the build data. True if RPOs JM4 and either OP4 or OP5 exist in the build data. Notice the parentheses change the logic of this statement. If OP4 and OP5 RPOs exist in the build data and JM4 does not, then this statement evaluates to false. True if RPOs JM4 and OP4 are part of the build data or if OP5 is part of the build data. True if the vehicle VIN exactly matches the first 10 characters. Characters 11 through 17 dont matter. True if the first 4 character of the vehicle VIN th are 1G2W and the 5 character is not 5, and digits 6 through 10 are 1567N. Digits 11 through 17 dont matter. True if the first 4 character of the vehicle VIN th are 1G2W and the 5 character is either a 4, 5, th or a 6. The value of the characters after the 5 are ignored. True if the first 4 character of the vehicle VIN th are 1G2W and the 5 character is not 4, 5, or th 6. The value of the characters after the 5 are ignored. True if the first 4 3 characters of the vehicle VIN th are 1G2, the 4 character is either A, C, or W, th and the 5 character is 5. Characters 6 through 17 are ignored. Not a valid string. The number of characters inside the brackets must be the same for all possible values within the range. A valid string would be V:1G2W[01-12]567N* True if the first character of the vehicle VIN is a 1 or a 3, characters two through four are G2W, characters five and six are not 23 through 44 and also not 55, character 7 can be anything, character eight is a 6, and the rest of the characters are ignored. True if the vehicle model designator is 1WB19, 1WC19, or 1WD19 True if the vehicle model designator is 1WB19 or if the RPO AU0 is part of the build data, or if the RPO AP3 is part of the build data. th True if the 10 digit of the VIN is a 6. The leading ? are single character wildcards and the * indicates that all characters after the 6 in the 10 digit are dont cares.
( )
Option String L26 & OP1 L35 | OP4 !LY7 JM4 & (OP4 | OP5)
V:1G2W^51567N*
V:1G2W[4-6]*
V:1G2W^[4-6]*
V:1G2[A,C,W]5*
V:1G2W[1-12]567N*
V:[1,3]G2W^[23-44,55]?6*
V:?????????6*
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
254