Hello,
I am using the Freedom K66 on the demo board. I have the freedom_bootloader running from SDK 2.5.0. I have been trying to load the led_demo_freedom_0000.bin created by IAR Release, but I get the following error. Even though it says it wrote all of the bytes of the app, the led demo app does not work after a reset. I verified that the led_demo app works successfully on the board / K66 when downloaded via MCU Expresso. Please explain how to fix this.
Thanks,
Beth
C:\Work\Beth\Bootloader_Demo>blhost -u -- get-property 1
Inject command 'get-property'
Response status = 0 (0x0) Success.
Response word 1 = 1258424064 (0x4b020700)
Current Version = K2.7.0
C:\Work\Beth\Bootloader_Demo>blhost -u -- get-property 12
Inject command 'get-property'
Response status = 0 (0x0) Success.
Response word 1 = 0 (0x0)
Response word 2 = 49151 (0xbfff)
Response word 3 = 536805376 (0x1fff0000)
Response word 4 = 536820223 (0x1fff39ff)
Reserved Regions =
Region0: 0x0-0xBFFF (48 KB)
Region1: 0x1FFF0000-0x1FFF39FF (14.500 KB)
C:\Work\Beth\Bootloader_Demo>blhost -u -- write-memory 0xC000 led_demo_freedom_0000.bin
Inject command 'write-memory'
Preparing to send 2028 (0x7ec) bytes to the target.
Successful generic response to command 'write-memory'
(1/1)100% Completed!
usbhid: received data phase abort
Response status = 10203 (0x27db) kStatusMemoryCumulativeWrite
Wrote 2028 of 2028 bytes.
Hi Beth,
This is the blhos with usb port result:
So, both blhost and KinetisFlashTool works OK on my side, I also use the newest SDK, that's why I recommend you use my generated .bin file directly.
Please try it again on your side.
If you still have question about it, please kindly let me know.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Kerry,
I have had a chance to try your bootloader.hex file. This sequence of events below is repeatable.
I loaded the Hello World program via MCU Expresso and JLink. Works fine – I see the text get printed. Then I use IAR to download the bootloader.hex file that you sent me.
Tue Jan 22, 2019 14:36:31: Target reset
Tue Jan 22, 2019 14:36:32: Downloaded C:\NXP_Kerry\freedom_bootloader.hex\freedom_bootloader.hex to flash memory.
Tue Jan 22, 2019 14:36:32: IAR Embedded Workbench 8.30.2 (C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.1\arm\bin\armproc.dll)
If I don’t do anything else, but hit the reset button on the development board, the LED Demo app starts running. I didn’t even load the LED.bin file. What is ‘hidden’ in this hex file?
Questions
Why would the LED demo program (alternating blue, red, green) run if I haven’t loaded the .bin file for this demo?
Why can’t the blhost.exe program erase everything? It says it does, but the proof isn’t there from the output you sent.
Hi Beth,
Thank you for your updated information.
Answer your question:
1.Why would the LED demo program (alternating blue, red, green) run if I haven’t loaded the .bin file for this demo?
Do you mean after you download the bootloader, then the LED works automatically?
If yes, this situation should caused you already download the app in the 0XC000 before.
You can try to use : unlock kinetis, in the JLINK commander, then download the the bootloader again, the app can't work now, because no APP.
2.Why can’t the blhost.exe program erase everything? It says it does, but the proof isn’t there from the output you sent.
You need to use the erase command in the blhost, it won't do it automatically.
Wish it helps you!
If you still have question about it, please kindly let me know.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Beth,
What the bootloader you are using now?
As you know, the K66 don't have the ROM bootloader, so you need to use the flash bootloader, you can use the freedom_bootloader in this folder:
SDK_2.5.0_FRDM-K66F\boards\frdmk66f\bootloader_examples\freedom_bootloader
Now, please note, this project default relocated address is 0XA000, if you want to relocate to 0XC000, please modify the bootloader_config.h
#define BL_APP_VECTOR_TABLE_ADDRESS 0xc000
Then, this bootloader will relocate the app to 0XC000.
You can build and download this bootloader to your K66 at first.
Now, you can use the blhost or kinetisflash tool to download your app code.
Before you download you app, you need to modify your app, and relocate it to 0XC000, you can use this project:
SDK_2.5.0_FRDM-K66F\boards\frdmk66f\bootloader_examples\demo_apps\led_demo_freedom_a000
Then generate the .bin or .hex code, use the blhost or kinetisflash tool to download it.
This is my test result:
You can find my test result, no errors, it works ok on my board!
I also attach my bootloader and app code for your reference. All relocate to 0XC000.
Wish it helps you!
If you still have question about it, please kindly let me know.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Kerry,
Thank-you for your reply. I am still not able to get the led demo app to download. I also found some other problems with blhost documented below. Thank-you for your assistance.
Beth
-------------------------------------------------------------------------------------------------------------------------------------------------------
I had originally tried sending the app to address 0xA000, but would receive the error of 'kStatusMemoryRangeInvalid'. I am running the freedom bootloader as you mentioned on the demo board.
Hi Beth Altshuler,
Do you try the kinetis flash tool like me?
Whether that tool also have problems?
BTW, please also tell me, where you get the blhost, the newest SDK kboot package?
Please tell me the details, then I will help you to test the blhost on my side.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Kerry,
Here are the versions I am using and the date the SDK was built with the mcu-boot option.
I can run the KFT, it says it works, but even after resetting, hard by me, to board, LED is still not blinking. Similar to blhost -- it thinks it works, but it isn't. I have loaded the app separately via MCU Expresso and it works just fine.
Please let me know if you need any other information.
Thank-you,
Beth
Hi Beth,
Please use the my bootloader code and the app code which located to 0XC000, that works OK on my side with KFT, after reset, you need to wait about 5 seconds, then the led will blink.
1. Download freedom_bootloader.hex.zip to your K66 chip, this is the bootloader code.
2. Press the reset button, then use the KFT to connect your K66 chip with uart, and download the my app:
This code works OK on my side, please try my generated files.
Whether it works OK on your side or not?
If it still can't work, please check your NMI pin, whether it is high during reset?
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Kerry,
I can try your files, but what revisions are they from?
It doesn't look like my screenshots came through on my previous posting. I downloaded KDS 3.2.0 and SDK2.5 on Dec 18, 2018. It didn't matter whether I used blhost or the Flash Tool, both 'think' that they work, but do not.
I would like to know why the version that I downloaded in December does not work? Using some previous version (unknown) when bugs exist in newer versions is not helpful.
Thanks,
Beth Altshuler
Hi Beth Altshuler,
I also use the SDK2.5 version, you can check my first reply:
SDK_2.5.0_FRDM-K66F\boards\frdmk66f\bootloader_examples\freedom_bootloader
But, just as I have told you, I didn't relocated to flash address 0XA000, I am using the IAR project, you can check my first reply picture, I relocate the app address to 0XC000, because I find after build, the bootloader size already larger than 0XA000, but small than 0xc000, that's why I suggest you also relocated to 0XC000, and try my generated files.
Please test my generated code first, I also use the SDK2.5, then same as you, my generated code works OK on my frdm-k66 board with KinetisFlashTool.
After you try my generated code, tell me the test result.
You said you are using KDS, but in the SDK generated tool, the toolchian IDE don't have the KDS version, how you generate it? Maybe you need to use the MCUXrpesso IDE instead of the KDS:
If your FRDM-K66 board on board debugger is using the JLINK firmware, you can use the JLINK commander to do the mass erase at first, then just follow my way to test my generated code, after make your board works, then we can check more details:
1. Change the opensda firmware to JLINK firmware, please check this link:
2. use JLINK commander(find in the JLINK driver) to do the mass erase: unlock kinetis
3. Send my file:freedom_bootloader.hex to the FRDM-K66FJ
4, Then open the kinetis flash tool, also use my led_demo_freedom_c000.bin
After updated it, wait about 5 seconds, the led will blink.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Kerry,
I wasn't able to get to it today. Hopefully, tomorrow. Could you also send the blhost program from your package?
Thanks,
Beth
Hi Beth Altshuler,
This is the blhost using the com test result:
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello,
I am using K66, not K82.
Beth
Hi Beth,
Sorry, it's just mistyping, I have tested the K66, you can check my first reply:
SDK_2.5.0_FRDM-K66F\boards\frdmk66f\bootloader_examples\freedom_bootloader
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------