Skip to main content
Visitor II
March 25, 2025
Solved

Copy firmware from one STM32 MCU to another using STM32_Programmer_CLI.exe

  • March 25, 2025
  • 2 replies
  • 839 views

Hello Everyone,

We have a requirement to flash firmware from One STM32G0B1 MCU1 to Second STM32G0B1 MCU2 via UART.

The STM32_Programmer_CLI will be connected to MCU1 via UART. The MCU1 and MCU2 will be connected together via a different UART for flashing. 
The MCU1 should act as a mediator between STM32 Programmer and MCU2 for flashing.

Is it possible to achieve the above requirement? 
If It is possible, could anyone share the reference documents or reference software for the same.

We really appreciate your support. 

Thanks in Advance,

Best Regards,
Naveen

    This topic has been closed for replies.
    Best answer by mƎALLEm

    @kumar_b wrote:

    Hello @mƎALLEm ,
    To achieve this, should we develop a custom bootloader for first MCU1 and configure the UART interrupts?


    It's only a bridge. The data sent from CubeProgrammer will be mirrored by the MCU1 and re-sent to the MCU2.

    Same thing, the acknowledge byte and the reading from MCU2 will be mirrored with MCU1 that will be re-sent to the CubeProgrammer.

    So you don't need to develop any custom bootlader as the bootlaoder is available on the MCU2.

    You need just to add a GPIO on MCU1 that will control Boot pin on MCU2 and may be a second GPIO to drive the reset pin.

    Hope it's clear now.

    2 replies

    ST Employee
    March 25, 2025

    Hello @kumar_b 

    You can refer to STM32CubeProgrammer software description document specifically section 3_ STM32CubeProgrammer command line interface (CLI) for MCUs. it details the available commands through various protocols ( I2C, UART, USB, ...) .

    With regards

    Technical Moderator
    March 25, 2025

    Hello,

    As I understood you need to make an UART to UART bridge to update a second MCU.

    Yes it's possible and I did it years ago but unfortunately I don't have the code to share.

    You need to enable the UART Rx interrupts, the data received from CubeProgrammer will be retransmitted over the second UART and vice versa.

     

    kumar_bAuthor
    Visitor II
    March 26, 2025

    Hello @mƎALLEm ,

    Thanks for the response.

    Yes, you are understanding is correct. we are trying to make first MCU as UART to UART bridge while updating firmware in Second MCU.

    Normally the First MCU has its own application which will be running, only while flashing the second MCU it has to act as UART to UART bridge between Cube programmer and Second MCU.

    To achieve this, should we develop a custom bootloader for first MCU1 and configure the UART interrupts?

    As per our understanding the for the CubeProgrammer to connect to first MCU1, it should be in boot mode.

    Best Regards,
    Naveen

    mƎALLEmAnswer
    Technical Moderator
    March 26, 2025

    @kumar_b wrote:

    Hello @mƎALLEm ,
    To achieve this, should we develop a custom bootloader for first MCU1 and configure the UART interrupts?


    It's only a bridge. The data sent from CubeProgrammer will be mirrored by the MCU1 and re-sent to the MCU2.

    Same thing, the acknowledge byte and the reading from MCU2 will be mirrored with MCU1 that will be re-sent to the CubeProgrammer.

    So you don't need to develop any custom bootlader as the bootlaoder is available on the MCU2.

    You need just to add a GPIO on MCU1 that will control Boot pin on MCU2 and may be a second GPIO to drive the reset pin.

    Hope it's clear now.