STM32G03x bootloader nonresponsive after errant UART data
Good day,
I have stumbled upon an issue with my device's bootloader that seems to be inconsistent with the ST documentation.
I have an STM32G031K8T6. USART1 RX and TX are connected to an RS-232 transceiver, which is then connected to my host PC using a USB-to-RS232 cable:
[STM32G03x USART1] <----> [RS232 tranceiver (MAX3232 equivalent)] <---> [FTDI RS-232 USB cable] <---> [Host PC]
I would like to use the bootloader to upload firmware to the device, over this UART link. Normally, this works just fine. However, I have observed that the bootloader will not respond if it receives invalid data before receiving the valid 0xF7.
To reproduce "good" behavior:
- Create an empty board
- Apply BOOT0, and power on (bootloader mode).
- Connect to the COM port using TeraTerm, or some other serial terminal (57600, 8 bit, even parity, 1 stop bit)
- Don't send any data
- Disconnect from TeraTerm
- Attempt to connect to board using Stm32CubeProgrammer (UART, 57600, 8 bit, even parity, 1 stop bit)
- Connection will succeed
To reproduce non-responsive behavior:
- Create an empty board
- Apply BOOT0, and power on (bootloader mode).
- Connect to the COM port using tera term (57600, 8 bit, even parity, 1 stop bit)
- Send a single byte over tera term (any keyboard press)
- Disconnect from tera term
- Attempt to connect to board using Stm32CubeProgrammer (UART, 57600, 8 bit, even parity, 1 stop bit)
- Connection will fail with error: "Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again..."
When I observe the communications with a logic analyzer, I see that the device responds like normal in the first instance, but in the second response the device does not respond at all - neither when the bad data or the good 0x7F is sent afterwords.
But my reading of the documents seems like this shouldn't matter. The flow chart in section 44.2 of AN2606 shows that the bootloader should just ignore the errant byte and continue listening for the 0x7F, but it doesn't.
Obviously, one solution to this is just "don't send bad data". But I have a Desktop program that is unable to determine whether it is connected to the bootloader or to the application.
Any idea what the cause could be of this, or how to work around it?
Thanks
