specific questions regarding KBOOT and K64

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

specific questions regarding KBOOT and K64

1,601 Views
roymessinger
Contributor V

I'm designing a board with K64 (no K20 open sda), based on the FRDM K64 board. I have a few questions regarding KBOOT and K64:

 

1. In the KBOOT folder of NXP there are few loaders (flashloader, flashloader_loader and freedom_loader). I did not understand what is the difference between them. I read the KBOOT Release notes and still didn't understand what does flashloader do and what does flashloader_loader do. It was written the flashloader_loader loads the flashloader image file (is that true?), but I want to load my own user app, so what do I use? Which loader project should I use out of the 3 loader project in the KBOOT folder in such case?

 

2. Even though I now work on the FRDM K64 board, I'm waiting for my own board, and as such, I want to use the more general bootloader (not flashloader, by the way), so in this case, I guess I should not user the Freedom_Loader, right?

 

3.  In the FRDM board I connected an RS485 to UART module to J199, so I use J199 as another UART (UART4). That is why I want a more general bootloader. How do I change the UART number in the loader project you pointed out in Q1 to UART4?

 

4. I already have a ready user application, so I intend to burn the ELF of the loader project to the board (using Jlink Segger I own) and then, thru UART4 and using the KinetisFlashTool or BLHost load the bin (or elf?) user application to the correct place in the flash (0xa000 or 0x000?). Is that following process true?
 
5. I currently tried all this with the flashloader_loader project. Since I have 2 COM's opened (UART0 of the openSDA and UART4 of the J199) I tried connecting with the KinetisFlashTool to UART4 (which is COM6 in my case), I did not succeed. I could connect to UART4, but as I've explained, I do not want to work with the openSDA, but with a different UART (since I have a custom board).

 

 

Thank you very much,

Labels (1)
5 Replies

919 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi roymessinger,

  Thank you for your new post, next time if you have new question, just post it out, instead of sending me in the message, thank you! We will help you in your post.

1. In the KBOOT folder of NXP there are few loaders (flashloader, flashloader_loader and freedom_loader). I did not understand what is the difference between them. I read the KBOOT Release notes and still didn't understand what does flashloader do and what does flashloader_loader do. It was written the flashloader_loader loads the flashloader image file (is that true?), but I want to load my own user app, so what do I use? Which loader project should I use out of the 3 loader project in the KBOOT folder in such case?

 Answer:  flashloader and flashloader_loader is just one times bootloader, after you update the application code, the bootloader will be disappear.  Because when you want to update the application code, this bootloader will copy the flashloader to RAM, then receive the application code and write it to the flash.

Freedom_loader will always in the flash after you upload your application code. the freedom_loader will in the flash address0x00, the application code is defined from 0xa000, you need to relocate your app code to 0xa000 when you generated it.

So, I suggest you to use freedom_loader.

You just need to download the freedom_loader to your freedom board, then generate an app code, and relocate it to 0xa000 by moidfing the link file. then use the blhost or the KinetisFlashTool to download the app with freedom_loader.

2. Even though I now work on the FRDM K64 board, I'm waiting for my own board, and as such, I want to use the more general bootloader (not flashloader, by the way), so in this case, I guess I should not user the Freedom_Loader, right?

  Answer:   yes, you are so clever! Choose freedom_loader, please refer to item1.

3.  In the FRDM board I connected an RS485 to UART module to J199, so I use J199 as another UART (UART4). That is why I want a more general bootloader. How do I change the UART number in the loader project you pointed out in Q1 to UART4?

   Answer:   If you want to change the uart port in the freedom_flashloader, two points need to take care:

  (1) change the uart port to uart4.

  (2) change uart pin to the uart4 according pin, include the mux.

  You can search the whole flashloader project, then change the uart configuration to uart4.

4. I already have a ready user application, so I intend to burn the ELF of the loader project to the board (using Jlink Segger I own) and then, thru UART4 and using the KinetisFlashTool or BLHost load the bin (or elf?) user application to the correct place in the flash (0xa000 or 0x000?). Is that following process true?
 Answer: I suggest you test your user application code without the flash loader at first, if the function is correct, then relocate the app to address 0xa000, and test with your moidfied uart4 bootloader.
5. I currently tried all this with the flashloader_loader project. Since I have 2 COM's opened (UART0 of the openSDA and UART4 of the J199) I tried connecting with the KinetisFlashTool to UART4 (which is COM6 in my case), I did not succeed. I could connect to UART4, but as I've explained, I do not want to work with the openSDA, but with a different UART (since I have a custom board).

 Answer: The default freedom flashloader is using uart0, PTA14 and PTA15, you can try the original bootloader, when it works, then change the uart to your uart4.

Wish it helps you!

If you still have question, please let me know!


Have a great day,
Kerry

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

0 Kudos

919 Views
roymessinger
Contributor V

kerryzhou‌, thank you very much for your answers.

Per your recommendation, I've first tried loading (using SEGGER) the hex file of freedom_loader (with original settings, UART 0, Baud of 19200, etc.). It works well, meaning, the KinetisFlashTool succeeds to connect to UART0.

Now, I try to load the bin of my application:

1. Where do I change in the *.ld linker file the address from 0x000 to 0x8000?

2. When I load my app file to the GUI, I get this error:

pastedImage_1.png

3. I guess the fact that the target address is greyed out at 0x000 is because I did not change the start address to 0x8000?

4. what is the meaning of kStatusMemoryRangeInvalid means?

Thanks!

Roy

0 Kudos

919 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi roymessinger,

   Sorry for my misleading, the relocate address in K64 flash bootloader is 0xa000, not 0x8000. My memory mistake.

You can find it from the freedom_flashloader:

pastedImage_1.png

So you need to modify the app to 0xa000;

You can use the kboot attached app to test it:

\NXP_Kinetis_Bootloader_2_0_0\apps\led_demo\MK64F12\iar\binaries\led_demo_freedom_a000.bin

Then update it again:

pastedImage_2.png

About how to relocate the vector, you can refer to

for KDS, you can refer to NXP_Kinetis_Bootloader_2_0_0\apps\led_demo\MK64F12 project, there has the according 0xa000 APP project.

My colleague Jorge_Gonzalez also recommended you the KDS project relocate document.

Beside, I also find there has a document about K64 kboot, just for your reference:

Kinetis Bootloader for FRDM-K64 

Wish it helps you!

Have a great day,
Kerry

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

0 Kudos

918 Views
roymessinger
Contributor V

kerryzhou‌, @Jorge_Gonzalez 

I did exactly as Jorge have written in his pdf (didn't add the BCA as it was optional in the PDF).

I tried taking the led_demo_freedom_a000.bin under:

NXP_Kinetis_Bootloader_2_0_0\apps\led_demo\MK64F12\kds\led_demo_freedom_a000\debug

and I'm getting this error:

pastedImage_11.png

(as I've wrote earlier, I burned the freedom_loader without changing anything).

Ok, so here is an update for anyone who stumble upon this error:

According to this link, the freedom_bootloader should be built in Release and not in Debug (that way the bootloader size will be smaller that 0xA000), that way it is working well.

919 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Roy Messinger,

The "Target Address" setting can be grayed out if you select an S-Record file and not a raw binary file. This is because the .srec file already has addressing information, while the .bin file needs a base address to start loading the data.

About changing the offset address of your application in KDS, please check the next document:

https://community.nxp.com/docs/DOC-256669 

Let us know if you have further questions.

Regards!

Jorge Gonzalez

0 Kudos