Skip to main content
TPrio.1
Associate II
March 1, 2021
Question

STM32 Built-in Bootloader

  • March 1, 2021
  • 3 replies
  • 1942 views

Hello everyone,

I am working on an application about updating stm32f103 via built-in bootloader - uart.

I have a bin file that is validated with cheksum equal to st-link utility tool. (sum all the bytes).

My issue is that sometimes with the same bin file the mcu doesnt work properly. I have read flash memory (via st-link utility tool) and i observed that some addresses are corrupted compared to original bin file.

Why happen this? I try to change baud rates but this issue appear again.

My bootloader version is 2.2

I appreciate if someone could help me on that.

This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
March 1, 2021

>>Why happen this? I try to change baud rates but this issue appear again.

Well the flash integrity/performance is dependent on the power supply. Could be an issue there if the erase/write currents exceed expectations.

Use checksum methods with better integrity, something like a CRC or hashing function (MD5, SHA, ..), sign the binary out of the linker, have the firmware confirm or output an error messages, or flag failure in some way.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
TPrio.1
TPrio.1Author
Associate II
March 1, 2021

thanks for your answer.

I will measure the power supply but i dont think that i have some issue in there.

Tesla DeLorean
Guru
March 1, 2021

The thing shouldn't spontaneously corrupt, do you see this only in your board, or more generally available ones?

Any flash writing code within your application? EEPROM Emulation?

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
TPrio.1
TPrio.1Author
Associate II
March 1, 2021

Aaa yeah, i am using one flash memory page in linker in order to save some configuration values. Maybe this can cause an issue?

TPrio.1
TPrio.1Author
Associate II
March 1, 2021

Tomorrow i am going to use crc-16 to be sure that the file is not corrupted