Error building projects in Kinetis Bootloader V2

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

Error building projects in Kinetis Bootloader V2

1,440 Views
srinivasa_raow
Contributor I

Hi,

I am trying to compile projects from NXP_Kinetis_Bootloader_2_0_0. 

 

Imported projects from

 

“\NXP_Kinetis_Bootloader_2_0_0\targets\MK22F12810\kds\

 

to the Kinetis Design Studio and noticing that there are three projects under every target board:

 

  1. Flashloader
  2. Flashloader_loader
  3. Tower_bootloader

 

Upon doing clean and Build all, there is error for “Flashloader” and “Flashloader_loader”. 

Tower_bootloader is good and output file is being generated.

 

I have captured the error below. 

 

fatal error: release/flashloader_image.c: No such file or directory            

make: *** [src/bootloader/src/bl_flashloader.o] Error 1              

make: Target 'all' not remade because of errors.              

recipe for target 'post-build' failed           makefile             

recipe for target 'src/bootloader/src/bl_flashloader.o' failed      

 

Tried to compile the same projects in IAR.  I am getting the same error as above.

 

Please find the screenshot attached. 

Labels (1)
0 Kudos
4 Replies

891 Views
srinivasa_raow
Contributor I

I think I have move one step ahead. I have not installed python. Now I have installed python V2.7.


Upon compiling the code again, I have below observation:

Under project settings, post build command is as below:
cmd /c $PROJ_DIR$\..\..\..\..\bin\create_flashloader_image.bat $PROJ_DIR$ Debug


create_flashloader_image.bat (C:\Bootloader\NXP_Kinetis_Bootloader_2_0_0\bin) has below lines of code as below:

1. rem Pass in full path and Release|Debug to iar project directory
2. cd /d %1
3. ielftool --bin output\%2\flashloader.elf flashloader.bin
4. python ..\..\..\..\bin\create_fl_image.py output\%2\flashloader.elf flashloader.bin output\%2\flashloader_image.c

Line 4 of this file is giving me the error. If I comment it, build is success but purpose is not served.

I think line 4 is creating a debug folder and adding some files to it and this is input for flashloader_loader project.

Please find screenshot of the error attached.

python_script_error.png

Any hint is appreciated.

Regards

Srinivasa

0 Kudos

891 Views
srinivasa_raow
Contributor I

Basically "create_fl_image.py" file is trying to create a file "debug/flashloader_image.c" and its usage is below:

# usage: create_fl_image.py <elffile> <binfile> <cfile>

I have added the python insllation path to environment variables

Replaced relative path with absolute path as below:


python C:\Bootloader\NXP_Kinetis_Bootloader_2_0_0\bin\create_fl_image.py C:\Bootloader\NXP_Kinetis_Bootloader_2_0_0\targets\MK22F12810\iar\flashloader\output\Debug\flashloader.elf C:\Bootloader\NXP_Kinetis_Bootloader_2_0_0\targets\MK22F12810\iar\flashloader\flashloader.bin C:\Bootloader\NXP_Kinetis_Bootloader_2_0_0\targets\MK22F12810\iar\flashloader\output\Debug\flashloader_image.c

Still I am having the same problem.

Any hints?

Regards

Srinivasa

0 Kudos

891 Views
srinivasa_raow
Contributor I

I have found a workaround for this:

 

Executed below command from command prompt as shown below:

C:\Bootloader\NXP_Kinetis_Bootloader_2_0_0\bin>C:\Python27\python create_fl_image.py C:\Bootloader\NXP_Kinetis_Bootloader_2_0_0\targets\MK22F12810\iar\flashloader\output\Debug\flashloader.elf C:\Bootloader\NXP_Kinetis_Bootloader_2_0_0\targets\MK22F12810\iar\flashloader\flashloader.bin C:\Bootloader\NXP_Kinetis_Bootloader_2_0_0\targets\MK22F12810\iar\flashloader\output\Debug\flashloader_image.c

command_prompt_working.png

flashloader_image.c was generated as expected.

Rest all is good.

Regards

Srinivasa

0 Kudos

891 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Srinivasa Rao Wunnimani,

     Thank you for your updated information.

     If you want to use flashload and flashload_load file, you need to build the flashloader at first, then build flashloader_loader, and download it to the board.

This bootloader will copy teh flashloader to the RAM, then updated the application code, after you updated the app code, the flashloader will be lost.

   The build sequence is very important.

   Or you can use the tower bootloader directly, it don't need to use the flashloader project or the flashloader_loader project.

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