cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L010F4P6 which pins are used by UART bootloader

tsma
Associate II

Hello, I'm attempting to flash firmware to aforementioned microcontroller using STM32CubeProgrammer. I have connected ST-Link VCP port to PA2 and PA3 ports, and i can communicate with my application fine. I even erased flash memory so I could be sure that device is in Boot mode. Unfortunately, I cannot connect to bootloader, log from Programmer below:

  13:48:06 : Serial Port ttyACM0 is successfully opened.
  13:48:06 : Port configuration: parity = even, baudrate = 115200, data-bit = 8,                     stop-bit = 1.0, flow-control = off
  13:48:08 : Timeout error occured while waiting for acknowledgement.
  13:48:08 : Timeout error occured while waiting for acknowledgement.
  13:48:08 : Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again... 

I'm wondering if listing both PA9/PA10 and PA2/PA3 as UART ports in documentation has anything to do with it. How does bootloader determine which of both pairs to use? Can pullups on PA2/PA3 connected to inactive I2C bus (because STM acts as master, also because of that and pin alternate functions being almost universally poorly laid out I couldn't use PA9/PA10) have something to do with it?

1 ACCEPTED SOLUTION

Accepted Solutions

It initially configures the UART-RX pin as a TIM input to measure the 0x7F bit pattern, then it uses that to initialize the UART and baud rate.

You want to avoid noise/activity on any other pin it might recognize as input/data.

Having a GPS receiver. or other device that starts squawking at startup can be problematic.

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

View solution in original post

4 REPLIES 4
MM..1
Chief II

Read AN2606

0693W00000Y7867QAB.pngFirst you need start bootloader and after this try connect. Start is pattern or jump from app

tsma
Associate II

Well, both are USART2 on PA9/PA10 and USART2 on PA2/PA3, as I wrote in my question. And PA2/PA3 works with UART in my application. It just refuses to work with CubeProgrammer. I'm just puzzled how does bootloader configure USART to use either of pairs.

It initially configures the UART-RX pin as a TIM input to measure the 0x7F bit pattern, then it uses that to initialize the UART and baud rate.

You want to avoid noise/activity on any other pin it might recognize as input/data.

Having a GPS receiver. or other device that starts squawking at startup can be problematic.

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

Well, after some fiddling it manages to connect with CubeProgrammer, which now crashes on me. It's irrelevant though. Thank you for answer.