cancel
Showing results for 
Search instead for 
Did you mean: 

How to program a nucle boat (L053R8) using UART?

AVals.1
Associate II

hey,

I went through all possible data sheets I could find did all the required things but my Nucleo still won’t be programmed with uart.

I have put boot0 on VDD pin next to it. For confirmation I also put PB2 (nboot1) on ground next to it.

I tried powering the nucleo through both the USB as well as an external supply (E5V) and switched to e5v.

I reset the controller to try programming.

I connected my Rx, Tx and Ground of my UART to usb (which I checked with the nucleo by programming a UART program through st link and it works)

I am using St flash which says there was no communication

and stm32 programmer says it timed out for the com port

i even checked that there was no read or write protection enabled and nboot1 option bits are correct by connecting to stm32 programmer through STlink

what am I missing?

9 REPLIES 9
Peter BENSCH
ST Employee

Welcome, @AVals.1​, to the community!

via which USART of the STM32L053R8 did you try to establish the connection?

> I connected my Rx, Tx and Ground of my UART to usb

This description is not clear: Which UART is connected to where or which USB?

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.
AVals.1
Associate II

I'm using an FTDI, connected the Rx, Tx to the USART1 (PA9, PA10) and Gnd from FTDI to the Gnd of Nucleo

OK, I also had almost exactly this combination (well, using a CH340 bridge) a few months ago and was able to access the NUCLEO-L053R8 via STM32CubeProg after a reset without any problems. However, I don't currently know when I will find the time to pick out the NUCLEO again to test it again.

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.
AVals.1
Associate II

Thanks so much for the reply!

Could you let me know YOUR procedure for flashing the STM32L053 nucleo? What tools you used (ST Flash demo or STM32Cube Programmer) ? Did you have to change the internal bootloader, or any settings via ST-Link? What other pin connections did you require? and how did you power up the Nucleo?

Thanks so much for the reply!

Could you let me know YOUR procedure for flashing the STM32L053 nucleo? What tools you used (ST Flash demo or STM32Cube Programmer) ? Did you have to change the internal bootloader, or any settings via ST-Link? What other pin connections did you require? and how did you power up the Nucleo?

As already mentioned, I used the STM32CubeProg.

The internal bootloader cannot be changed or altered because it is hard programmed.

With the STM32CubeProg, I changed the connection option (light blue button to the left of Connect) from ST-Link to UART, 115200, even parity. Perhaps the parity is already set incorrectly because Parity None is very often used. See AN2606 for a detailed description of the bootlader.

I have supplied the NUCLEO via USB.

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.

Thanks! I have the same connections and the exact same settings for the STM32Cube programmer as well

But I get this error

"Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again..."

My uart connections are correct

I have put a jumper between boot0 and vdd (CN7 - 5, 7)

I reset and try again and get the same error

How are you powering the Nucleo?

I have now found the NUCLEO-L053R8 and the USB-UART bridge again:

  • set BOOT0=1 using a jumper between CN7.5 and CN7.7
  • connect the USB-UART bridge (RX-TX, TX-RX, GND-GND)
    • it will not work if you accidentally connect TX-TX, RX-RX, but it will not damage the NUCLEO
    • set the levels of the bridge to 3.3V (optional, 5V also works, see below)
  • connect NUCLEO and bridge to the USB ports of your computer
  • press the black reset button of the NUCLEO again to make sure you are in the bootloader mode now

There is no need to change any other jumper. There is also no BOOT1 pin on the STM32L053, the BOOT1 function is instead realised by the bit nBOOT1 in the option bytes (by default set to 0).

  • start STM32CubeProg
  • set the light blue port button from ST-LINK to UART, if this is not already done, and check whether a port number has been found below it; if necessary, tap the reload circle to the right of it once again
  • set the desired UART baud rate (due to the autobaud function of the bootloader you can use anything between 1200...230400, with short wires also 460800...921600)
  • parity should be set to Even, on some bootloaders Odd works too
  • click Connect

Once you have started a connection attempt and want to try a different baud rate, you must first press the black reset button so that the bootloader can recognise the new baud rate.

If you still get the error message "Error: Activating device: KO.", you should make sure that RX and TX are actually cross-connected. 3.3V levels are not absolutely necessary, as the UART pins are 5V tolerant (FT).

Is it working for you now?

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.

Regardless of the unliklihood that this will be responded to by the current thread posters, I will continue trying to push for this solution to be found for future applications for whoever might need it.

As I read the thread I was taking the exact same steps before finding this thread.

So if anyone can assist in trying to figure out how to program an STM32 Nucleo L053R8 through a USB to UART converter that would be great, I have already followed the steps above to try to get to the solution.

In this image I have screenshotted the settings that I have in my programmer. Everything else as described in the previous message in this thread has been followed as well. I am still getting the same error as the original poster which is:
21:06:50 : Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again...

antlmn_0-1733541573154.png