Skip to main content
Associate III
May 23, 2025
Solved

STM32WL LPUART1 for both Bootloader and AT Commands

  • May 23, 2025
  • 2 replies
  • 557 views

Hamady_0-1747983488598.png

Hamady_1-1747983513094.png



Hello i Have a question about the STM32WL5MOC.

I need to be able to use the bootlader of the WL and in the same UART line use the AT Command.

But it seems that LPUART1 that is the only way to use AT Command Application is not used in the bootloader.

Do you have any idea to have both functionality 

Thanks

Best answer by STTwo-32

Hello @Hamady 

As said @Andrew Neil, the Open bootloader is always an option. But if you are using the LPUART on your trace code and you just want to have only one line (two Pins TX/RX), you can use the LPUART for your application code and the USART2 for the bootloader since the USART2 and the LPUART1 are both using the same pins (PA2 and PA3 as TX and RX) and they don't work simultaneously as said @Andrew Neil . 

Best Regards.

STTwo-32

2 replies

Andrew Neil
Super User
May 23, 2025

The System Bootloader and your application code are mutually exclusive:

  • While in the System Bootloader, your application code is not running;
  • While running your application code, the System Bootloader is not active.

The choice between System Bootloader and your application code is controlled by the BOOT0 pin.

 

PS:

Application note AN2606STM32 microcontroller system memory boot mode describes the System Bootloader.

You can also jump to the System Bootloader from your application code:

https://community.st.com/t5/stm32-mcus/how-to-jump-to-system-bootloader-from-application-code-on-stm32/ta-p/49424

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
HamadyAuthor
Associate III
May 23, 2025

@Andrew Neil 

Thanks for the info 

What i mean is that i can only afford one UART line and be able to use bootloader

Thanks

Andrew Neil
Super User
May 23, 2025

Yes, the System Bootloader is restricted to use only the specified interfaces; so, as shown in your  table, only USART1 or 2 - not the LPUART.

 

But that doesn't stop you using a custom bootloader on any interface you choose ...

https://community.st.com/t5/stm32-mcus-products/how-can-i-use-an-esp32-to-update-the-firmware-of-an-stm32-from/m-p/696331/highlight/true#M254868

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
STTwo-32
STTwo-32Best answer
Technical Moderator
May 23, 2025

Hello @Hamady 

As said @Andrew Neil, the Open bootloader is always an option. But if you are using the LPUART on your trace code and you just want to have only one line (two Pins TX/RX), you can use the LPUART for your application code and the USART2 for the bootloader since the USART2 and the LPUART1 are both using the same pins (PA2 and PA3 as TX and RX) and they don't work simultaneously as said @Andrew Neil . 

Best Regards.

STTwo-32