How to produce a complete image using offline tool od SPSDK

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

How to produce a complete image using offline tool od SPSDK

223 Views
mastupristi
Senior Contributor I

Hello,

To me complete image means an image containing of keyblob, FCB, etc. In other words an image containing some 4KB between 0x30000000 and 0x30000FFF.

If I understand correctly, using SPT (and thus the underlying SDSDK) a file is produced that is missing the first 4KB.
These will be populated by flashloader directly on the target, using parameters that will be communicated to it, right?
I would need to work offline instead. I need to produce a "full image" without having the ability to access a target.

how do i do that?

 

best regards

Max

0 Kudos
Reply
3 Replies

178 Views
marek-trmac
NXP Employee
NXP Employee

Hi Max,

you can use MCUXpresso Secure Provisioning tool to build the bootable image and write to the memory and then read the image back. The see flash memory content, you can use main menu > Tools > Flash Programmer.

Regards,
Marek
0 Kudos
Reply

164 Views
mastupristi
Senior Contributor I

Hi @marek-trmac ,

Thanks for the lightning-fast response! I must say, it seems my previous message might have gone on a little adventure of its own. Perhaps it got lost in translation, or maybe it's just shy and didn't want to reveal too much, especially about not wanting to use a hardware target.

To reiterate, my quest (sounds grander this way, doesn't it?) is to conjure a "full image" strictly via the magical realm of offline tools, without any direct whispers or nudges to a hardware target. Picture me as a wizard who left his wand at the office—trying to pull off a spell remotely!

So, if there are any secret scrolls or spells (a.k.a instructions or guidelines) that would enable me to do this, I would be most grateful. Seeking to work my magic entirely from within the confines of my digital cave!

Looking forward to your mystical guidance!

 

best ragrds

Max

0 Kudos
Reply

143 Views
liborukropec
NXP Employee
NXP Employee

Hello Massimiliano,

SEC tool does not offer such functionality, still it is doable with few manual steps using SEC and bundled SPSDK CLI utility (nxpimage).

First you need to have Flash Configuration Block binary file (fcb.bin), it can be read from Flash, or using Boot Memory Configuration dialog (accessible from toolbar) and then "Convert to complete FCB" button. Only at this point you need the device to be connected. Someone out of the cave might help.

Second, for example when I look into the write script (windos batch), I can see these pieces of code that write stuff into the Flash (SPI NOR):

call "%blhost%" %blhost_connect% -j -- write-memory 0x30000400 "%SPT_WORKSPACE%\bootable_images\fcb.bin"
call "%blhost%" %blhost_connect% -j -- write-memory 0x30000600 "%SPT_WORKSPACE%\configs\image_version.bin"
call "%blhost%" %blhost_connect% -j -- write-memory 0x30001000 "%SPT_WORKSPACE%\bootable_images\myapp.bin" 0

Then, SEC tool contains nxpimage utility located here: <INSTALL_DIR>/bin/_internal/tools/spsdk

Then this information can be transformed into this YAML config file consumed by the nxpimage:

name: My super binary image
pattern: zeros
alignment: 1

regions:
- binary_file:
name: FCB
path: bootable_images/fcb.bin
offset: 0x400
- binary_file:
name: image version
path: configs/image_version.bin
offset: 0x600
- binary_file:
name: image itself
path: bootable_images/evkmimxrt1160_ota_mcuboot_basic.bin
offset: 0x1000

and finally the offline.bin can be created (expectation is that the offline.yaml is in the SEC workspace, nxpimage is in the PATH):

nxpimage utils binary-image merge -c offline.yaml -o offline.bin

 

Empty YAML config (template) file can be created by executing:

nxpimage utils binary-image get-template -o offline.yaml

 

Hope this helps.

Regards,

Libor

0 Kudos
Reply