cancel
Showing results for 
Search instead for 
Did you mean: 

How to update the FW by CubeProgrammer via USART?

JZou.2
Associate II

I want to update the FW to H7 MCU via its USART by embedded bootloader. It seems need to control the BOOT0 pin and nRST pin when the MCU is in normal running. By CubeProg tool, how to control above 2 pins by PC? Usually, I will build a USB to UART bridge chip for this purpose.

One thing that I can not understand well at the monment: is such a bridge chip specified by CubeProg tool or free chosen by user? I think this also related by GPIO(flow control pin) control of bridge chip.

8 REPLIES 8
prain
Senior III
  • Usually flow control take place in your hardware driver. ​for example in Windows os, CTS, RTS can be controlled automatically by os. An example circuit that may help you, would be ESP8266 module. two transistors are used to put the chip in programming mode

Is CubeProg tool able to directly control such a circuit? I mean that for embedded bootloader in H7, the tool should be able to send and respond with specified words.

Feel free to try.

If applicable, let us know

ST has proposed ways to connect the serial port, with pins for NRST and BOOT0 to facilitate a more automated approach.

Honestly couldn't tell you if STM32 Cube Programmer (GUI / CLI) has that built in or not, I'm sure it would be in the documentation or readme files, or on the help output of the CLI tool. Not my use case, you''ll need to review docs and check yourself.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Also most people playing at this level could likely automate their own connection with a serial adapter, and write the UART loader protocol implementation on their target programming system of choice.

https://www.st.com/resource/en/application_note/cd00264342-usart-protocol-used-in-the-stm32-bootloader-stmicroelectronics.pdf

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
TDK
Guru

STM32CubeProgrammer can use a serial port (UART port) to communicate with the bootloader but you need to get the chip into the bootloader state first. A USB to UART bridge can't toggle BOOT0/NRST.

You can implement logic in your program to read data from the UART and jump to the bootloader when necessary, then use that same port to communicate with the bootloader. I do this, it works well.

If you feel a post has answered your question, please click "Accept as Solution".
JZou.2
Associate II

Hi, USB to UART beidge chip usually have assocaited GPIOs(dedicated GPIO or flow control pins) that can be controlled by PC tools. Then you connect 2 pins of them to nRST and BOOT0 to force H7 go to reset ---> boot from bootloader(system memory).

You solution seems a new to me. Do you mean that user can force the MCU jump to bootloader when H7 is normal running?

> Do you mean that user can force the MCU jump to bootloader when H7 is normal running?

Sure, if you implement it in your code.

https://community.st.com/s/article/STM32H7-bootloader-jump-from-application

Toggling pins is also a fine solution.

If you feel a post has answered your question, please click "Accept as Solution".