7.2 Checksum
7.3 Example Sequence
Data Frame
Abbreviations:
HDR Header: Any value between 80h and 8Fh (normally 80h).
CMD Command identification
L1, L2 Number of bytes consisting of AL through Dn
Restrictions: L1 = L2, L1 < 255, L1 even
AL, AH Block start address or erase (check) address or jump address LO/HI byte
LL, LH Number of pure data bytes (250 max) or erase information LO/HI byte or block length of
erase check (FFFFh max)
D1 … Dn Data bytes
CKL, CKH 16-bit checksum LO/HI byte
xx Can be any data
-- No character (data byte) received/transmitted
ACK The acknowledge character returned by the BSL. Can be either DATA_ACK = 90h: Frame
was received correctly, command was executed successfully, or DATA_NAK = A0h: Frame
not valid (e.g., wrong checksum, L1 ≠ L2), command is not defined, is not allowed, or was
executed unsuccessfully.
n Number of bytes consisting of AL through Dn
The 16-bit (2 bytes) checksum is calculated over all received/transmitted bytes B1 ... Bn in the data frame,
except the checksum bytes themselves, by XORing words (2 successive bytes) and inverting the result.
This means that B1 is always the HDR byte and Bn is the last data byte just before the CKL byte.
Formula –
CHECKSUM = INV [ (B1 + 256 × B2) XOR (B3 + 256 × B4) XOR … XOR (Bn – 1 + 256 × Bn) ]
or
CKL = INV [ B1 XOR B3 XOR … XOR Bn–1 ]
CKH = INV [ B2 XOR B4 XOR … XOR Bn ]
The following example shows a request to read the memory of the MSP430 from location 0x0F00. All
values shown below are represented in hexadecimal format.
TO BSL: 80
(Sych character sent to the BSL)
FROM BSL: 90
(Acknowledge from BSL)
TO BSL: 80 14 04 04 F0 0F 0E 00 85 E0
(Send Command to read memory from 0x0F00, length 0x000E)
FROM BSL: 80 00 0E 0E F2 13 40 40 00 00 00 00 00 00 02 01 01 01 C0 A2
(Returned values from BSL)
Features of the MSP430 Bootstrap Loader6 SLAA089D – December 1999 – Revised August 2006
Submit Documentation Feedback