1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
42
C4 Op-Code: Download Routine to RAM using Mode 20 (Holden Telematics)
Supported By:
UART Interpreter 0
Description:
The C4 Op-Code builds and sends ALDL mode 20 messages with three address bytes.
It is used to send
routines to the RAM of the device being reprogrammed. This Op-Code was developed specifically for the
Holden Telematics controller but can be used for any controllers using mode 20 in the same manner.
Note: See Pseudo code for more information on maximum packet sizes.
Action Fields:
AC0:
Device ID
AC1:
Routine Number
AC2:
Not Used
AC3:
Not Used
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
Value
Byte Description
1
AC0
Device ID
2
4 + N
Message length
3
14
Message mode
4
XX
High byte of download
address
5
XX
Middle byte of download address
6
XX
Low byte of download address
7
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 <= maximum as defined in pseudo code)
8 + N
CS
1
byte request checksum
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
CameraLoops.com
1993-2011 General Motors Company, GM Customer Care & Aftersales. All Rights Reserved.
Page
43
(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
Do'stlaringiz bilan baham: