
AN2662
USART bootloader
Doc ID 14156 Rev 1
Communication safety
All communications from the programming tool (PC) to the device are verified by:
1.
checksum: all received 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)
Each packet is either accepted (ACK answer) or discarded (NACK answer):
●
ACK = 0x79
●
NACK = 0x1F
2.6 Get
command
The Get command allows the user to get the version of the bootloader and the supported
commands. When the bootloader receives the Get command, it transmits the bootloader
version and the supported command codes to the host, as described in
.
Readout Protect
0x82
Enables the read protection
Readout Unprotect
0x92
Disables the read protection
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.
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.
3.
On the STM32F105xx and STM32F107xx , the sector size is 4 KBytes (2 pages) for the Write Protect and
Write Unprotect commands.
Table 3.
Bootloader commands (continued)
Command
(1)
Command
code
Command description