ELFTOSB for KBOOT MSC application

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

ELFTOSB for KBOOT MSC application

Jump to solution
2,712 Views
kyleyang
Contributor IV

Because of KBOOT MSC bootloader only support SB file.

I also refer the user's guide "Kinetis Elftosb User's Guide" and want to generate a SB file from BIN.

But... it is difficult to understand how to convert BIN to SB file.

Is there any expert can share your experience with me?

Thanks.

0 Kudos
1 Solution
1,456 Views
kyleyang
Contributor IV

Hi Peter

Here is my command line arguments.

elftosb.exe -z -c led_demo.bd -o SB.bin

View solution in original post

12 Replies
1,456 Views
peterruesch
Contributor IV

for the completeness, how were your command line arguments to convert the application binary to the sb format?

0 Kudos
1,457 Views
kyleyang
Contributor IV

Hi Peter

Here is my command line arguments.

elftosb.exe -z -c led_demo.bd -o SB.bin

1,456 Views
peterruesch
Contributor IV

thank you very much kyle!

do you intend to have your application veryfied before it gets booted?

may I ask you how your deployment workflow looks like?

0 Kudos
1,456 Views
peterruesch
Contributor IV

I put some more effort into it and here is my deployment workflow:

  1. compile application
    1. linked at APPLICATION_OFFSET
    2. containing the BCA (Bootloader Configuration Area)
  2. generate binary (arm-none-eabi-objcopy -O binary ...)
  3. insert CRC into BCA (currently windows only:smileyangry: as this is done with KinetisFlashTool)
    1. you have to edit the "Application Start" field next to the CRC enable check box
  4. create .sb file with elftosb
    1. it's important to have a capable command file for this. see the one I attached here
  5. put target into bootloader mode
  6. use blhost with the "-- receive-sb-file" parameter to transfer the file.
    1. buspal is needed if you connect your target via SPI, I2C or CAN
  7. reset target
    1. can also done automatically if specified in the command file.
0 Kudos
1,456 Views
rohitchudasama
Contributor III

Hello,

I am getting an error while updating SB.bin image file.

Connected to device successfully!
Collecting device information......
Device information is updated!
Start update progress......
Updating image......
Error: Update image failed(SBSourceFile::createDataSource() has not been implemented.).
Update process is stopped by error.

Thanks

0 Kudos
1,456 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Kyle,

I'm sorry to hear that you fails to generate the SB file from the BIN file, and I was wondering if you can tell me what exactly trouble disturb you now.
Have a great day,

Ping

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

0 Kudos
1,456 Views
kyleyang
Contributor IV

Hi Jeremy

There is one more question need to discuss with you regarding the key file.

Currently I config the key as zeroes and enable encryption.

How and when to use the key as none zero?

Where can find the key file in bootloader source code?

Thanks.

0 Kudos
1,456 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Kyle,

First of all, I'd glad to hear that you can update the application successful.

Regard to advanced usage: encrypted image, I'd highly recommend you to refer to the Chapter 6 in the Kinetis Bootloader QuadSPI User's Guide.pdf, and you can also find the key file which resides in the  ~\NXP_Kinetis_Bootloader_2_0_0\NXP_Kinetis_Bootloader_2_0_0\doc.

2016-07-07_17-17-34.jpg
Have a great day,
Ping

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

0 Kudos
1,456 Views
kyleyang
Contributor IV

Hi Jeremy

Thanks.

But I just find a new issue...

After convert the "led_demo_freedom_a000.bin" to SB file.

I try to import a KSDK V2 example code "ecompass_frdmk64f" and build a update image.

It is seems update success at first time, but can not update it any more...

The "status.txt" in "FSL_Loader disk" show "Transfe" and seems accept the command but not process it.

is there any idea that you met before?

0 Kudos
1,456 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Kyle,

Thanks for your reply.

Do you mean that the SB file which has been generated from the updated image file can't update the application?

And I'm not very clear with the sentence "The "status.txt" in "FSL_Loader disk" show "Transfe" and seems accept the command but not process it.", can you explain it ?

I'm looking forward to your reply.
Have a great day,
Ping

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

0 Kudos
1,456 Views
kyleyang
Contributor IV

Hi Jeremy

I found the issue is related with debug console while using PRINTF.

If I disable the PRINTF, add preprocessor "NDEBUG", replace the startup files and link file.

It is works now and seems fine.

I also try to find the implement guideline from "Kinetis Bootloader v2.0.0 Reference Manual.pdf".

But no more information that guide how to implement the KBOOT into application code.

Did I miss anything?

0 Kudos
1,456 Views
kyleyang
Contributor IV

Hi Jeremy

I just did not know how to use ELFTOSB file, create BD file and use key file.

But, I just create a workable BD file as attached.

I want to update FRDM-K64F via MSC bootloader.

So I convert "led_demo_freedom_a000.bin" to SB file through ELFTOSB.

I just a little confuse and don't understand the description in document.

But anyway... just success update the firmware.

0 Kudos