Generating Flashing Binaries Offline

Use the create_bsp_images.sh script to generate flashing binaries offline when the target is not connected to the host using create_bsp tools. Flashing binaries are pre-processed binaries used by the update_sample update tool.
The create_bsp tool create_bsp_images.sh requires bootburn_lib.sh and bootburn helper files for execution. The script uses default paths as in bootburn for the target. Depending on the configuration file, it processes raw binaries for flashing; including adding and signing headers. The create_bsp_images.sh image invokes tools such as nvimagegen, nvtegrabct_v2 internally, similar to bootburn.sh, to process binaries.
The create_bsp_images.sh script is available at:
<top>/drive-t186ref-foundation/tools/host/flashtools/bootburn
Prerequisites
To enable bootburn tracing support, execute the command:
sudo apt-get install -f lockfile-progs

Command Line Options

Options
Description
-A
Specifies text file containing SKUInfo arguments similar to arguments for the -z option.
-B <boot_device>
Specify the boot-device. Supported boot devices are qspi and emmc. Default is qspi.
-C
Selects debug binaries for boot loaders.
-D
Enables debug prints from flashing script.
-E
Specifies ECC-enabled binaries.
-L
Enables low-power state support.
-M
Specifies development version firmware for non-production board.
-X
Enables the golden register address. Value dumps into the GR memory carveout.
-Y
Specifies the dt-overlay odm-data parameter.
-b <board_name>
Specifies the board name:
• e3550-b01-t194a for Xavier A on E3550 B01.
• e3550-b03-t194b for Xavier B on E3550 B03.
• p3479a01-t194 on P3479.A01 with Xavier-AD SKU.
• p3479a04-t194 on P3479 A04 with Xavier-AD SKU.
• p3479a04-t194ad125 on P3479 A04 with Xavier-AD 125 SKU.
• p3479a01-t194s on p3479 A01 with Xavier-S SKU.
• p3479a04-t194s on p3479 A04 with Xavier-S SKU.
-c
Selects a safety profile: SCE with safety firmware, or APE with camera.
-d <partition_name> <filename>
Specifies a DTB file.
The default file is defined in the BoardSetFilePathsAndDefaultValues function in bootburn_helper.sh.
bpmp-fw-dtb and kernel-dtb may be specified simultaneously.
Note: This option is not intended to specify kernel-dtb in Hypervisor.
-e <emulation_target>
Specifies the target board for emulation. Valid emulation targets are: reilly, ohara-gfx, ohara-compute, drew-gfx, and drew-compute.
-g
Generates binaries at the specified path. Does not flash.
-h
Provides guidance on options for the create_bsp_images tool.
-k
Specifies the absolute path of the configuration file to be used.
If used with Hypervisor, the configuration file must have been created from bind_partitions and be located in the hypervisor output directory.
The default value for DRIVE OS Linux: quickboot_qspi_linux.cfg
The default value for DRIVE OS QNX: Quickboot_qspi_qnx.cfg
-l
(Lower case l)
Creates Linux images.
-p <pkc_file>
Specifies RSA or ECDSA key file <pkc_file> for signing images.
-q
Creates QNX images.
--encryption_key
Takes as parameter the full file path and name. Secure boot encryption key. Can be used with bootburn.sh and create_bsp_images.sh.
--pl_encryption_key
Takes as parameter the full file path and name. Kek0
encryption key. Can be used with bootburn.sh and create_bsp_images.sh.
--hsm <key_string>
Can be used with bootburn.sh and create_bsp_images.sh. Tells Bootburn what keys will be used in HSM mode. Key String is Key + Encrypt Keys. Key is rsa|eddsa. Encrypt Keys are sbk or kek0. Examples:
--hsm rsa
--hsm rsa+sbk
--hsm rsa+sbk+kek0
--hsm eddsa
--hsm eddsa+sbk
--hsm eddsa+sbk+kek0
-r
Specifies the chip revision. Supported values are:
• 01
• 02
This option must be used with the -b option.
The -r and -b options can be used in place of the -z option.
-s
(Lower case s)
Skips creating the file system.
-z <board_info>
(Lower-case z)
Updates SKUInfo and other-information.
--asymmetric
Used to generate images for native chain in asymmetric mode.
--customer-data
Specified customer data such as skuinfo and others to be updated during flashing.
--chain [A|B]
For use by DRIVE Update to generate update packages.

