AnsweredAssumed Answered

MKL04Z8XXX4 Custom board lock/brick

Question asked by Tomaz Lovrencic on Apr 24, 2019
Latest reply on Apr 25, 2019 by Aldo Gutierrez

I have custom MKL04Z8XXX4 board and suddenly can not connect to the board using my standard routine. Based on some references I have read (How to unlock bricked MCU with J-Link?, Unsecuring the KL25Z Freedom BoardBricked Eval Board after "erase" (NXP Kinetis MK20), Unlocking and Erasing FLASH with Segger J-Link, etc.) there seems to be locking or bricking issue. Using Jlink commander v6.40 none of the suggestions ("unlock kinetis", manually selecting CPU, setting lower SWD speed, e.g. 4kHz: im using ~1m SWD wires!) were useful; below is copy-paste of the sequence:

SEGGER J-Link Commander V6.40 (Compiled Oct 26 2018 15:06:29)
DLL version V6.40, compiled Oct 26 2018 15:06:02

 

Connecting to J-Link via USB...O.K.

 

VTref=2.982V

 

Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. <Default>: MKL04Z8XXX4
Type '?' for selection dialog
Device>
Please specify target interface:
J) JTAG (Default)
S) SWD
T) cJTAG
TIF>S
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>4
Device "MKL04Z8XXX4" selected.


Connecting to target via SWD
InitTarget()
Device will be unsecured now.
Timeout while unsecuring device. Erase never starts.
Found SW-DP with ID 0x0BC11477
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x04770031)
AP[1]: JTAG-AP (IDR: 0x001C0020)
Iterating through AP map to find AHB-AP to use
AP[0]: Skipped. Invalid implementer code read from CPUIDVal[31:24] = 0x00
AP[1]: Skipped. Not an AHB-AP
InitTarget()
Device will be unsecured now.
Timeout while unsecuring device. Erase never starts.
Found SW-DP with ID 0x0BC11477
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x04770031)
AP[1]: JTAG-AP (IDR: 0x001C0020)
Iterating through AP map to find AHB-AP to use
AP[0]: Skipped. Invalid implementer code read from CPUIDVal[31:24] = 0x00
AP[1]: Skipped. Not an AHB-AP

****** Error: Could not find core in Coresight setup
InitTarget()
Device will be unsecured now.
Timeout while unsecuring device. Erase never starts.
Found SW-DP with ID 0x0BC11477
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x04770031)
AP[1]: JTAG-AP (IDR: 0x001C0020)
Iterating through AP map to find AHB-AP to use
AP[0]: Skipped. Invalid implementer code read from CPUIDVal[31:24] = 0x00
AP[1]: Skipped. Not an AHB-AP
InitTarget()
Device will be unsecured now.
Timeout while unsecuring device. Erase never starts.
Found SW-DP with ID 0x0BC11477
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x04770031)
AP[1]: JTAG-AP (IDR: 0x001C0020)
Iterating through AP map to find AHB-AP to use
AP[0]: Skipped. Invalid implementer code read from CPUIDVal[31:24] = 0x00
AP[1]: Skipped. Not an AHB-AP
Cannot connect to target.
J-Link>unlock Kinetis
Found SWD-DP with ID 0x0BC11477
Unlocking device...Timeout while unlocking device.
J-Link>device MKL04Z8XXX4
J-Link>unlock kinetis
Found SWD-DP with ID 0x0BC11477
Unlocking device...Timeout while unlocking device.
J-Link>erase
Target connection not established yet but required for command.
Device "MKL04Z8XXX4" selected.

1) Is my board bricked? If YES: is there any other way to unbrick the IC (using other dedicated HW or interface)?

2) Since I am always working from MCU Expresso IDE (v10.2.0) is there some settings (flags/operation/flash overwrite on specific addresses?) to be careful about during programing/erasing to avoid this situation?

Outcomes