
AN3155 Bootloader command set
Doc ID 17066 Rev 2 7/37
3 Bootloader command set
The supported commands are listed in Ta bl e 1 below. Each command is further described in
this section.
Communication safety
All communications from the programming tool (PC) to the device are verified by:
1. checksum: received blocks of data bytes are XORed. A byte containing the computed
XOR of all previous bytes is added to the end of each communication (checksum byte).
By XORing all received bytes, data + checksum, the result at the end of the packet
must be 0x00
2. for each command the host sends a byte and its complement (XOR = 0x00)
3. UART: parity check active (even parity)
Table 1. USART bootloader commands
Command(1)
1. If a denied command is received or an error occurs during the command execution, the bootloader sends
NACK byte and goes back to command checking.
Command code Command description
Get(2)
2. Read protection – When the RDP (read protection) option is active, only this limited subset of commands is
available. All other commands are NACKed and have no effect on the device. Once the RDP has been
removed, the other commands become active.
0x00 Gets the version and the allowed commands supported
by the current version of the bootloader
Get Version & Read
Protection Status(2) 0x01 Gets the bootloader version and the Read Protection
status of the Flash memory
Get ID(2) 0x02 Gets the chip ID
Read Memory 0x11 Reads up to 256 bytes of memory starting from an
address specified by the application
Go 0x21 Jumps to user application code located in the internal
Flash memory or in SRAM
Write Memory 0x31 Writes up to 256 bytes to the RAM or Flash memory
starting from an address specified by the application
Erase(3)
3. Erase (x043) and Extended Erase (0x44) are exclusive. A device may support either the Erase command
or the Extended Erase command but not both.
0x43 Erases from one to all the Flash memory pages
Extended Erase(3) 0x44
Erases from one to all the Flash memory pages using
two byte addressing mode (available only for v3.0 usart
bootloader versions and above).
Write Protect(4)
4. See Section 3.1: Device-dependent bootloader parameters.
0x63 Enables the write protection for some sectors
Write Unprotect(4) 0x73 Disables the write protection for all Flash memory sectors
Readout Protect 0x82 Enables the read protection
Readout Unprotect(2) 0x92 Disables the read protection