cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 UART bootloader on brand new chip.

federico.massimi
Associate III

Hi, I have some questions about the STM32 UART bootloader. I've never used this technology, so the questions might be trivial, but I couldn't find detailed information on the internet.

Question 1 - In all the tutorials I found, development boards or evaluation boards are always used, so always chips that have already been programmed. The question is:  The STM32 UART Bootloader also present in brand new STM32 chips or does it need to be programmed?

I ask because I intend to design a module that must be as small as possible, to save space I would like to avoid letting out the SWD signals, and use the two wires of the UART also for first initial programming (brand new chip), I can do it?

Question 2 - All STM32 microcontrollers support UART bootloader? On some datasheets I see that it is not mentioned, but then there are generic documents for all STM32 that talk about it.

Thanks in advance

4 REPLIES 4
TDK
Guru

> The STM32 UART Bootloader also present in brand new STM32 chips or does it need to be programmed?

The bootloader is in ROM. It is present in new chips and cannot be erased.

> I would like to avoid letting out the SWD signals, and use the two wires of the UART also for first initial programming (brand new chip), I can do it?

You need a way of getting the chip into bootloader mode, and you need to ensure the UART is the only active interface when that happens. Assuming you do both of those, yes.

However, not breaking out SWD signals significantly slows down development and is not something I would recommend for anything except a finished product that needs no further development/debugging.

> All STM32 microcontrollers support UART bootloader?

Certainly the vast vast majority, if not all. Details are in AN2606 for specific chips.

https://www.st.com/resource/en/application_note/cd00167594-stm32-microcontroller-system-memory-boot-mode-stmicroelectronics.pdf

If you feel a post has answered your question, please click "Accept as Solution".
federico.massimi
Associate III

> You need a way of getting the chip into bootloader mode, and you need to ensure the UART is the only active interface when that happens. Assuming you do both of those, yes

By "getting the chip into bootloader mode" do you mean to set the level on the boot pins?

By " ensure the UART is the only active interface when that happens" do you mean for example to connect the RX pin of all the other uart to ground, to connect the SCK of the SPI to ground, and things like that?

Setting BOOT0 pin level high during reset is one way, assuming the value is not overridden by option bytes.
Yes. Doesn’t need to be grounded, just need to be inactive/ not toggling.
If you feel a post has answered your question, please click "Accept as Solution".

>>By " ensure the UART is the only active interface when that happens" do you mean for example to connect the RX pin of all the other uart to ground, to connect the SCK of the SPI to ground, and things like that?

Means not having things like a GPS/GNSS receiver chattering immediately on start-up, on lines which are being monitored per AN2606.

Note, it doesn't open initially as a USART, but rather timing the 0x7F (8N1) data pattern to compute the baud rate of the signalling.

Consider facilitating SWD connectivity via a break-off board, that normally isn't in the final product, or use edge constellation, or LED / button pins. Most current STM32 can fuse off the SWD/DEBUG

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..