Kinetis Bootloader - How to build from sources?

cancel
Showing results for 
Search instead for 
Did you mean: 

Kinetis Bootloader - How to build from sources?

1,922 Views
curiosul
Contributor III

Hello,

I have the following MCU: S9KEAZN64AMLH (KEA Family - ARM® Cortex®-M0+)

Given bootloader package NXP_Kinetis_Bootloader_1.2.0 for KS22 package from MCU Bootloader|NXP, I want to change some settings in the source code of that bootloader, build and upload binary file to MCU.

I have downloaded the package and I have imported the project into CodeWarrior workspace.

After project import, there a some things I don't understand:

 img.png

1. Why are there three projects instead of one?

2. What are the configurations I have to make in order to be able to generate final bootloader image (probably .bin) which shall be uploaded on MCU?

PS: Is there any other IDE recommended for this or CodeWarrior should be fine?

Labels (1)
0 Kudos
6 Replies

778 Views
jeremyanderson
Contributor III

I opened the same set of projects presuming that there is no harm in doing so.  I see from the above remarks that I'd need to compile the flashloader project anyway.  Now I cannot get the flashloader_loader project to compile.  The flashloader project does not seem to do anything when I compile it, but the flashloader_loader project reports that it cannot find a file:
Description Resource Path Location Type
fatal error: release/flashloader_image.c: No such file or directory bl_flashloader.c /flashloader_loader/src/bootloader/src line 40 C/C++ Problem

I looked at the batch file which I think is supposed to create this file and it invokes a Python script, but the path looks wrong.  When I change it though, no difference.  Any ideas?

The shortest answer for me would be what directory to import as a project.

0 Kudos

778 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Jeremy,

When you compiled flashloader, did you see "Error while running cmd /c C:\work\bootloader\FSL_Kinetis_Bootloader_1_2_0_KS22_1_0_0\targets\MKS22F25612\iar\flashloader\..\..\..\..\bin\create_flashloader_image.bat C:\work\bootloader\ ........"

If yes, this is may because create_fl_image.py was written in python2, and you installed python3. Syntax error will happen when execute the file.

778 Views
jeremyanderson
Contributor III

Thank you Jing Pan for this advice.  I had several other problems to solve first.  The .cproject for the MK66 was missing a parent class definition.  Once I got that fixed I was able to go through the project properties and get things mostly right, but still encountered problems building the image.  I changed the script that invokes python by changing "python" to "py -2.7".  Now the whole thing builds (mostly) just fine.  Still fighting through a post build thing, but I am getting an image built.

0 Kudos

778 Views
jeremyanderson
Contributor III

Thanks for the reply Jing.  I'm working with NXP_Kinetis_Bootloader_2_0_0 because this release has support for the MK66.  When I import the flashloader project and open the properties, I see that there are no values on the C/C++ Tool Settings page, so there is no path to any tools for building he project.  I suspect I'll have to reread the porting guide.  I tried importing the K64 project from FSL_Kinetis_Bootloader_1_2_0 and that builds.

0 Kudos

778 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Alex,

The three project has different usage

 flashloader: This subproject is the core of project. This subproject is laid in RAM. Because when implementing flash operation, code must be laid in RAM. When boot up, flashloader_loader/tower_bootloader copys flashloader's image to ram.
 flashloader_loader: If you don't want to keep bootloader after download application, you can use this subproject. This code is laid in flash address0, and can be covered when download application. It need flashloader to be pre-compile. 
tower_bootloader: If you want to keep bootloader after download application, you should use this subproject. You application should locate at 0xa000;

In fact, bootloader is default build in IAR/KEIL/KDS.

Regards,

Jing

0 Kudos

778 Views
curiosul
Contributor III

Thanks! I finally managed to open that project correctly using KDS!

0 Kudos