Skip to main content
km naxin
Associate
November 26, 2019
Question

How to choose stm32G431 BOOT mode

  • November 26, 2019
  • 3 replies
  • 2358 views

How to choose stm32G431 BOOT mode

Can you use stm32cubemx to configure BOOT mode? If you cannot use stm32cubemx how to configure.

May I ask if it is configured to boot from user flash memory.

This topic has been closed for replies.

3 replies

DMeie.2
Associate III
May 2, 2024

@Tilen MAJERLEUnfortunately this document doesn't explain how to configure the bootloader in CubeMX.
How would I change the registers related to that in CubeMX? For example the boot entry setting regsiter bits, "BOOT_LOCK", "nBoot0", "nBoot1", "nBoot0_SW".

If it is not possible to change these in CubeMX, how would I go about doing that in the generated software? As the registers can only be read prior to booting.

Tilen MAJERLE
ST Employee
May 2, 2024

STM32CubeMX is not a tool for modification of option bytes. Modifying option bytes is similar to modifying BIOS settings on your computer.

Typically you configure the option bytes in 2 possible ways:

  • With STM32CubeProgrammer option bytes command. See STM32CubeProgrammer user manual for this
  • Or as part of your firmware, which then modifies necessary bits. Some changes require power-on-reset after applying the setting.
DMeie.2
Associate III
May 3, 2024

Thanks a lot, this helped quite a bit.

For anyone else looking this up, these two knowledge base entries are very useful as well:
https://community.st.com/t5/stm32-mcus/what-are-option-bytes-in-stm32-and-how-do-i-use-them/ta-p/49451
https://community.st.com/t5/stm32-mcus/faq-stm32-boot-process/ta-p/49358