STM32 Built-in Bootloader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-01 9:50 AM
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.
- Labels:
-
Bootloader
-
STM32F1 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-01 9:57 AM
>>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.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-01 10:06 AM
thanks for your answer.
I will measure the power supply but i dont think that i have some issue in there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-01 10:25 AM
Tomorrow i am going to use crc-16 to be sure that the file is not corrupted
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-01 11:21 AM
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?
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-01 12:33 PM
Aaa yeah, i am using one flash memory page in linker in order to save some configuration values. Maybe this can cause an issue?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-01 12:59 PM
Yes, quite easily.
As the F1 has uniform size sectors, shrink the size visible to the linker, and place this data at the way far end of the memory arena.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-01 1:14 PM
I am using the last page of the flash memory to store data, but i have the option to use an external memory instead of the internal's mcu. What is your suggestion about? Do you believe that if i restore the flash memory into intial state (just only for application code) then the bootloader will work properly?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-02 1:26 AM
you make my day! The file has been downloaded correctly after restoring the linker script into the initial value.
But i observe that the program stop executing properly after go command, i have to reset it from the power supply not only the reset button. Could you please give me some help on this?
