2022-12-30 05:09 AM
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?
Solved! Go to Solution.
2022-12-30 06:11 AM
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.
2022-12-30 05:59 AM
Read AN2606
First you need start bootloader and after this try connect. Start is pattern or jump from app
2022-12-30 06:03 AM
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.
2022-12-30 06:11 AM
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.
2022-12-30 06:18 AM
Well, after some fiddling it manages to connect with CubeProgrammer, which now crashes on me. It's irrelevant though. Thank you for answer.