cancel
Showing results for 
Search instead for 
Did you mean: 

lost access to STM32G030 micro

KPN1
Associate III

In a recent design I needed an additional pin and I configured the PA13 / SWDIO pin as a GPIO input.

All going fine, code works, but then this happened: After I program the chip in automatic mode and set the option byte rdp to 0xBB I can't connect again with the programmer. Programmer sais: No STM32 Target found...

I tried different modes and reset modes, no luck.

The readout protection alone is not the issue, I have been able to connect and reset this on other designs after it was set. The difference here is that the processor is using the SWDIO as an input when running. I thought this would not affect it as it should be available to the programmer directly after reset. The code without the readout protection set does not prevent me from connecting either. This must be the combination of both somehow.

Any smart ideas how to circumvent this and connect the programmer again?

Regards, Peter

P.S. I know you like to look at the schematic for a custom board, so I will attach a snippet of the relevant area

4 REPLIES 4
Ozone
Principal III

Pulling down the BOOT0 pin at power-on and connect to the system bootloader via a supported tool should still work.
In most cases the Cube Programmer and a serial line will do the trick.
Any (reversible) RDP setting active means you have to perform a mass erase.

> Any smart ideas how to circumvent this and connect the programmer again?

Not re-using the SWD pins.

mfgkw
Senior II

Do you have NRST connected between you ST-Link and the target and the connection type set to "connect und reset"?

KPN1
Associate III

@mfgkw "Do you have NRST connected between you ST-Link and the target .."

Yes, I programmed and debugged the chip through this connection.

@Ozone "Not re-using the SWD pins."

...would have been the right answer if the question was what to do better next time :)

I will try the bootloader option tomorrow unless someone comes up with a better idea.

 

Regards, Peter

 

Andrew Neil
Super User

@KPN1 wrote:

Any smart ideas how to circumvent this and connect the programmer again?


Add a delay before you reconfigure the SWD pin - to give the debugger time to connect.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.