2019-10-18 03:28 PM
After programming the stm32g0316-disco the first time the programmer no longer connects. How do I reprogram it, and prevent this in the future?
Thanks,
Scott
2019-10-18 03:34 PM
Did you reprogram PA12 or PA13? That causes the SWD protocol to no longer work.
To reprogram, hold boot0 high during reset, then use the bootloader to program.
2019-10-19 09:32 AM
Thanks TDK. I am having a lot of trouble finding information on how to activate the bootloader. I assume it is built into one of the development tools, but I haven't found where. Can you point me in the right direction?
Thanks,
Scott
2019-10-19 11:49 AM
What board do you have? STM32G0136-DISCO is not something that exists--no results on Google.
2019-10-19 12:15 PM
Sorry, a typo stm32g0316-disco. I ended up changing the chip after not being able to connect the programmer (stm32cube programmer) to connect with it again. I did see that connecting power to the discovery board with pin 8 held high and 4 held low did prevent my code from running, and the programmer was able to open the UART port, but always reports an error "KO" immediately. I was wasting too much time, so I replaced the chip.
I am using cubemx to do the design along with system workbench for stm32 to compile. In the first design I implemented i2c1 and i2s1 but forgot to include pin 7 as sys_swdio, which is why I am assuming I was locked out of reprogramming. This time I have mapped pin 7 as sys_swdio, which I am hoping will prevent me from having to change chips again. Does this make sense?
Thanks,
Scott
2019-10-19 12:16 PM
The "Connect under Reset" option may work for you. It's supposed to connect to the processor before it executes any code, however it seems buggy every time I try to use it. It's in the STM32 ST-Link Utility as well as STM32CubeProgrammer.
2019-10-19 12:18 PM
Yes, programming SWDIO and SWCLK pins--or just leaving them untouched at their reset values--should prevent ST-Link from not working.