Secured & Mass Erase Disabled Kinetis K60N512 Device

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Secured & Mass Erase Disabled Kinetis K60N512 Device

9,003 Views
muhammad_qasim
Contributor I

Hi

I am working on TWR-K60N512 board. It was working fine some days ago but due to growing size of code,

Flash Configuration Filed (0x400 to 0x40C) of Program Flash Area has been updated accidentally.

Now I am unable to connect to the board and load the program in Program Flash.

********************************************************************************************

When I try to connect using JLINK (JLink.exe), Following message is displayed.

********************************************************************************************

SEGGER J-Link Commander V4.42b ('?' for help)

Compiled Feb 14 2012 15:27:02

DLL version V4.42b, compiled Feb 14 2012 15:26:46

Firmware: J-Link ARM V8 compiled Aug  1 2012 13:40:47

Hardware: V8.00

S/N: 58006903

VTarget = 3.267V

Info: TotalIRLen = 4, IRPrint = 0x01

Info: ARM AP[0]: 0x24770011, AHB-AP

Info: ARM AP[1]: 0x001C0000, JTAG-AP

****** Error: Secured Kinetis device detected but mass erase is disabled.

No APB-AP found.

No devices found on JTAG chain. Trying to find device on SWD.

Info: Found SWD-DP with ID 0x2BA01477

****** Error: Secured Kinetis device detected but mass erase is disabled.

Info: Found SWD-DP with ID 0x2BA01477

****** Error: Secured Kinetis device detected but mass erase is disabled.

No device found on SWD.

Did not find any core.

Info: TotalIRLen = 4, IRPrint = 0x01

Info: ARM AP[0]: 0x24770011, AHB-AP

Info: ARM AP[1]: 0x001C0000, JTAG-AP

****** Error: Secured Kinetis device detected but mass erase is disabled.

No APB-AP found.

No devices found on JTAG chain. Trying to find device on SWD.

Info: Found SWD-DP with ID 0x2BA01477

****** Error: Secured Kinetis device detected but mass erase is disabled.

Info: Found SWD-DP with ID 0x2BA01477

****** Error: Secured Kinetis device detected but mass erase is disabled.

No device found on SWD.

Did not find any core.

J-Link>

*******************************************************************************************

When I try to unlock the board (unlock kinetis), following message is displayed

*******************************************************************************************

J-Link>unlock kinetis

Found SWD-DP with ID 0x2BA01477

Unlocking device...Unlock via debug port is disabled. Unlock failed.

Timeout while unlocking device.

J-Link>

**********************************

Unsecure Command of JLINK

**********************************

I have also tried to check unsecure command but JLINK Commander V4.42b does not support it for K60N512

****************************

CodeBench with JLINK

****************************

When connecting K60N512 using CodeBench & JLINK, following error message is displayed.

arm-none-eabi-sprite: J-Link error: Secured Kinetis device detected but mass erase is disabled.

No APB-AP found.

arm-none-eabi-sprite: error: Couldn't find a J-Link device

arm-none-eabi-sprite: waiting for GDB connection, to pass error along

**********************

Using CodeWarrior

**********************

When trying to connect the K60N512 board using CodeWarrior and OSBDM/OSJTAG,

a pop up message is displayed (twice) saying

"Device is secure, Mass erase is

disabled. Try to unsecure

anyways?"

If I say yes, then another popup message is displayed saying

"An error occurred while connecting to the interface hardware or target specified in launch configuration dialog. ......"

I also tried by enabling the following option

"Always Mass Erase on Connect"

but no success.

*****************

Is there any solution (Hardware/Software) to

- Unsecure the device

- Mass erase should be enabled.


Labels (1)
0 Kudos
11 Replies

1,907 Views
LuisCasado
NXP Employee
NXP Employee

Hi,

Try the following:

1.       drop the erase_all_pin.jlk in the “Program Files\IAR Systems\Embedded Workbench 6.0\arm\bin” directory

2.       Power off the board

3.       Assert the reset pin and hold it asserted for the remainder of the process.

4.       Power on the board

5.        go to a command window navigate to the “Program Files\IAR Systems\Embedded Workbench 6.0 Evaluation\arm\bin” directory and execute the script by typing “jlink.exe erase_all_pin.jlk” .

6.       Release the reset pin

7.       Try to connect with debugger

Best Regards,

Luis

0 Kudos

1,907 Views
muhammad_qasim
Contributor I

Thanks for your prompt answer. I tried the solution but no success. Same response as described above.

0 Kudos

1,907 Views
LuisCasado
NXP Employee
NXP Employee

Hello,

Have you trid with JTAG connector instead of using SWD?

Best Regards,

Luis

0 Kudos

1,907 Views
muhammad_qasim
Contributor I

Yes, I tried

1. CodeBench with JLINK using JTAG connector

2. CodeWarrior with OSJTAG

0 Kudos

1,907 Views
LuisCasado
NXP Employee
NXP Employee

Hello,

