Custom built KL25Z bootloader not responding. Debugging hints?

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

Custom built KL25Z bootloader not responding. Debugging hints?

Jump to solution
724 Views
robertpoor
Senior Contributor I

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):

  1. I compiled the project, using Debug as a target.
  2. Looking at freedom_bootloader.map, I verified that the image ended below 0xa000.  (__etext = 0x79c8).
  3. `$ arm-none-eabi-objcopy freedom_bootloader.elf freedom_bootloader.srec`
  4. Using the Mac finder, I dragged freedom_bootloader.srec to the /Volumes/FRDM-KL25ZJ/ mount point.  This copied the file to the FRDM-KL25Z board via the USB connection.
  5. Pushed the [reset] button.
  6. `blhost --p /dev/cu.usbmodem202 --verbose --debug -- get-property 0x01` printed [5a a6], but then hung.

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

0 Kudos
1 Solution
553 Views
robertpoor
Senior Contributor I

Update 2:

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

View solution in original post

0 Kudos
2 Replies
554 Views
robertpoor
Senior Contributor I

Update 2:

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

0 Kudos
553 Views
robertpoor
Senior Contributor I

Update 1:

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


0 Kudos