KBOOT does not work with led_demo_a000

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

KBOOT does not work with led_demo_a000

Jump to solution
2,441 Views
roymessinger
Contributor V

I've tried with several FRDM K64 boards, all brand new. I'm working with J26, open-sda communication of MBED (or using Segger plus with Jlink bootloader). 

I succeed to connect via BLHOST or the KinetisFlashTool. I succeed to read/write/erase. All is well.

But after I flash the led_demo_a000 - nothing blinks. 

The freedom_bootloader is in release mode. I've changed nothing in the code. Just opened the KBOOT zip and compiled.

I've followed the 'Kinetis Bootloader Demo Application User's Guide' and the example shown in 'Kinetis blhost User's Guide.pdf' step by step, either by placing the bin/sb in the MBED driver or by debugging the release version of the freedom_bootloader. It does not jump to application and stays in bootloader. Nothing blinks.

What am I missing here?

1 Solution
1,861 Views
roymessinger
Contributor V

Ok, I've found the bug. Both checkboxes of 'Section' (.text and .data) should not be checked. I did not notice. When un-checked, this fixes all.

View solution in original post

0 Kudos
12 Replies
1,862 Views
roymessinger
Contributor V

Ok, I've found the bug. Both checkboxes of 'Section' (.text and .data) should not be checked. I did not notice. When un-checked, this fixes all.

0 Kudos
1,861 Views
davenadler
Senior Contributor I

Glad you found the problem!

Where are the checkboxes you've mentioned???

0 Kudos
1,861 Views
roymessinger
Contributor V

1.png

0 Kudos
1,862 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Follow the 'Kinetis Bootloader Demo Application User's Guide'.

first step:

3.1.1 Install the Kinetis bootloader

3.1.1 Install the Kinetis bootloader.jpg

second step:

5.1 Installing the user application(build and generated by IAR)

5.1 Installing the user application.jpg

You can also use the led_demo_freedom_a000.bin file in C:\NXP_Kinetis_Bootloader_2_0_0\apps\led_demo\MK64F12\iar\binaries

led_demo apps.jpg

Best Regards,

Robin

 

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

0 Kudos
1,862 Views
roymessinger
Contributor V

Thanks novice

I found the bug but cannot explain. It seems that the led_demo_freedom_a000.bin file created by KDS is smaller than it should be. I tested in 4 different computers (in all KDS version 3.2.0 is installed). In 3 of them the size of the bin file is 2KB, and the bootloader does not jump to application. In the forth computer the bin file created is 3KB in size and the bootloader jumps to application.

I have no idea what can cause such difference. I've tried to compare all I could think of (source files, linker file, map file, flags in the setting window) but all seems exactly the same. the Kboot directory file/folder are exactly the same either.

I've attached both files. 

What can cause such difference?

Dropbox - led_demo_freedom_a000-Working.bin 

Dropbox - led_demo_freedom_a000-NotWorking.bin 

1,862 Views
jay_heng
NXP Employee
NXP Employee

You can check the .map file to see the difference

0 Kudos
1,862 Views
roymessinger
Contributor V

I've checked. Both are the same.

0 Kudos
1,862 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Please read the "Generate aligned HEX and S-record data output with GNU in KDS 3.2" generate binary file.
These two binary files are different, see the image shown below:

compare.jpg

0 Kudos
1,862 Views
roymessinger
Contributor V

Thanks, novice

This link is for generating aligned Hex and S-record file from ELF file. I need bin files for using KBOOT Blhost.exe (the 2 attached files are bin...).

I know the files are different. I've compared them too. I do not know the cause for that.

0 Kudos
1,862 Views
davenadler
Senior Contributor I

First, do review this post: Bootloader MSC does not work, ELFTOSB source does not build 

I provided corrected sources that include (gasp) diagnostic logging into the virtual disk for easy debugging if you're using USB drag-and-drop.

IIRC there are some gotchas:

  1. make SURE base address for blinky is same as bootloader expects
  2. blinky cannot be built in debug mode
  3. bootloader does not support BIN format,  only SB - make sure you use SB.
  4. IIRC last line of control file for ELFTOSB (which of course fails to work with ELF format) must be instruction for bootloader to jump to application. For some reason jump fails to work properly; use reset; instead.

KinetisFlashTool confirms image is flashed correctly?

Hope that helps,
Best Regards, Dave

0 Kudos
1,861 Views
roymessinger
Contributor V

Hi Dave,

Thanks for the reply.

1. I know. I've tried that with blhost.exe and KinetisFlashTool. No success.

2. Tried that.

3. I'm working with BIN, not with SB. KBOOT should support that, AFAIK.

4. I work with blshost, not with ELFTOSB.

Furthermore, I've tried using KBOOT with UART4 (using USB to RS485 cable connected to RS485 to TTL, and from there to J199 towards UART4 of FRDM) - but no success. Exactly the same behavior.

Roy

1,861 Views
jay_heng
NXP Employee
NXP Employee

1. Try to read back the data from 0xa000 (by blhost: read-memory 0xa000 0x10) to confirm that the binary has been programmed successfully.

2. After the binary is properly programmed, a soft reset is needed, if everything is ok, bootloader will boot led demo after 5s.

3. Check the boot pin - PTC6 in your board, if it is always low, thne bootloader will never boot image.

4. Try to debug the bootloader project and step to jump_to_application() in bl_main.c to see what is really going on.