hi,Fedora001
Thank you for your interest in NXP Semiconductor products and the opportunity to serve you, I will gladly help you with this.
I used the FRDM-K32L2B3 development board and the "frdmk32l2b_gpio_led_output" program in the SDK to do some tests. The following is the process of configuring SWDIO pin as GPIO pin.
1. Check the manual to find the pin corresponding to SWDIO, and you can see the SWDIO pin corresponding to PTA3.
2. Modify the Demo program, set the pin corresponding to SWDIO as GPIO pin in the program, and set the pin to low level.
3. Download the program to the development board through MCUXpresso.
4. Measure the voltage of pin 2 of J11, and the voltage becomes 0. Then the SWDIO pin is set to GPIO successfully.
Note that after the above steps are successfully set, the next time you use SWDIO to download the program to the chip, it will fail.
I have attached the code. Let me know if this is helpful, if you have more questions do not hesitate to ask me.
BR
Xu Zhang