cancel
Showing results for 
Search instead for 
Did you mean: 

How to fix LPUART Transmit on STM32L010 after reset

Jan Sramota
Associate II

Hello, I have an STM32L010F4P6. I am using HAL libraries, STM32Cube IDE 1.10. And i wrote my program in language C. I must set optimalization to -Os. (Low space) My issue is little bit mysterious. I am using LPUART (115200 8N1) for communication. When I flash fw and run a code all work perfectly, but when i reset the STM32 (unconnected and connected power or terminate by IDE, unconnect ST-link, reset by ide) the MCU Transmit wrong data in response. I could not debug (because -Os) and also because it failed after reset

1 ACCEPTED SOLUTION

Accepted Solutions
Jan Sramota
Associate II

Finally I had the time to return to this project. So. The root cause of the problem is a pull-up on pin PB9, which is shared with function BOOT0. n. As a result, after resetting the MCU, it attempts to boot from the system memory instead of the flash memory.

After I checked checkbox for nBOOT_SEL, nBOOT0 and nBOOT1 in STM32Cube Programmer program runs after reset.

View solution in original post

2 REPLIES 2

See what the signal looks like on a scope or logic-analyzer

Have an external pull-up on the TX pin so it has known/defined state.

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

Finally I had the time to return to this project. So. The root cause of the problem is a pull-up on pin PB9, which is shared with function BOOT0. n. As a result, after resetting the MCU, it attempts to boot from the system memory instead of the flash memory.

After I checked checkbox for nBOOT_SEL, nBOOT0 and nBOOT1 in STM32Cube Programmer program runs after reset.