Processed Binaries Directory Structure

The create_bsp tools take the -g argument to specify the output directory path where processed binaries are generated. After executing create_bsp tool, a per SKU-based directory is created under the output directory.
For example, if create_bsp is executed to create binaries for --skunum 699-62382-0010-100 --setskuversion AA with -g images, a sub-directory is created under the output directory, images in this case, with a name generated by appending the skunum and setskuversion.
$ ls images
699-62382-0010-100_AA
Under the sub-directory, three sets of binaries are generated as flash-images: rcm-boot and rcm-flash.
These binaries are required at different phases during flashing.
$ ls images/699-62382-0010-100_AA/
flash-images rcm-boot rcm-flash
The generated sub-directories are as follows:
Sub-directory
Description
flash-images
Contains processed binaries flashed on the target storage medium. Also contains FileToFlash.txt, a summary file that contains information about binary names to flash at offsets for the final target flash structure.
These binaries are used for the update tool update_sample.
rcm-boot
Contains the necessary binaries to boot the target without writing binaries to the medium.
rcm-flash
Contains binaries similar to rcm-boot for booting the Linux kernel on initramfs without writing binaries to the medium. These binaries are generated from a set of prebuilt binaries that are used for flashing.

Generating Binaries with an Argument File

The create_bsp tool can take an argument file that it can iterate to generate all sets of flashing binaries listed in the SKU argument file. This is the default mode in the create_bsp tool. Do NOT use this mode with the -z option. The argument file must contain the same set of string defining target skuInfo as used with the -z as shown in bootburn help.
This example demonstrates using the create_bsp tool with the -A option for a e3550-t194 target:
Example: Sample skuarguments file skuargs.txt
1. Add the following lines to skuargs.txt file:
--skunum 699-62382-0010-100 --setskuversion BB --setboardserial 1234 --setmacid eth0 0x00044b52f69b --setprodinfo 600-62382-0100-100 JJ
--skunum 699-62382-0010-100 --setskuversion AA --setboardserial 1234 --setmacid eth0 0x00044b52f69b --setprodinfo 600-62382-0100-100 JJ
2. Execute this command to create the images directory.
mkdir images
3. Run the script as follows:
./create_bsp_images.sh -A skuargs.txt -g ./images -b e3550b01-t194a -r <chip_revision>
Where <chip_revision> is the revision number for the platform. For example, 02.
The processed images are generated under the images directory.
There is one output directory for each entry.
The images are created using the default configuration file.
If a custom configuration file is selected using the -k option with the absolute path to the custom configuration file, it overrides the default configuration file.

Generating Binaries with Command Line SKUInfo

The create_bsp tool can take skuinfo from the -z command line option. Images are created based on the sku information provided on the command line. Alternatively, use the -r and -b options to provide the board and revision information.
Note:
Do NOT use -z option with -A option.
Example Usage
This example demonstrates using the create_bsp tool with the -z option for a e3550-t194 target:
$ mkdir images
$ ./create_bsp_images.sh -z "--skunum 699-62382-0010-100 --setskuversion BB --setboardserial 1234 --setmacid eth0 0x00044b52f69b --setprodinfo 600-62382-0100-100 JJ" -g images/ -b e3550b01-t194a
Processed images are generated under the images directory:
$ ls images
699-62382-0010-100_BB
The images are created using the default configuration (CFG) file.
To override the default configuration file with a custom configuration, use the -k option to specify the absolute path to the customized configuration file.

Generating Binaries for Flashing Asymmetric Boot Chains