I have recovered some customer boards with the procedure explained. With the script I attached, JLINK and JLink commander, last time with V4.50I from segger.com  . To mantain the reset in the procedure was the key.

Best Regards,

Luis

0 Kudos

1,907 Views
muhammad_qasim
Contributor I

How I executed the Script?

1. Power Off the board

2. Press the Reset Button [SW3]

3. Power ON the board

4. Execute the script [jlink.exe erase_all_pin.jlk]

5. Release the Reset Button [SW3]

Now connect the board

1. using CodeBench, JLINK with the help of connector

2. using CodeWarrior, OSJTAG/OSBDM

Am I missed some settings/configurations. 

Here is the output of script

***********************************

SEGGER J-Link Commander V4.52c ('?' for help)

Compiled Aug 30 2012 15:29:17

Script file read successfully.

DLL version V4.52c, compiled Aug 30 2012 15:29:00

Firmware: J-Link ARM V8 compiled Aug  1 2012 13:40:47

Hardware: V8.00

S/N: 58006903

VTarget = 0.000V

Processing script file...

JTAG speed: 1000 kHz

Sleep(10)

****** Error: Supply voltage too low (1 Volt is required, Measured: 0.0 Volt).

Please check target power.

Reset type UNKNOWN: ???

Reset delay: 0 ms

Reset type UNKNOWN: ???

PC: (R15) = 00000000, CPSR = 00000000 (Unknown mode, ARM)

R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000

R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000

USR: R8 =00000000, R9 =00000000, R10=00000000, R11 =00000000, R12 =00000000

     R13=00000000, R14=00000000

FIQ: R8 =00000000, R9 =00000000, R10=00000000, R11 =00000000, R12 =00000000

     R13=00000000, R14=00000000, SPSR=00000000

SVC: R13=00000000, R14=00000000, SPSR=00000000

ABT: R13=00000000, R14=00000000, SPSR=00000000

IRQ: R13=00000000, R14=00000000, SPSR=00000000

UND: R13=00000000, R14=00000000, SPSR=00000000

WARNING: RESET (pin 15) high, but should be low. Please check target hardware.

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.

ERROR: Could not reset error in Ctrl/Stat register.

Sleep(10)

Invalid status (=7) received while writing DP register 2

Sleep(10)

Invalid status (=7) received while reading AP register 0

Sleep(10)

Invalid status (=7) received while reading AP register 0

Sleep(10)

Invalid status (=7) received while reading AP register 1

Sleep(10)

Invalid status (=7) received while reading AP register 1

Sleep(10)

Invalid status (=7) received while reading AP register 0

Sleep(10)

Invalid status (=7) received while reading AP register 0

Sleep(10)

Invalid status (=7) received while writing AP register 1

Sleep(1000)

Invalid status (=7) received while reading AP register 0

Sleep(10)

Invalid status (=7) received while reading AP register 0

Sleep(10)

Invalid status (=7) received while reading AP register 1

Sleep(10)

Invalid status (=7) received while reading AP register 1

Sleep(100)

Invalid status (=7) received while writing DP register 2

Sleep(1000)

Selecting JTAG as current target interface.

Setting target interface speed to 1MHz. Use "Speed" to change.

Sleep(100)

****** Error: Supply voltage too low (1 Volt is required, Measured: 0.0 Volt).

Please check target power.

Reset delay: 0 ms

Reset type UNKNOWN: ???

Script processing completed.

****************************************


0 Kudos

1,907 Views
LuisCasado
NXP Employee
NXP Employee

Hello,

Try to power the board from TWR-ELV USB connector.  Did you receive a pop up window from commander about that you device is secured and if you want a mass erase?


Best Regards,

Luis

0 Kudos

1,907 Views
muhammad_qasim
Contributor I

"Try to power the board from TWR-ELV USB connector"

Yes

"Did you receive a pop up window from commander about that you device is secured and if you want a mass erase?"

1. When I use CodeBench + JLINK, no pop up window is displayed.

2. When I use CodeWarrior + OSJTAG, Pop up window is displayed by stating a message

"Device is secure, Mass erase is disabled. Try to unsecure anyways?"

If I say yes, then another popup message is displayed saying

"An error occurred while connecting to the interface hardware or target specified in launch configuration dialog. ......"

After retrying, downloading is failed.


0 Kudos

1,907 Views
LuisCasado
NXP Employee
NXP Employee

Hello,

Using the Segger software and the script, you should receive a pop-up screen about that Device is secured. Did you get it? Don't forget that you can block forever the device if you wrote in the config registers a bad value. With segger software and script I have recovered all the devices that were not fully locked.

http://www.segger.com/jlink-software.html

Best Regards,


0 Kudos

1,907 Views
muhammad_qasim
Contributor I

Thanks for your valuable suggestions. I think the board has been locked & secured permanently and can not be programed now. It is also verified by Board Vendor.

0 Kudos

1,907 Views
antonio66
Contributor III

Hello,

I solved with command "Jlink unlock Kinetis"  from ...\IAR Systems\Embedded Workbench 6.5\arm\bin


Antonio

0 Kudos