cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 system bootloader UART protocol

SidPrice
Associate III

I am developing a custom bootloader for a client on an STM32 system. I am using STM32CubeProgrammer to exercise the new bootloader and the built-in system bootloader to investigate the protocol being used over UART. In addition, I am referring to AN 3155, which describes the protocol.

The issue/confusion I am facing is that when using the system bootloader and STM32CubeProgrammer and capturing the UART traffic for erasure of a single page, I see a different message sent from the programmer than that described in AN 3155, unless I am missing some important detail in the app note.

For example, erasing the first page of an STM32F103 I capture the following output from STM32CubeProgrammer.:

[43h] [BCh] [01h] [00h] [2Bh] [2Ah]

 

The first difference to the app note is in byte #3, the number of pages to erase. According to AN 3155 this should be N-1, so I would expect this to be "00h."

Secondly, byte #5 appears to be undocumented, the list of pages, in this case just page zero, should be followed by the checksum.

I have revision 16 of AN 3155, if there is a later version, or if some can spot my error, I would much appreciate this.

Sid

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

Looks like it's erasing 2 pages, not 1. Page 0 and page 0x2B. That matches up with the protocol.

More likely to be a bug in STM32CubeProgrammer than in the bootloader.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Guru

Looks like it's erasing 2 pages, not 1. Page 0 and page 0x2B. That matches up with the protocol.

More likely to be a bug in STM32CubeProgrammer than in the bootloader.

If you feel a post has answered your question, please click "Accept as Solution".

That would make sense and I assume the unknown byte #5 is the page number of that second page ... I will proceed based upon that assumption. Maybe ST can comment on this to confirm.