I have been using the K20 on a small project and I had the unlocking problem that is widely reported almost every single time but this last board I believe does not want to be unlocked.
Following is the output from the erase_all_pin.jlk when run keeping the reset pin grounded, can you please help?
SEGGER J-Link Commander V4.90c ('?' for help)
Compiled Aug 29 2014 09:52:38
Script file read successfully.
DLL version V4.90c, compiled Aug 29 2014 09:52:33
Firmware: J-Link ARM-OB STM32 compiled Aug 22 2012 19:52:04
Hardware: V7.00
S/N: 20090928
Feature(s): RDI,FlashDL,FlashBP,JFlash,GDBFull
VTarget = 3.300V
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
No devices found on JTAG chain. Trying to find device on SWD.
Info: Found SWD-DP with ID 0x2BA01477
****** Error: Error while identifying Cortex-M core.
Info: Found SWD-DP with ID 0x2BA01477
No device found on SWD.
Failed to identify target. Trying again with slow (4 kHz) speed.
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
No devices found on JTAG chain. Trying to find device on SWD.
Info: Found SWD-DP with ID 0x2BA01477
****** Error: Error while identifying Cortex-M core.
Info: Found SWD-DP with ID 0x2BA01477
No device found on SWD.
No device found at all. Selecting JTAG as default target interface.
Processing script file...
Target interface speed: 1000 kHz
Sleep(10)
Info: Could not measure total IR len. TDO is constant high.
Reset type UNKNOWN: ???
Info: Could not measure total IR len. TDO is constant high.
Reset delay: 0 ms
Reset type UNKNOWN: ???
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
PC: (R15) = 00000000, CPSR = 00000000 (Unknown mode, ARM)
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
USR: R8 =00000000, R9 =00000000, R10=00000000, R11 =00000000, R12 =00000000
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
R13=00000000, R14=00000000
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
FIQ: R8 =00000000, R9 =00000000, R10=00000000, R11 =00000000, R12 =00000000
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
R13=00000000, R14=00000000, SPSR=00000000
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
SVC: R13=00000000, R14=00000000, SPSR=00000000
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
ABT: R13=00000000, R14=00000000, SPSR=00000000
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
IRQ: R13=00000000, R14=00000000, SPSR=00000000
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
UND: R13=00000000, R14=00000000, SPSR=00000000
Sleep(1000)
Selecting SWD as current target interface.
Setting target interface speed to 1MHz. Use "Speed" to change.
Sleep(10)
Select SWD by sending SWD switching sequence.
Found SWD-DP with ID 0x2BA01477
Sleep(10)
Write DP register 2 = 0x01000000
Sleep(10)
Read AP register 0 = 0x00000000
Sleep(10)
Read AP register 0 = 0x00000034
Sleep(10)
Read AP register 1 = 0x0000003E
Sleep(10)
Read AP register 1 = 0x00000000
Sleep(10)
Read AP register 0 = 0x00000000
Sleep(10)
Read AP register 0 = 0x00000036
Sleep(10)
Write AP register 1 = 0x00000001
Sleep(1000)
Read AP register 0 = 0x00000036
Sleep(10)
Read AP register 0 = 0x00000034
Sleep(10)
Read AP register 1 = 0x00000034
Sleep(10)
Read AP register 1 = 0x00000001
Sleep(100)
Write DP register 2 = 0x00000000
Sleep(1000)
Selecting JTAG as current target interface.
Setting target interface speed to 1MHz. Use "Speed" to change.
Sleep(100)
Info: Could not measure total IR len. TDO is constant high.
Reset delay: 0 ms
Reset type UNKNOWN: ???
Info: Could not measure total IR len. TDO is constant high.
Script processing completed.
################################################################################
Edit after some experiments:
connected the reset to GND and re-run the script and I can see that the device is indeed secured but it seems like the mass erase is enabled if I read this register correctly.
Read AP register 0 = 0x00000036
Now if I try to force a mass erase setting bit 0 of the control register I assume I should see mass erase start with bit 0 of th status register confirming (Flash Mass Erase Acknowledge) that but I do not see that like the chip is not taking the command.
Write AP register 1 = 0x00000001
Read AP register 0 = 0x00000036
Read AP register 0 = 0x00000036
Read AP register 0 = 0x00000036
Sleep(10)
Read AP register 0 = 0x00000036
Has anyone seen something like this? Is there a way to get out of it?
Message was edited by: Gianluca Barbieri