- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
in my project I use elftosb tool with kinetis option, like this:
elftosb -f kinetis -V -c .\path_to_bd_file.bd -o .\out_image.sb .\my_bin_file.bin
but, since elftosb is deprecated by nxpimage, I tried to use it the same way before
nxpimage sb21 export -c .\path_to_bd_file.bd -o .\out_image.sb .\my_bin_file.bin
but i get error:
GENERAL ERROR: KeyError: 'options'
I already asked for help here: https://community.nxp.com/t5/i-MX-RT/Specific-bytes-at-the-beginning-of-binary-file-don-t-allow-to/m..., but no one was able to help, that's why I created another question, that's more focused on how nxpimage should be used to replace elftosb.
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have checked the other thread https://community.nxp.com/t5/i-MX-RT/Specific-bytes-at-the-beginning-of-binary-file-don-t-allow-to/m... and from the attached screenshot it seems
that first command is fill memory with configuration word for flex SPI configuration
blhost -p <com> fill-memory 0x2000 4 0xC0000106 word
second command is to enable this configuration
blhost -p <com> -- configure-memory 9 0x2000
third command is flash-erase regions 0...0x1e000
blhost -p <com> flash-erase-region 0x60000000 0x1e000 9
and the last command is load to memory
blhost -p <com> write-memory 0x60000000 <your binary file>
Please note, that flashloader must be running in target in order to execute these commands.
sdphost -p <com> -j -- write-file 0x20001C00 <path to flashloader bin>
sdphost -p <com> -j -- jump-address 0x20001C00
Or check the SEC tool, which does it all for you.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maria,
can you describe the use case? Why do you need the SB file? Why cannot you use script with list of blhost commands?
We'd like to understand your problem in the context, so we can help.
Marek


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Maria,
I'd recommend to use MCUXpresso Secure Provisioning tool and build a signed image. The tool will generate build script and all configuration file needed for you.
However, in case your question is specific for i.MX RTxxxx processors, the SB files are not supported in MCUXpresso Secure Provisioning tool yet. I'm not sure about nxpimage.
Marek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I need to generate SB flashloader script with included unencrypted unsigned binary. Script is supposed to setup flash memory, then download and run the binary from flash. I don't want to build a signed image.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Maria,
Why cannot you use script (*.bat or *.sh) with list of blhost commands?
Marek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
https://spsdk.readthedocs.io/en/latest/apps/blhost.html#blhost-receive-sb-file
This command requires a generated SB file, but I fail to generate one.
elftosb works in most cases, but as I described in my other topic, not in all. That's why I'm looking for an alternative for it.
Regards,
Maria


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Maria,
I still do not understand, why the SB file is used. For all SB file commands, there exists a command in `blhost`. You can create simple script, that will do the same as SB file, just using other blhost commands like erase and write. You can use MCUXpresso Secure Provisioning Tool to generate the script for you. And big advantage is - it is much easier for maintenance, you can see response from the processor for each command and if it fails, you know the command where the problem is.
From your description I do not see any reason to use SB file.
Marek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks, you helped me understand what I can do. The answer I marked as a solution worked. I still wonder why elftosb failed with this specific bytes configuration, but I guess this will stay a secret :).
Many thanks to both of you!
Regards,
Maria
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So, this error probably occurs because I set output file as .sb file?
Could you suggest me another alternative to elftosb that would work in this case?
I'm not looking for any tool that would build me a signed image. I'm just looking for a tool that would work just as elftosb, since this is deprecated. I wouldn't switch, but according to my other topic (in the link), I guess I have to
Maria

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
# ================================ Bootable Image Configuration template for rt105x. =================================Marek
# ======================================================================================================================
# == General Options ==
# ======================================================================================================================
# ------------------------------------------===== MCU family [Required] =====-------------------------------------------
# Description: MCU family name.
# Possible options: <lpc55s3x, rt101x, rt102x, rt104x, rt105x, rt106x, rt116x, rt117x, rt118x, rt5xx, rt6xx, rw61x>
family: rt105x
# -------------------------------------===== Chip silicon revision [Optional] =====-------------------------------------
# Description: If needed this could be used to specify silicon revision of device.
# Possible options: <a0, latest>
revision: latest
# ------------------------------------------===== Memory type [Required] =====------------------------------------------
# Description: Specify type of memory used by bootable image description.
# Possible options: <flexspi_nor>
memory_type: flexspi_nor
# ======================================================================================================================
# == Bootable Segments definition ==
# ======================================================================================================================
# ----------------------------------------===== FCB block path [Optional] =====-----------------------------------------
# Description: Flash Configuration block Image path. It could be used as pre-prepared binary form of FCB and also YAML
# configuration file for FCB. In case that YAML configuration file is used, the Bootable image tool build the FCB
# itself.
fcb: fcb.bin
# ------------------------------------===== BEE encryption header 0 [Optional] =====------------------------------------
# Description: BEE encryption header 0 path
bee_header_0: bee_header_0.bin
# ------------------------------------===== BEE encryption header 1 [Optional] =====------------------------------------
# Description: BEE encryption header 1 path
bee_header_1: bee_header_1.bin
# ======================================================================================================================
# == Executable Segment definition ==
# ======================================================================================================================
# -----------------------------------------===== HAB container [Required] =====-----------------------------------------
# Description: HAB container image path. It could be used as pre-prepared binary form of HAB and also YAML configuration
# file for HAB. In case that YAML configuration file is used, the Bootable image tool build the HAB itself.
hab_container: hab_container.yaml

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have checked the other thread https://community.nxp.com/t5/i-MX-RT/Specific-bytes-at-the-beginning-of-binary-file-don-t-allow-to/m... and from the attached screenshot it seems
that first command is fill memory with configuration word for flex SPI configuration
blhost -p <com> fill-memory 0x2000 4 0xC0000106 word
second command is to enable this configuration
blhost -p <com> -- configure-memory 9 0x2000
third command is flash-erase regions 0...0x1e000
blhost -p <com> flash-erase-region 0x60000000 0x1e000 9
and the last command is load to memory
blhost -p <com> write-memory 0x60000000 <your binary file>
Please note, that flashloader must be running in target in order to execute these commands.
sdphost -p <com> -j -- write-file 0x20001C00 <path to flashloader bin>
sdphost -p <com> -j -- jump-address 0x20001C00
Or check the SEC tool, which does it all for you.
