Hi @PINKMAN,
To ensure successful debugging, the MCU must be reset and the debugger must connect and halt the core within the brief time window before the pins are reconfigured.
Did you also reconfigure the reset_b pin?
If so, the only reliable way to reset the MCU is via a Power-On Reset (POR).
What debugger are you using?
For example, if you're using Lauterbach, you can use a script like this:
SYStem.CPU S32K312-M7
SYStem.config.core 1. 1.
SYStem.config.debugporttype JTAG
System.JTAGclock 10MHz
sys.Option DUALPORT ON
wait state.power()
sys.up
if RUN()
break
It waits until the MCU is powered.
Regards,
Daniel