elftosb creates empty secure binary file

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

elftosb creates empty secure binary file

Jump to solution
1,627 Views
kamilm
Contributor II

Hi!,
I need to generate a simple secure binary file for testing. I follow the steps in the document "i.MX RT1060 Manufacturing User's Guide" but the generated file is empty.
In the attachments I send a package with the results I achieved.

The documentation states that:
"Typically, all the application image paths are provided in this section. Currently, the ELF file and SREC file are supported for i.MX RT Bootable image generation"

But how to generate srec or elf files as MCUXpresso can only generate .s19 files ?

Binary description file for bootable image creation :

 

options {
    flags = 0x00;
    startAddress = 0x60000000;
    ivtOffset = 0x1000;
    initialLoadSize = 0x2000;
}

sources {
    elfFile = "evkbimxrt1050_iled_blinky.bin";
}

section (0)
{
}

 

 Command:

 

elftosb.exe -f imx -V -c imx-flexspinor-normal-unsigned.bd -o ivt_evkbimxrt1050_iled_blinky.bin

 

Binary description file for secure binary creation:

 

sources {
	myBinFile = "ivt_evkbimxrt1050_iled_blinky.bin";
}

section (0) {
	load 0xC0233007 > 0x2000;
	enable flexspinor 0x2000;
	erase 0x60000000..0x60010000;
	load 0xf000000f > 0x3000;
	enable flexspinor 0x3000;
	load myBinFile > 0x60001000;
}

 

Command:

 

elftosb.exe -f imx -V -c test.bd -o evkbimxrt1050_iled_blinky.sb

 


and the result is as follows:

kamilm_0-1636057089317.png


I would appreciate your help and suggestions,

Regards,
Kamil

 

0 Kudos
1 Solution
1,587 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @kamilm ,

  When you generate the .19, please don't contains the FCB.

  XIP_BOOT_HEADER_ENABLE =0

  Do you do it like this?

  I think you can use the SDK led_blinky project as an example and test it.

You also can try the attached .srec file. which from the MCUbootUtility.

Best Regards,

Kerry

View solution in original post

0 Kudos
6 Replies
1,617 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @kamilm 

  From your description, you want to generate the .sb file, then download with the MFG tool, right?

  If yes, please read the nxp application note, you will be more clear about it.

https://www.nxp.com/docs/en/application-note/AN12108.pdf

MCUXpresso IDE generated  .s19  is just the srec file, you can use it directly, don't worry, it works, as I have tested it previously. If you still need to use the .srec, just modify your .s19 to .srec is OK.

  In fact, your steps are all correct.

 

Wish it helps you!

If you still have questions about it, please kindly let me know.

Best Regards,

Kerry

 

0 Kudos
1,606 Views
kamilm
Contributor II

Hi Kerryzhou !

Thank you for your response and advice.

I checked the commands in the document you recommended. To generate a *.sb file it needs to pass the argument "kinetis" instead of "imx".

kamilm_0-1636413325113.png

 

Best Regards,
Kamil

0 Kudos
1,599 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @kamilm ,

  You are right.

  When generate the .sb, you need to use the kineits, not the i.mx

elftosb.exe -f kinetis -V -c ../../bd_file/imx10xx/program_flexspinor_image_qspinor.bd -o boot_image.sb ivt_flexspi_nor_hello_world_nopadding.bin

 

Now, do you still have issues about it or not?

Best Regards,

Kerry

0 Kudos
1,593 Views
kamilm
Contributor II

Hi Kerry !

Generated files are ok.

However, generating a bootable image from an .s19 file does not work. Only when the .bin file is specified, the bootable image is created.

kamilm_0-1636459014987.png

Binary description file content:

options {
    flags = 0x00;
    startAddress = 0x60000000;
    ivtOffset = 0x1000;
    initialLoadSize = 0x2000; 
    entryPointAddress = 0x60002000;
}

sources {
    elfFile = extern(0);
}

section (0)
{
}

 Of course, I can continue to operate on .bin files. I'm just reporting a problem with the .s19 files. 

Best Regards,

Kamil

0 Kudos
1,588 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @kamilm ,

  When you generate the .19, please don't contains the FCB.

  XIP_BOOT_HEADER_ENABLE =0

  Do you do it like this?

  I think you can use the SDK led_blinky project as an example and test it.

You also can try the attached .srec file. which from the MCUbootUtility.

Best Regards,

Kerry

0 Kudos
1,581 Views
kamilm
Contributor II

Hi Kerry,

Thank you for help! 

I changed the value of the symbol XIP_BOOT_HEADER_ENABLE =0
Now everything is OK!

kamilm_0-1636549405284.png
kamilm_1-1636549457716.png

Best Regards,
Kamil