Hi @MUXU
To disable the JTAG interface. You must manipulate the Flash section in the startup code.
/* Flash Configuration */
.section .FlashConfig, "a"
.long 0xFFFFFFFF /* 8 bytes backdoor comparison key */
.long 0xFFFFFFFF /* */
.long 0xFFFFFFFF /* 4 bytes program flash protection bytes */
.long 0xFFFF7FFE /* FDPROT:FEPROT:FOPT:FSEC(0xFE = unsecured) */
Once the MCU is locked, you can unlock it with
1. Mass erase (only possible when FSEC[MEEN] is enabled)
2. Backdoor key
For more information refer to sections 36.4.1 (Flash configuration field description) and 36.4.4.1.4 (Specifically, the Flash Security Register (FSEC)) of the S32K1xx Series Reference Manual, Rev. 14.
BR, VaneB