Hi all,
I am currently having an issue trying to enable secure boot and disk encryption on my Jetson Orin NX.
Issue Description:
When I go to flash the Orin I get the following error:
ERROR: might be timeout in USB write
After the host PC sends mb1
After watching the connected devices on linux with
watch -n 0.2 lsusb
It seems during the early stages of the flashing script the Orin drops out of recovery mode (NVIDIA Corp. APX) disappears.
I can confirm it is not an issue with the USB cable used in this process. I have used the cable to flash multiple unencrypted devices.
Hardware / Software configuration
Host PC: Ubuntu 20.04
Jetpack: 5.1.2 (must be this version)
Jetson Linux: r35.4.1 (must be this version)
Board: Jetson Orin NX
Carrier: CTI Hardon Dual Mipi w/ 1TB NVMe
Configuration process
Device was originally flashed with an unencrypted version of the same BSP (5.1.2, r35.4.1, etc). Following a successful flash of the device the following was conducted on the exact same hardware setup.
-
A new ‘clean’ copy of the BSP was downloaded and installed on the host machine.
-
NVIDIA component was downloaded using SDKManager cli.
sdkmanager --cli \
--login-type devzone \
--action install \
--archived-versions \
--version 5.1.2 \
--target JETSON_ORIN_NX_TARGETS \
--host \
--select 'Jetson Linux' \
--select 'Jetson Runtime Components' \
--deselect 'Jetson SDK Components' \
--download-folder "${DOWNLOAD_DIR}" \
--target-image-folder "${INSTALL_DIR}" \
--license accept \
--collect-usage-data disable \
--exit-on-finish -
CTI component was downloaded and extracted.
INSTALL_DIR="/media/ubuntu/nvidia/nvidia_sdk"
T4L_DIR="${INSTALL_DIR}/JetPack_5.1.2_Linux_JETSON_ORIN_NX_TARGETS/Linux_for_Tegra"
cd "$T4L_DIR"
wget -c https://connecttech.com/ftp/Drivers/CTI-L4T-ORIN-NX-NANO-35.4.1-V013.tgz
tar -zxf CTI-L4T-ORIN-NX-NANO-35.4.1-V013.tgz
cd CTI-L4T
sudo ./install.sh
cd .. -
Driver Package for 35.4.1 was downloaded and installed in the correct directory: https://developer.nvidia.com/downloads/embedded/l4t/r35_release_v4.1/sources/public_sources.tbz2
-
-
Keys were generated.
-
Generate PKC.pem
openssl ecparam -name secp521r1 -genkey -noout -out pkc.pem -
Generate PKC hash
./tegrasign_v3.py --pubkeyhash pkc.pubkey pkc.hash --key pkc.pem > pkc.key -
Generate SBK
openssl rand -hex 32 | tr -d '\n' > sbk.key -
Generate User Encryption Key
openssl rand -hex 32 | tr -d '\n' > uek.key -
Generate DiskEncryption Key
openssl rand -hex 32 | tr -d '\n' > dek.key -
Generate OEMK1
openssl rand -hex 32 | tr -d '\n' > oemk1.key -
Generate PK
openssl req -newkey rsa:2048 -nodes -keyout PK.key -new -x509 -sha256 -days 3650 -subj "/CN=My Platform Key/" -out PK.crt -
Generate KEK
$ openssl req -newkey rsa:2048 -nodes -keyout KEK.key -new -x509 -sha256 -days 3650 -subj "/CN=My Key Exchange Key/" -out KEK.crt -
Generate db_1
$ openssl req -newkey rsa:2048 -nodes -keyout db_1.key -new -x509 -sha256 -days 3650 -subj "/CN=My Signature Database key 1/" -out db_1.crt -
Generate db_2
$ openssl req -newkey rsa:2048 -nodes -keyout db_2.key -new -x509 -sha256 -days 3650 -subj "/CN=My Signature Database key 2/" -out db_2.crt -
Generate UEFI Config
cat << 'EOF' > uefi_keys.conf
UEFI_PK_KEY_FILE="PK.key";
UEFI_PK_CERT_FILE="PK.crt";
UEFI_KEK_KEY_FILE="KEK.key";
UEFI_KEK_CERT_FILE="KEK.crt";
UEFI_DB_1_KEY_FILE="db_1.key";
UEFI_DB_1_CERT_FILE="db_1.crt";
UEFI_DB_2_KEY_FILE="db_2.key";
UEFI_DB_2_CERT_FILE="db_2.crt";
EOF -
Generate dtbo
sudo gen_uefi_default_keys_dts.sh uefi_keys/uefi_keys.conf
sudo chmod 644 uefi_keys/_out/*.auth -
Generate fv
openssl rand -rand /dev/urandom -hex 16 > fv -
Generate EKB
# EKB is generated and then used to replace original in bootloader/
gen_ekb.py -chip t234 \
-oem_k1_key oemk1.key \
-fv fv \
-in_sym_key uek.key \
-in_sym_key2 dek.key \
-out eks_t234.img
-
-
Create / Test / Burn Fuses
-
Create fuse file (fuse.xml)
<genericfuse MagicId="0x45535546" version="1.0.0">
<fuse name="PublicKeyHash" size="64" value="0xPKC_KEY_HASH_HERE"/>
<fuse name="SecureBootKey" size="32" value="0xSBK_HERE"/>
<fuse name="OemK1" size="32" value="0xOEMK1_HERE"/>
<fuse name="BootSecurityInfo" size="4" value="0xB"/>
</genericfuse> -
Test fuse burning
sudo ./odmfuse.sh --test -X fuse.xml -i 0x23 cti/orin-nx/hadron-dual-mipi/base -
Burn fuses
sudo ./odmfuse.sh -X fuse.xml -i 0x23 cti/orin-nx/hadron-dual-mipi/base -
Read fuses from device to confirm (confirmed PKC Hash and BootSecurityInfo)
sudo ./odmfuseread.sh -i 0x23 cti/orin-nx/hadron-dual-mipi/base
-
-
Flash device
sudo ROOTFS_ENC=1 ./tools/kernel_flash/l4t_initrd_flash.sh \
--external-device nvme0n1p1 \
-u pkc.pem \
-v sbk.key \
-i dek.key \
--uefi-enc uek.key \
--uefi-keys uefi_keys/uefi_keys.conf \
-p "-c ./bootloader/t186ref/cfg/flash_t234_qspi.xml" \
-c ./tools/kernel_flash/flash_l4t_nvme_rootfs_enc.xml \
--showlogs \
--network usb0 \
cti/orin-nx/hadron-dual-mipi/base \
internal
At this point the flash fails (see flash logs and device debug logs below)
flash_device.log (22.7 KB)
device_debug.log (173.5 KB)
Thanks in advance for your help