USART bootloader AN2662
26/83 Doc ID 14156 Rev 1
start address must be 0x1FFFF800 to avoid writing inopportunely in this area.
If the received address is valid and the checksum is correct, the bootloader transmits an
ACK byte, otherwise it transmits a NACK byte and aborts the command. When the address
is valid and the checksum is correct, the bootloader:
● gets a byte, N, which contains the number of data bytes to be received
● receives the user data ((N + 1) bytes) and the checksum (XOR of N and of all data
bytes)
● programs the user data to memory starting from the received address
● at the end of the command, if the write operation was successful, the bootloader
transmits the ACK byte; otherwise it transmits a NACK byte to the user and aborts the
command
The maximum length of the block to be written for the STM32F105xx and STM32F107xx is
256 bytes.
If the Write Memory command is issued to the Option byte area, all options are erased
before writing the new values, and at the end of the command the bootloader generates a
system Reset to take into account the new configuration of the option byte.
Note: When writing to the RAM, care must be taken to avoid overlapping the first 4 Kbytes
(0x1000) in RAM because they are used by the bootloader firmware.
Note: No error is returned when performing write operations on write protected sectors.
Write operations to FLASH/SRAM must be word aligned, if less data are written the
remaining bytes should be filled by 0xFF.