Skip to main content
Explorer
January 16, 2025
Question

Program STM32 via serial

  • January 16, 2025
  • 3 replies
  • 623 views

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

 

    This topic has been closed for replies.

    3 replies

    Graduate II
    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

    Graduate II
    January 16, 2025

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

    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 AN4657STM32 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

     

    Explorer
    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