Hi,
We are using JLINK_PIN_Override() when perform unlocking of Secure JTAG on Cortex M7 (NXP iMX RT1050)
To unlock Secure JTAG Controller (SJC), we need to set JTAG_MOD=1, then perform some actions, then set JTAG_MOD=0
But we can't keep HIGH level on pin 17, because first instruction JLINK_JTAG_WriteIR() resets pin to "RELEASE" state.
Our Default.JLinkScript :
Display All
Our question: how we can set pin 17 to HIGH level, and not reset this pin after JLINK_JTAG_WriteIR() instruction?
We are using JLINK_PIN_Override() when perform unlocking of Secure JTAG on Cortex M7 (NXP iMX RT1050)
To unlock Secure JTAG Controller (SJC), we need to set JTAG_MOD=1, then perform some actions, then set JTAG_MOD=0
But we can't keep HIGH level on pin 17, because first instruction JLINK_JTAG_WriteIR() resets pin to "RELEASE" state.
Our Default.JLinkScript :
C Source Code: Default.JLinkScript
- U32 _aPINMode[8]; // [0]=3, [1]=5, [2]=7, [3]=9, [4]=11, [5]=13, [6]=15, [7]=17
- U32 _aPINState[8]; // input: 0 for LOW, 1 for HIGH
- // ... initialization ...
- // Set pin JTAG_MOD => 1
- _aPINMode[7] = JLINK_PIN_OVERRIDE_MODE_PIO_OUT_HIGH;
- r = JLINK_PIN_Override(&_aPINMode[0], &_aPINState[0]);
- JLINK_SYS_Sleep(1000);
- // ... at this moment we can see on oscilloscope HIGH level on JTAG_MOD (pin 17 on connector)
- // ... initialization ...
- JLINK_JTAG_WriteIR(0xC); // Output Challenge instruction
- // ... at this moment we can see on oscilloscope LOW level on JTAG_MOD (pin 17 on connector)
- // ... but we except HIGH level
- // ... challenge-response procedure ...
- // Set pin JTAG_MOD => 0
- _aPINMode[7] = JLINK_PIN_OVERRIDE_MODE_PIO_OUT_LOW;
- r = JLINK_PIN_Override(&_aPINMode[0], &_aPINState[0]);
- JLINK_SYS_Sleep(100);
- // ... now we expect LOW level on JTAG_MOD pin, but it became LOW before challenge-response procedure, and we got fail ...
- return 0;
Our question: how we can set pin 17 to HIGH level, and not reset this pin after JLINK_JTAG_WriteIR() instruction?