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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
1,773 次查看
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.

标签 (1)
0 项奖励
回复
1 解答
1,632 次查看
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 项奖励
回复
2 回复数
1,633 次查看
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 项奖励
回复
1,632 次查看
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 项奖励
回复