Following guidance from Erich Styger, I have cloned a copy of <ProjectDir>/NXP_Kinetis_Bootloader_2_0_0/targets/MKL25Z4/kds/freedom_bootloader. Just for testing purposes, I made a single change: I bumped the version number to "K2.0.1" from "K.2.0.0". It compiles without error, but I'm unable to load and run it.
Here is a link to the project.
Here's a synopsis of what I did (and what happened):
The question: Any idea why it's not running? Or can you suggest steps I could take to debug this? (I do have a Segger JLINK and a JTAG connector soldered to the FRDM-KL25Z board.)
Some other notes:
I previously successfully loaded precompiled KL25Z bootloader by dragging it to /Volumes/FRDM-KL25ZJ/ mount point. I then used blhost to erase flash and load the precompiled led-demo-8000 at 0x8000. It ran without trouble.
Thanks in advance!
- Robert Poor
Solved! Go to Solution.
I compiled the project for the Release target. And though I can get it to start up via the KDS_v3 / Segger J-Link and respond to the blhost get-property command, it didn't start up on it own.
Then I had the bright idea of disconnecting the JTAG connector.
And it now works. So to make a custom bootloader work, make sure that you:
* Compile for the Release target
* Disconnect the JTAG connector
I compiled the project for the Release target. And though I can get it to start up via the KDS_v3 / Segger J-Link and respond to the blhost get-property command, it didn't start up on it own.
Then I had the bright idea of disconnecting the JTAG connector.
And it now works. So to make a custom bootloader work, make sure that you:
* Compile for the Release target
* Disconnect the JTAG connector
Partial solution.
I compiled the bootloader for the Debug target, and it appeared to be waiting for the J-Link for a start command: When launched the bootloader with KDS_v3 and the Segger J-Link, started it running, and *then* launched blhost, it worked without error:
$ blhost --p /dev/cu.usbmodem204,57600 --verbose --debug -- get-property 0x01 [5a a6] <5a> Ping responded in 1 attempt(s) <a7> <00 02 01 50 00 00 aa ea> Framing protocol version = 0x50010200, options = 0x0 Inject command 'get-property' [5a a4 0c 00 4b 33 07 00 00 02 01 00 00 00 00 00 00 00] <5a> <a1> <5a> <a4> <0c 00> <e0 59> <a7 00 00 02 00 00 00 00 01 00 02 4b> Successful response to command 'get-property(current-version)' - took 0.000 seconds [5a a1] Response status = 0 (0x0) Success. Response word 1 = 1258422273 (0x4b020001) Current Version = K2.0.1