Help using SWD and NRST as GPIO safely - STM32G031
Hi, so I've chosen to use STM32G031J6M6 8-pin version for an audio level meter project to get me started. I'm using pin 1 as the adc input, 2 and 3 are 3v3 and gnd, obviously. I was hoping to use the remaining 5 pins as GPIO outputs attached to LEDs for the level display. I'm using the DISCO board to program.
I'm pretty sure I bricked one of my chips already though, I think because I assigned the NRST (pin4) as well as the SWDIO and SWDCLK (pins 7 and 8) as GPIO outs and I guess then that there was no way to hold the chip in reset and program or debug it? The only other thing I did before it was unresponsive was to probe some of the board traces with my multimeter in diode/continuity mode.
I'm trying to be careful not to break another chip so I wanted to be sure before assigning those pins.
Is there a way I can use all these pins as GPIO output but not lock myself out of programing / debugging the chip? I read something about maybe adding a delay before the pins are assigned? Would this be as simple as placing a HAL_Delay(1000) towards the top of the main function in main.c? I'm using the CubeIDE and it's auto code generation functionality to assign the pins. I am still fairly new to this level of MCU programming having come from using Arduino so I might need baby steps.
Thanks.