cancel
Showing results for 
Search instead for 
Did you mean: 

Can't reprogram STM32g0136-disco!!

Scott3
Associate II

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

6 REPLIES 6
TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".
Scott3
Associate II

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

TDK
Guru

What board do you have? STM32G0136-DISCO is not something that exists--no results on Google.

If you feel a post has answered your question, please click "Accept as Solution".
Scott3
Associate II

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

TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".
TDK
Guru

Yes, programming SWDIO and SWCLK pins--or just leaving them untouched at their reset values--should prevent ST-Link from not working.

If you feel a post has answered your question, please click "Accept as Solution".