The generate_asymmetric_boot_chains.py tool allows generating images for asymmetric boot chains for flashing.
generate_asymmetric_boot_chains.py relies on create_bsp_images.py to generate asymmetric boot chains.
Prerequisites
Linux+MODS and AV+Q packages are installed.
Create Fskp Firmware
This step combines fskp_fuse.xml < is OEM xml file> and fskp.bin. fskp_t19x.key is a key checked out from NVIDIA. For more details, see Factory Security Key Provisioning in the PDK.
cd <PDK_TOP>/drive-t186ref-foundation/tools/host/flashtools/fuseburn
python3 ./fskp_fuseburn.py -c 0x19 -f fskp_fuse.xml -k
 
fskp_t19x.key -g ../../../../firmwares/bin/t19x/fskpboot \
-v -i 63
or for hsm:
python3 ./fskp_fuseburn.py -c 0x19 -f fskp_fuse.xml -g ../../../../firmwares/bin/t19x/fskpboot -v -i 63 --hsm fskp
Bind
To generate chain-A (Linux+MODS) and chain-B (AV+Q), use the following binding:
cd <top>/drive-t186ref-foundation
 
make -f Makefile.bind BOARD=e3550b03-t194a PCT=qnx CHAIN_A_CONFIG=<top>/drive-t186ref-foundation/tools/host/flashtools/storage_configs/t19x/mods_boot_chain_asymmetric_qspi.cfg
 
cd out
cp -r e3550b03-t194a e3550b03-t194a-asym
cd ..
make -f Makefile.bind BOARD=e3550b03-t194a PCT=qnx
Command Line Options
Options
Description
--cfg
JSON configuration file for generating asymmetric boot chains.
-b <board_name>
Target board name.
i
Key slot. Must be same as -I used in fskp_fuseburn.py command.
--der_str <file_name>
Derivation Strings example file contents below:
SecProvisionDerivationString1 = 0x0123456789abcdef00112233445566778899aabbccddeeff0102030405060708;
SecProvisionDerivationString2 = 0x1111111122222222333333334444444455555555666666667777777788888888;
-h
Displays help information for the script.
Format of the configuration file (used with --cfg option):
Json input configuration schema:
{
"number-of-chains": <Number of chains>,
"boot-chains": {
"chain-<1..N>": "Chain specific arguments",
},
"all-chains": "Arguments applied to all chains",
"generic": {
"save-intermediate": <true if intermediate output needs to be saved, false otherwise>,
"output-directory": <Output directory path where the images are saved>
}
}
Description of each field in the JSON file:
number-of-chains: The number of asymmetric chains to be generated.
boot-chains: Dictionary of <chain-name> and its <arguments> for create_bsp_images.py.
Number of key-value pair here should match number-of-chains.
Arguments for the chain here should be compatible to create_bsp_images.py because create_bsp_images.py is being called to generate chains using those arguments.
all-chains: Arguments applied to each chain in boot-chains for create_bsp_images.py.
generic: Dictionary of options used by this script:
save-intermediate: Flag indicating intermediate output needs to be saved.
output-directory: Output directory path where the generated asymmetric images are saved.
Note:
generate_asymmetric_boot_chains.py uses create_bsp_images.py internally to generate the chains using arguments specified in the configuration file.
Example configuration file
{
"number-of-chains": 2,
"boot-chains": {
"chain-1": "-m -g chain_1 --asymmetric -d kernel-dtb tegra194-e3550-0001-b03-A-mods.dtb",
"chain-2": "-g chain_2"
},
"all-chains": "-r 02 -D -M",
"generic": {
"save-intermediate": true,
"output-directory": "asymmetric_images"
}
}
How to run/generate asymmetric images
cd <top>/drive-t186ref-foundation/tools/host/flashtools/bootburn_t19x_py
python generate_asymmetric_boot_chains.py --cfg <JSON configuration file> -b <board_name>
 
# example command
python generate_asymmetric_boot_chains.py --cfg asymmetric_configuration_int.json -b e3550b03-t194a

Output

Output images: Output is saved in the directory path specified via input JSON configuration file using output-directory : directory path.
Logs: Log files are generated for each create_bsp_images.py run using the <name>.log where <name> is the chain name given for each chain in the JSON input configuration file.