What is the NXP recommended way to unlock and flash a K20 in Linux with jlink

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

What is the NXP recommended way to unlock and flash a K20 in Linux with jlink

Jump to solution
1,412 Views
chris_seto
Contributor I

I'm trying to simply mass erase and load code on my Kinetis mk20dx128vlf5. I'm trying to use OpenOCD and Jlink in Linux, but it seems like there is no real support for the k20, and I'm still having issues with trying to mass erase the chip. 

What is the NXP recommended way to mass erase and program the chip in Linux? I don't care about this chip's "security features" or the entire "secured state" mess. All I want to do is erase what's currently on the chip and flash new content. I don't understand why someone would ever design a microcontroller to work this way. It seems remarkably counter productive for 95% of use cases.

Labels (1)
0 Kudos
1 Solution
1,271 Views
BlackNight
NXP Employee
NXP Employee

The standard way would be to use the MCUXpresso IDE and use the GUI Flash tool to erase, program and recover the device if needed.

pastedImage_1.png

But this basically requires the that device is supported by the NXP MCUXpresso SDK, and the 50 MHz K20DX128 is not.

The legacy devices are supported with the NXP Kinetis Design Studio V3.2.0. In KDS you have the 'Flash from File' functionality:

pastedImage_2.png

which you can use to program a file to the target.

OpenOCD does not support the Kinetis devices well, so I recommend you go with the LinkServer (LPC-Link2, but this is not supported in KDS), or with a P&E or SEGGER debug probe (which you already have).

If you want to do things on the command line, I wrote a few tutorials on this:

Command Line Programming and Debugging with GDB | MCU on Eclipse 

Tutorial: MCUXpresso SDK with Linux, Part 2: Commandline Debugging with GDB | MCU on Eclipse 

If it is about unlocking a device, there is as well the way to use the J-Link commander, have a read at

Unlocking and Erasing FLASH with Segger J-Link | MCU on Eclipse 

I hope this helps,

Erich

View solution in original post

0 Kudos
2 Replies
1,272 Views
BlackNight
NXP Employee
NXP Employee

The standard way would be to use the MCUXpresso IDE and use the GUI Flash tool to erase, program and recover the device if needed.

pastedImage_1.png

But this basically requires the that device is supported by the NXP MCUXpresso SDK, and the 50 MHz K20DX128 is not.

The legacy devices are supported with the NXP Kinetis Design Studio V3.2.0. In KDS you have the 'Flash from File' functionality:

pastedImage_2.png

which you can use to program a file to the target.

OpenOCD does not support the Kinetis devices well, so I recommend you go with the LinkServer (LPC-Link2, but this is not supported in KDS), or with a P&E or SEGGER debug probe (which you already have).

If you want to do things on the command line, I wrote a few tutorials on this:

Command Line Programming and Debugging with GDB | MCU on Eclipse 

Tutorial: MCUXpresso SDK with Linux, Part 2: Commandline Debugging with GDB | MCU on Eclipse 

If it is about unlocking a device, there is as well the way to use the J-Link commander, have a read at

Unlocking and Erasing FLASH with Segger J-Link | MCU on Eclipse 

I hope this helps,

Erich

0 Kudos
1,271 Views
chris_seto
Contributor I

Hi Erich,

Thanks for the detailed post! This did work with JLink commander. Do you know any quick way of flashing a hex with JLink commander, rather than having to convert to a bin and specify a starting address?

0 Kudos