Using SWDIO/SWCLK (PA13/PA14) as standard GPIOs on STM32 (STM32H533) - How to still program the MCU?
Hi everyone,
I'm currently working on a project using an STM32H533RET6, and I am running a bit short on available pins. I am considering reconfiguring PA13 (SWDIO) and PA14 (SWCLK) to use them as standard general-purpose I/Os for my application.
My main concern is about the flashing process. If I reconfigure these pins as regular GPIOs in my firmware, the SWD interface will be disabled as soon as the code starts executing.
My questions are:
-
Is it generally possible to use PA13 and PA14 as regular GPIOs and still be able to flash new firmware onto the MCU?
-
If yes, what is the best practice to avoid permanently locking myself out? Do I strictly need to connect the hardware NRST pin to my programmer (ST-LINK) and use "Connect under reset"?
-
Are there any software tricks (like adding a delay before GPIO initialization) that you would recommend?
Obviously, I know that live debugging won't be possible once the pins are remapped, but I just need to make sure I can still update the flash reliably.
Any advice or shared experiences would be greatly appreciated. Thanks in advance!
