cancel
Showing results for 
Search instead for 
Did you mean: 

How does the STM32 Boot pin works?

ECruz.2
Associate

I have a question about the BOOT pin performance of the STM32G031.

In the datasheet says that upon reset, the boot pin (PA13) is established at the beginning as the picture shows. But I wanna know if it is only at the beginning of the reset and then I can use the BOOT pin as an ADC pin???

0693W00000VOdsnQAD.pngIn the stm32g031 that boot pin automatically changes to SW after boot but we don't need to debug.

6 REPLIES 6
Peter BENSCH
ST Employee

Welcome, @Edson Cruz González​, to the community!

Unfortunately, you did not mention which of the more than a thousand STM32s you are referring to. However, I am not aware of any derivative that has the alternative function ADC input on the SWD pins. You can find the alternative functions that can be used in the respective data sheet in the section "Pinouts, pin description and alternate functions" and there in the table "Pin assignment and description".

Regarding the second question: yes, the SWD pins are polled shortly after the reset to a connected SWD debug interface and remain in this function until the SWD connection is terminated. It follows that the programmed alternative function is not available during debugging or programming via SWD.

Does this answer your question?

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
gbm
Lead III

BOOT state is sampled while coming out of reset. It's not needed afterwards, so in the chips which share BOOT pin with something else, few microseconds after reset the pin is used as an ordinary port pin. Also, in the MCUs in which BOOT is shared with GPIO, the boot function may be blocked by programming the option bytes.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice

Is it possible to avoid blocking the pin with the option bytes, and instead put a delay before changing the function to gpio?

MRao.1
Associate II

All the STM32 microcontrollers have the capability to boot from:

  • main flash memory, usually where your firmware is located: at the default value address 0x80000000 or a value define in option byte (if possible).
  • ST embedded bootloader located in the system flash memory: a code flashed at production and which can’t be modified in any manner.
  • SRAM: usually used for debugging purpose, or a specific action needing high performance or no-access to flash.

 Regard: Best dash cam apps

EXUE.2
ST Employee

The values on the BOOT pin are latched on the 4th rising edge of SYSCLK after reset

release, so after MCU boot successfully, BOOT pin can be used as other functions. But the matters need to be attended is the BOOT pin is also re-sampled when the device exits the Standby mode.

Consequently, they must be kept in the required Boot mode configuration when the device is

in the Standby mode.

The FLASH memory address is 0x08000000 (careful with zeros).