Skip to main content
Associate III
January 16, 2025
Question

Program STM32 via serial

Is it possible to program the MCU via Serial using the USART pins (PB6,PB7)????

 

This topic has been closed for replies.

4 replies

Tesla DeLorean
Guru
January 16, 2025

You can implement any update method you chose.

For the System Loader see application note AN2606 for pin options.

https://www.st.com/resource/en/application_note/an2606-stm32-microcontroller-system-memory-boot-mode-stmicroelectronics.pdf

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Uwe Bonnes
Chief
January 16, 2025

https://git.code.sf.net/p/stm32flash/code is a nice program to talk to AN2606 compatible bootloaders

Andrew Neil
Super User
January 16, 2025

In addition to the built-in System Loader mentioned by @Tesla DeLorean  - which has certain restrictions - you can write your own loader to use any interface you like on any pins you like

For example, see Application note AN4657, STM32 in-application programming (IAP) using the USART:

https://www.st.com/resource/en/application_note/an4657-stm32-inapplication-programming-iap-using-the-usart-stmicroelectronics.pdf

https://www.st.com/en/embedded-software/x-cube-iap-usart.html

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
DrWidget
Associate II
January 16, 2025

This guy has a very detailed video series on implementing a custom bootloader: https://www.youtube.com/watch?v=jzo7z2gNBgg&list=PLArwqFvBIlwHRgPtsQAhgZavlp42qpkiG&index=1

He covers most of the code in the video, but he also has git repo if you are short on details: https://github.com/Embetronicx/STM32-Bootloader/tree/main