How to unlock and mass erase MK20DX128 with Jlink?

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

How to unlock and mass erase MK20DX128 with Jlink?

871 Views
chris_seto
Contributor I

Hi,

I have a Jlink on Widnows, with JFlash.

How do I unlock and mass erase this chip? I don't see project files for it anywhere in JFlash.

Additionally, is there any way to interact with the chip using OpenOCd on Linux? I can flash the chip using the following instructions to patch OpenOCD, but none of the Kinetis commands work. Any idea why?

  • cd ~
  • git clone git://git.code.sf.net/p/openocd/code openocd
  • cd openocd
  • git checkout bbdb820c82d65cd11abdc329eaa91d410690436e
  • git fetch http://openocd.zylin.com/openocd refs/changes/08/1508/1 && git checkout FETCH_HEAD
  • ./bootstrap
  • ./configure --enable-jlink
  • make CFLAGS='-Wno-format-overflow'
  • sudo make install
  • /usr/local/bin/openocd -f ./openocd.cfg -c "program app-image.hex reset"

OpenOCD cfg:

source [find interface/jlink.cfg]
# Freescale Kinetis K20 device. Should be compatible with K40,
# just set a custom name.
set CHIPNAME k20
source [find target/k40.cfg]

adapter_khz 1000
reset_config srst_only

# Scratch RAM for verify
# XXX: This verify method is broken due to a problem with reset?
k20.cpu configure -work-area-phys 0x1FFFE000 -work-area-size 16384

# One 128K flash bank
flash bank pflash.0 kinetis 0x00000000 0x20000 0 4 $_TARGETNAME

0 Kudos
2 Replies

728 Views
chris_seto
Contributor I

Evidently, this is how: 

My question still goes for Linux, though. How can I use the Jlink with OpenOCD to work with this K20?

pastedImage_1.png

0 Kudos

728 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Chris Seto,

   So your question is mainly in linux, not the windows, is it right? From your picture, you already can unlock the kinetis chip.

   If yes, you can check it with segger JLINK, how to operate it in the linux, they will give you the detail information.

   You can find the Segger JLINK support from this link:

   Ticket | SEGGER - The Embedded Experts 

Wish it helps you!


Have a great day,
Kerry

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos