0
\$\begingroup\$

I have heard that if I buy an empty factory made STM32, it will come with no bootloader at all. To program that STM32 with a bootloader, I need to do that through USART1. And later when I want to implement the program onto the STM32, I need to use SWDIO & SWCLK.

Is that correct? Or could I program the bootloader with USART1 and SWDIO & SWCLK, the same way I can program the STM32 with USART1 and SWDIO & SWCLK as well?

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Where did you hear that? Simply not true and easy to check from the datasheet. \$\endgroup\$
    – Justme
    Commented Oct 25, 2020 at 16:23
  • 1
    \$\begingroup\$ swd us thus far supported on all cortex-ms used by st. The usart based bootloader is in some form, thus far, supported on all of the stm32s, but the writing is on the wall based on the newer parts that that may be going away as you get one shot at it and then the bootloader itself is no longer available much less the uart1 interface to it. \$\endgroup\$
    – old_timer
    Commented Nov 12, 2020 at 3:21

1 Answer 1

1
\$\begingroup\$

The STM32 will come with factory bootloader. That bootloader is the one that enables programming over various interfaces if SWD or JTAG is not used. Different models support different interfaces, but UART1 is always supported.

You can always use the SWD and JTAG interfaces as they do not even need to run bootloader code for that to work.

\$\endgroup\$
15
  • \$\begingroup\$ Ok. Can I use USART1 to communicate with Raspberry Pi too? Or do I need to use another USART if I want UART communication? \$\endgroup\$
    – euraad
    Commented Oct 25, 2020 at 16:26
  • \$\begingroup\$ Why would you need to use another UART for that? You can even update the STM32 firmware from RasPi if you connect it to a UART that is supported by the factory bootloader, just boot into bootloader and run a flashing program on RasPi. \$\endgroup\$
    – Justme
    Commented Oct 25, 2020 at 16:30
  • 1
    \$\begingroup\$ Yes, nothing prevents you from doing that. \$\endgroup\$
    – Justme
    Commented Oct 25, 2020 at 16:37
  • 2
    \$\begingroup\$ What people? Where? Perhaps you told them something I don't know. Like which STM32 and which board is it on? \$\endgroup\$
    – Justme
    Commented Oct 25, 2020 at 16:47
  • 1
    \$\begingroup\$ F3 series has dozens of different MCU models, all different from each others and bootloader capabilities so that tells nothing. But those people are simply wrong, and if they claim so they should have some proof to back that up. All USARTs can be used for USART comms. Only some of them are special that the internal bootloader can use them, as the bootloader does not support every USART. \$\endgroup\$
    – Justme
    Commented Oct 25, 2020 at 17:03

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.