Hi,
I tried to compile flashloader project for MK66F18 MCU.
When I use IAR as the compiler, it works fine.
I can get flashloader.elf and flashloader.bin, flashloader_image.c after phyton conversion.
When I use KDS Version: 3.2.0 as the compiler, it doesn't work.
I got below error in the KDS
C:\Freescale\NXP_Kinetis_Bootloader_2_0_0\NXP_Kinetis_Bootloader_2_0_0\targets\MK66F18\kds\flashloader\release>python ..\..\..\..\..\bin\create_fl_image_kds.py flashloader.elf flashloader.bin flashloader_image.c
cannot process file flashloader.elf
I noticed that the flashloader.elf built by IAR has 1088KBytes in size, but the flashloader.elf built by KDS only has 5KB.
But I didn't get any compiling error from KDS other than python error.
Is there something wrong with the KDS project????
解決済! 解決策の投稿を見る。
Hi Yin Yang,
1. USB-HID
Did you use the flashloader_loader? Take care, this file is the once used bootloader.
After you use the UART bootloader to download the app, then you want to use the USB-HID, you need to download teh flashloader_loader to your FRDM-K66 board again.
So, please download it to your board again.
Now, you need to two USB cables, one is connected to J26, another is connected to J22.
Press the on board reset button, then click connect in the kinetisflashtool
You can find the device is connected to device successfully.
Now click update, take care, choose the led_demo_freedom_0000.bin file
The picture means the app is successfully downloaded to your board, and you will find it works.
2 USB MSC
Yes, the kboot2.0 can support the MSC bootloader, you can drag the app .sb files to the MSC device.
More details, please read one of our post at first:
USB MSD Bootloader Implementation
The above post is using the freedom-flashloader, if you still want to use the once used flashloader_loader, the same way, download the flashloader_loader to your board at first.
Plug to USB cables to your board, you will find you can find a device named as FSL Loader, this is the USB MSC device.
take led_demo_freedom_0000.bin as an example.
(1) modify the .bd file, you can write it like this:
FRDM-K66_0000.bd is used for the led_demo_freedom_0000.bin file.
FRDM-K66_a000.bd is used for the led_demo_freedom_a000.bin file, which is relocate to 0xa000.
I will attached all the according files to you, you can put it to your NXP_Kinetis_Bootloader_2_0_0\bin\Tools\elftosb\win, just for generate the according SB files.
(2) generate SB files
Still take led_demo_freedom_0000.bin, FRDM-K66_0000.bd as an example.
open elftosb, and input :elftosb –V –c FRDM-K64F_0000.bd –o led_0000.sb
You will get led_0000.sb, then send led_0000.sb to your "FSL Loader" device.
Now you will find the led is blinking on your board.
Please try it on your side.
I also attached my generated .sb files.
image.sb is used for led_demo_freedom_a000.bin.
led_0000.sb is used for led_demo_freedom_0000.bin files.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Yin Yang,
I have build the flashloader, flashloader_loader, freedom_bootloader in the KDS3.2, no error happens on my side.
So, could you give me some error pictures on you side?
Please take care, when you open the KDS workspace, please put it in this path:NXP_Kinetis_Bootloader_2_0_0
You can't put the workspace path to the project path directly.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Kerry
Attached the picture for the compile errors.
As I mentioned earlier, the main problem is the the flashloader.elf after KDS compile only 5KB which seems not correct as the IAR compile results is 1088KBytes.
Hi Yin Yang,
Please follow me to get the FRD-K66 working with flashloader and flashloader_loader, take care, this flash bootloader is once used, this code also will put in the new chip when out of the factory.
1. Define the FREEDOM board,
In default, the code is using PTE24 and PTE25, but the FREEDOM is using PTB16 and PTB17 as the UART pin.
Choose flashloader, right click, property.
Then build the flashloader, and flashloadloader again. Download the flashload_loader to your FRDM_K66 board.
2. open KinetisFlashTool in folder:NXP_Kinetis_Bootloader_2_0_0\bin\Tools\KinetisFlashTool\win
After click connect, the log will display successfully.
Click Update
you will find the app code is working, the led is blinking.
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Kerry
Thanks for the reply, I followed your steps and it works fine with the UART interface. (connect to J26).
While if I try to connect the USB-HID interface, it fails. I tried both J26 (openSDA port) and J22 (K66 USB port).
Furthermore, what I really want is the similar to openSDA bootloader. By connecting the K66 USB port, the bootloader emulate as the MSD and customer can drop the app image directly into it. Can this function be released by KBOOT 2.0 and how to do it?
Hi Yin Yang,
1. USB-HID
Did you use the flashloader_loader? Take care, this file is the once used bootloader.
After you use the UART bootloader to download the app, then you want to use the USB-HID, you need to download teh flashloader_loader to your FRDM-K66 board again.
So, please download it to your board again.
Now, you need to two USB cables, one is connected to J26, another is connected to J22.
Press the on board reset button, then click connect in the kinetisflashtool
You can find the device is connected to device successfully.
Now click update, take care, choose the led_demo_freedom_0000.bin file
The picture means the app is successfully downloaded to your board, and you will find it works.
2 USB MSC
Yes, the kboot2.0 can support the MSC bootloader, you can drag the app .sb files to the MSC device.
More details, please read one of our post at first:
USB MSD Bootloader Implementation
The above post is using the freedom-flashloader, if you still want to use the once used flashloader_loader, the same way, download the flashloader_loader to your board at first.
Plug to USB cables to your board, you will find you can find a device named as FSL Loader, this is the USB MSC device.
take led_demo_freedom_0000.bin as an example.
(1) modify the .bd file, you can write it like this:
FRDM-K66_0000.bd is used for the led_demo_freedom_0000.bin file.
FRDM-K66_a000.bd is used for the led_demo_freedom_a000.bin file, which is relocate to 0xa000.
I will attached all the according files to you, you can put it to your NXP_Kinetis_Bootloader_2_0_0\bin\Tools\elftosb\win, just for generate the according SB files.
(2) generate SB files
Still take led_demo_freedom_0000.bin, FRDM-K66_0000.bd as an example.
open elftosb, and input :elftosb –V –c FRDM-K64F_0000.bd –o led_0000.sb
You will get led_0000.sb, then send led_0000.sb to your "FSL Loader" device.
Now you will find the led is blinking on your board.
Please try it on your side.
I also attached my generated .sb files.
image.sb is used for led_demo_freedom_a000.bin.
led_0000.sb is used for led_demo_freedom_0000.bin files.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Kerry
All cleared, thanks for the support.
Hi Yin Yang,
Just as what we have talked before, unzip a new bootloader, open it again and build it.
After it have no errors, download to your board and check the function.
About the code size, I think it is relate to the IDE. Please the code function on your side at first.
Any problem of function, just let me know!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------