Hi, I am trying to automate the firmware flashing for a 1064 board using the spsdk tools based on the scripts generated by the provisioning tool.
The process is largely visible in the generated scripts however the tool does not show how the .bd and .srec files are initially generated after selecting the .axf input file and creating the workspace.
Can you please describe how these files are generated and which tools are involved?
Many thanks,
Fabio
Hi Fabio,
I'd suggest to use CLI of the MCUXpresso Secure Provisioning tool for the automation:
c:\nxp\MCUX_Provi_25.03\bin\securep.exe -w c:\temp\my\workspace build
This command will update BD, SREC and all other necessary files based on your application image.
Hi Fabio,
we use for the conversion the `nxpimage` utility located in the ./tools/spsdk/ sub folder. For windows it is located here:
c:\nxp\MCUX_Provi_25.03\bin\_internal\tools\spsdk\
See the help:
./nxpimage utils binary-image convert --help
To be honest I did not try whether the `--split-image ` argument is capable to split the input image into mentioned image header/DCD/FCB or other bin blobs. If not, can you configure your IDE to produce the *.axf containing only the application code?
Regards,
Libor
P.S.
Hi, I am trying to automate the firmware flashing for a 1064 board using
If the SEC tool works for you, you can automate even with the SEC tool, you can execute the SEC tool in command line. Once you have pre-copnfigured workspace, then you can just
c:\nxp\MCUX_Provi_25.03\bin\securep.exe -w c:\temp\my\workspace build
c:\nxp\MCUX_Provi_25.03\bin\securep.exe -w c:\temp\my\workspace write
Hi @liborukropec thank you for the help!
Using the following command worked well for me:
$ nxpimage utils binary-image convert -i input_file.axf -f s19 \
output_file.srec
Thanks again,
Fabio
Hi Fabio,
how the .bd and .srec files are initially
*.bd file is generated based on your workspace configuration
*.srec is generated as a intermediate file if you use other source image which e.g. contains FCB, DCD, App code, we split it into pieces.
Both files are generated via SEC tool. What exactly you want to achieve?
Regards,
Libor
Hi Libor,
Thank you for your quick reply. I am trying to build the HAB image as shown in the build_image script:
echo "### Build HAB image ###"
"$nxpimage" hab export -c "${SPT_WORKSPACE}/bd_files/imx_application_gen_mac.bd" \
-o "path/to/output/bin/file.bin" \
"path/to/srec/file/file.srec"
This uses the generated .bd and .srec files to build the bootable image. I have tried generating the .srec file using arm-none-eabi-objcopy -O srec path/to/file/file.srec, but the .bin image i generate does not work. However the bootable image generated by the provisioning tool script using the generated files does work for me.