2022-05-05 09:56 AM
By mistake, I ended up setting PA14 (SWCLK) as an input GPIO. Didn't catch the mistake until after the MCU had already been flashed. So, after that I can't connect to it anymore using ST-Link.
Since I'm using a STM32G030F6 (TSSOP-20) chip, for this chip the boot0 pin is shared with the same PA14. I did try to connect PA14/BOOT0 to either GND and VCC (and reset the board afterwards each time), but I wasn't able to get it into bootloader mode.
Also attempted to connect with STM32CubeProgrammer via UART (to UART2, on PA2/PA3), but that wasn't successful, despite many attempts. As I understand, to access UART1 I need to set the SysCfg remapping registers so PA11/PA12 become PA9/PA10, so connecting (via CubeProg) to UART1 didn't work either.
So I've run out of options to try to connect to chip and re-flash it with a code that enables PA14 as SWCLK again.
Are there additional procedures I could try?
Solved! Go to Solution.
2022-05-05 10:28 AM
Connect Under Reset methods are best hope, needs NRST to be connected to debugger.
2022-05-05 10:06 AM
Not certain but maybe worth a try:
- connect RESET pin to ST link might allow it to take over the chip.
I recall seeing settings in the IDE Tools for what to do with RESET pin during programming.
Paul
2022-05-05 10:28 AM
Connect Under Reset methods are best hope, needs NRST to be connected to debugger.
2022-05-05 12:03 PM
Thanks guys!!!
Connect under reset did it. Was able to successfully connect and reflash using ST-Link, didn't need to use CubeProgrammer or fiddle with the Boot0 pin. I just put a jumper wire between the RST pins on ST-Link and the MCU and voilá (and of course changed the IDE debug settings to "connect under reset").
2022-05-11 08:37 AM
Hello @RMaia ,
How to solve debugger connection issues article contain a detailed description about this issue.
What you did is correct and thank you for sharing your finding.
If your issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly :)
Sara.
2022-05-11 08:48 AM
The thing that would help people find things faster would be for the Salesforce "Search" tool to actually function. I'd like it to function, so I can find cites and references.
Forums are like "Ground Hog Day", even if something is findable with low effort, it's likely to still be asked over and over.
2022-05-14 09:05 PM
Yes, sometimes the same question will be asked more than once. Even with a good search feature implemented, sometimes the person just doesn't know what keywords to look for...