I have 4 quick questions regarding the bootloader/programming the STM32L0 chip series.


I'm considering a STM32 project coming from ATMEGA chips. From my understanding, the chips come with a bootloader pre-loaded, and you can then either program them through the SWD/JTAG or UART/SPI interfaces etc, if enabled by the bootloader (Q1 - is this correct?).

If programming through SWD/JTAG, is it possible to change the bootloader to set pin functions, or is this only possible if programming through UART, etc? (Q2 - can you set bootloader settings through SWD?).


I considered the STM32L011E4 chip, and there seems to be a disparity between the USART1 pins as defined on the default bootloader configuration document, and in the datasheet where it defines the functions of the pins. It seems that the bootloader states that it comes with USART1 on pins PA9 and PA10, however pins PA9 and 10 on the datasheet only have USART2 functionality. It looks like they've got the pins for USART1 and USART2 mixed up on the devices bootloader. (Q3 - How am I reading this wrong, as I can't imagine there's a typo here?)

[default bootloader configuration[1]

chip alternate functions


Regarding UART1 and UART2 for flash programming on this chip: from the following image, am I correct in thinking that only the USART2 port can be used to program the flash memory? The UART1 is a low power variant so that could explain this. (I don't know whether to read it as "there are 2 UARTs that can flash the chip" or "use UART2 to flash the chip"

bootloader flash pins

  • 1
    \$\begingroup\$ Please create a seperate question for the UART stuff (you can leave Q1 and Q2 here and put Q3 and Q4 in another question), as both topics are completly different. \$\endgroup\$
    – jusaca
    Jan 14, 2020 at 9:52

1 Answer 1


Q1) Correct. You can use SWD/JTAG directly to download your firmware to chip. Or you can trigger the bootloader and use USART and other available interfaces to download the firmware.

Q2) No, bootloader settings cannot be modified. It only uses the pins it uses, you cannot and don't need to configure the bootloader operation.

Q3) It is possible that there is a typo, it would not be the first typo in STM32 documentation. The bootloader appnote section is for both L01 and L02 chips, so it might not fully apply to your specific L01 chip.

Q4) On your chip, it only uses USART2, but it can look at GPIOs at both PA9/PA10 and PA2/PA3 pins simultanously for activity, and then route the USART2 to the pins that had activity first, so it will only use the USART2 peripheral on both sets of pins. So it really does not matter for the user how it works and how many USARTs there is, as long as you can go to bootloader and use either PA2&3 or PA9&10 to program it.

  • \$\begingroup\$ The pinouts for L01 and L02 are the same, I had thought of and checked that, but no luck there :/ Thanks for the rest of the info though. \$\endgroup\$
    – alex
    Jan 14, 2020 at 10:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.