Skip to main content
Visitor II
February 6, 2025
Question

mcu boot on stm32L4

  • February 6, 2025
  • 4 replies
  • 1887 views

hey,

I am trying to figure out how to implement mcu-boot on an stm32l4

I wanna have mcu-boot to be able to flash it over uart, but I cant find any documentation on how to implement mcu-boot on an stm32L4

Are there any existing documentation or examples on this?

    This topic has been closed for replies.

    4 replies

    Graduate II
    February 6, 2025

    You talking about systembootloader? https://www.st.com/resource/en/application_note/an3155-usart-protocol-used-in-the-stm32-bootloader-stmicroelectronics.pdf

     

    >>how to implement mcu-boot on an stm32L4
    any reason you dont want to use the one already implemented in every stm32 mcu?

    >>Are there any existing documentation or examples on this?

    you have plenty of documentation if you google systembootloader stm32

    Or if you want to build your own bootloader check OpenBL

    lucasrjAuthor
    Visitor II
    February 6, 2025

    I want to specify which UART is used for flashing, the default one is listing to everything, if something is trying to flash it or can look like it, and where is GPS that always sends data and some other devices.

    I have not checked openBL, I was suggested mcu-boot originally I can try looking into openBL, but I would still like to use mcu-boot if possible 

    ST Employee
    February 6, 2025

    Hello @lucasrj ,

    Here's a helpful entry point to get you started:

    Please refer to the application note AN2606. This document describes the supported peripherals and hardware requirements to consider when using the bootloader. Specifically, you should look into the sections related to STM32Lxx devices (sections 66 to 72), which will assist you in configuring your setup.

    For more detailed information and related documents about the bootloader, please check the following application notes:

    • AN3154: CAN protocol used in the STM32 bootloader
    • AN3155: USART protocol used in the STM32 bootloader
    • AN3156: USB DFU protocol used in the STM32 bootloader
    • AN4221: I2C protocol used in the STM32 bootloader
    • AN4286: SPI protocol used in the STM32 bootloader
    • AN5405: FDCAN protocol used in the STM32 bootloader
    • AN5927: I3C protocol used in the STM32 bootloader



    Regards ,
    MBej

    Super User
    February 6, 2025

    So you want to make a custom bootloader - rather than use the System bootloader built into the chips?

    In that case, take a look at 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

    and X-CUBE-IAP-USARTSTM32Cube in-application programming using the USART embedded software:

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

     

    Your key search term here is "In-Application Programming" aka "IAP"

    Try also, eg, https://www.google.com/search?q=mcuboot+stm32L4 

    Did you see Custom bootloader on the STM32L4 ?

     

    Also: https://github.com/STMicroelectronics/stm32-mw-mcuboot