AN2662 USART bootloader
Doc ID 14156 Rev 1 21/83
2.9 Read Memory command
The Read Memory command is used to read data from any memory address in RAM
(starting from address 0x20001000), Flash memory and information block (System memory
or option byte areas).
When the bootloader receives the Read Memory command, it transmits the ACK byte to the
user. After the transmission of the ACK byte, the bootloader waits for an address (4 bytes,
byte 1 is the address MSB and byte 4 is the LSB) and a checksum byte, then it checks the
received address. If the 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 waits for the number
of bytes to be transmitted (N bytes) and for its complemented byte (checksum). If the
checksum is correct it then transmits the needed data ((N + 1) bytes) to the user, starting
from the received address. If the checksum is not correct, it sends a NACK before aborting
the command.
The host sends the bytes to the STM32F105xx and STM32F107xx as follows:
Bytes 1-2: 0x11+0xEE
Wait for ACK
Bytes 3 to 6: start address
● byte 3: MSB
● byte 6: LSB
Byte 7: Checksum: XOR (byte 3, byte 4, byte 5, byte 6)
Wait for ACK
Byte 8: The number of bytes to be read – 1 (0 < N ≤ 255);
Byte 9: Checksum: XOR byte 8 (complement of byte 8)