cancel
Showing results for 
Search instead for 
Did you mean: 

How to choose stm32G431 BOOT mode

km naxin
Associate II

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.

4 REPLIES 4
DMeie.2
Senior II

@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

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.

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