Hello,
I’m running into an unexpected issue trying to flash a Xavier NX eMMC module after having burned SBK / PKC keys into the fuses. Running
sudo ./flash.sh -u keys/pkc-sign-key.pem -v keys/sbk.key -s keys/pkc-sign-key.pem -r -y SBKPKC jetson-xavier-nx-devkit-emmc mmcblk0p1
fails when it starts writing the secondary_gpt part:
(((earlier log messages omitted)))
./tegraflash.py --bl nvtboot_recovery_cpu_t194.bin_sigheader.encrypt.signed --bct br_bct_BR.bct --applet rcm_2_signed.rcm --applet_softfuse rcm_1_signed.rcm --cmd "secureflash;reboot" --cfg secureflash.xml --chip 0x19 --mb1_bct mb1_bct_MB1.bct_sigheader.encrypt.signed --mem_bct mem_rcm.bct_sigheader.encrypt.signed --mb1_cold_boot_bct mb1_cold_boot_bct_MB1.bct_sigheader.encrypt.signed --mem_bct_cold_boot mem_coldboot_sigheader.bct.signed --bins "mb2_bootloader nvtboot_recovery_t194.bin_sigheader.encrypt.signed; mts_preboot preboot_c10_prod_cr_sigheader.bin.encrypt.signed; mts_mce mce_c10_prod_cr_sigheader.bin.encrypt.signed; mts_proper mts_c10_prod_cr_sigheader.bin.encrypt.signed; bpmp_fw bpmp_t194_sigheader.bin.encrypt.signed; bpmp_fw_dtb tegra194-a02-bpmp-p3668-a00_sigheader.dtb.encrypt.signed; spe_fw spe_t194_sigheader.bin.encrypt.signed; tlk tos-trusty_t194_sigheader.img.encrypt.signed; eks eks_sigheader.img.encrypt.signed; bootloader_dtb tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt.signed"
saving flash command in flashcmd.txt
*** Flashing target device started. ***
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands
[ 0.0158 ] Parsing partition layout
[ 0.0170 ] tegraparser_v2 --pt secureflash.xml.tmp
[ 0.0190 ]
[ 0.0190 ] Boot Rom communication
[ 0.0213 ] tegrarcm_v2 --chip 0x19 0 --rcm rcm_1_signed.rcm --rcm rcm_2_signed.rcm
[ 0.0225 ] BR_CID: 0xe80219116459e5871000000013048180
[ 0.2286 ] Boot Rom communication completed
[ 1.4692 ]
[ 2.4741 ] tegrarcm_v2 --isapplet
[ 2.4762 ] Applet version 01.00.0000
[ 3.3577 ]
[ 3.3578 ] Sending BCTs
[ 3.3614 ] tegrarcm_v2 --download bct_bootrom br_bct_BR.bct --download bct_mb1 mb1_bct_MB1.bct_sigheader.encrypt.signed --download bct_mem mem_rcm.bct_sigheader.encrypt.signed
[ 3.3632 ] Applet version 01.00.0000
[ 4.2339 ] Sending bct_bootrom
[ 4.2341 ] [................................................] 100%
[ 4.2355 ] Sending bct_mb1
[ 4.2422 ] [................................................] 100%
[ 4.2460 ] Sending bct_mem
[ 4.3001 ] [................................................] 100%
[ 4.3761 ]
[ 4.3762 ] Generating blob
[ 4.3823 ] tegrahost_v2 --chip 0x19 --generateblob blob.xml blob.bin
[ 4.3841 ] number of images in blob are 11
[ 4.3850 ] blobsize is 5900536
[ 4.3852 ] Added binary blob_nvtboot_recovery_cpu_t194.bin_sigheader.encrypt.signed of size 263840
[ 4.3927 ] Added binary blob_nvtboot_recovery_t194.bin_sigheader.encrypt.signed of size 181152
[ 4.3935 ] Added binary blob_preboot_c10_prod_cr_sigheader.bin.encrypt.signed of size 24016
[ 4.3942 ] Added binary blob_mce_c10_prod_cr_sigheader.bin.encrypt.signed of size 143200
[ 4.3949 ] Added binary blob_mts_c10_prod_cr_sigheader.bin.encrypt.signed of size 3430416
[ 4.3968 ] Added binary blob_bpmp_t194_sigheader.bin.encrypt.signed of size 856352
[ 4.3985 ] Added binary blob_tegra194-a02-bpmp-p3668-a00_sigheader.dtb.encrypt.signed of size 281984
[ 4.3992 ] Added binary blob_spe_t194_sigheader.bin.encrypt.signed of size 94960
[ 4.3999 ] Added binary blob_tos-trusty_t194_sigheader.img.encrypt.signed of size 410560
[ 4.4007 ] Added binary blob_eks_sigheader.img.encrypt.signed of size 5136
[ 4.4013 ] Added binary blob_tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt.signed of size 208736
[ 4.4027 ]
[ 4.4028 ] Sending bootloader and pre-requisite binaries
[ 4.4047 ] tegrarcm_v2 --download blob blob.bin
[ 4.4060 ] Applet version 01.00.0000
[ 5.1505 ] Sending blob
[ 5.1507 ] [................................................] 100%
[ 5.9649 ]
[ 5.9687 ] tegrarcm_v2 --boot recovery
[ 5.9704 ] Applet version 01.00.0000
[ 6.8461 ]
[ 7.8509 ] tegrarcm_v2 --isapplet
[ 8.4575 ]
[ 8.4610 ] tegrarcm_v2 --ismb2
[ 9.3334 ]
[ 9.3371 ] tegradevflash_v2 --iscpubl
[ 9.3389 ] Bootloader version 01.00.0000
[ 9.7738 ] Bootloader version 01.00.0000
[ 9.7747 ]
[ 9.7748 ] Retrieving storage infomation
[ 9.7784 ] tegrarcm_v2 --oem platformdetails storage storage_info.bin
[ 9.7801 ] Applet is not running on device. Continue with Bootloader
[ 10.4230 ]
[ 10.4264 ] tegradevflash_v2 --oem platformdetails storage storage_info.bin
[ 10.4281 ] Bootloader version 01.00.0000
[ 10.8657 ] Saved platform info in storage_info.bin
[ 10.8672 ]
[ 10.8673 ] Flashing the device
[ 10.8706 ] tegraparser_v2 --storageinfo storage_info.bin --generategpt --pt secureflash.xml.bin
[ 10.8732 ]
[ 10.8762 ] tegradevflash_v2 --pt secureflash.xml.bin --create
[ 10.8777 ] Bootloader version 01.00.0000
[ 11.3097 ] Erasing spi: 0 ......... [Done]
[ 14.3124 ] Writing partition secondary_gpt with gpt_secondary_3_0.bin
[ 14.3132 ] [................................................] 100%
[ 14.3147 ] 000000000d0d0001: o initialize partition table from GPT.
[ 14.4012 ]
[ 14.4012 ]
Error: Return value 1
Command tegradevflash_v2 --pt secureflash.xml.bin --create
On the debug serial I see the following:
main enter
SPE VERSION #: R01.00.14 Created: Sep 19 2018 @ 11:03:21
HW Function test
Start Scheduler.
in late init
��
[0054.378] I> Welcome to MB2(TBoot-BPMP) Recovery (version: 00.00.2018.32-mobi
le-21d977c9)
[0054.378] I> DMA Heap @ [0x526fa000 - 0x52ffa000]
[0054.379] I> Default Heap @ [0xd486400 - 0xd48a400]
[0054.380] E> DEVICE_PROD: Invalid value data = 70020000, size = 0.
[0054.386] W> device prod register failed
[0054.391] I> parsing oem signed section of bpmp-fw header done
[0054.398] I> bpmp-fw binary copied from blob
[0054.404] I> RSA PSS signature check: OK
[0054.404] I> oem authentication of bpmp-fw header done
[0054.409] I> bpmp-fw: Authentication init Done
[0054.413] I> parsing oem signed section of cpubl header done
[0054.419] I> cpubl binary copied from blob
[0054.426] I> bpmp-fw: Authentication Finalize Done
[0054.430] I> RSA PSS signature check: OK
[0054.431] I> oem authentication of cpubl header done
[0054.436] I> cpubl: Authentication init Done
[0054.440] I> parsing oem signed section of tos header done
[0054.446] I> tos binary copied from blob
[0054.449] I> Relocating BR-BCT
[0054.453] I> cpubl: Authentication Finalize Done
[0054.459] I> RSA PSS signature check: OK
[0054.460] I> oem authentication of tos header done
[0054.465] I> tos: Authentication init Done
[0054.469] I> parsing oem signed section of bpmp-fw-dtb header done
[0054.475] I> bpmp-fw-dtb binary copied from blob
[0054.481] I> tos: Authentication Finalize Done
[0054.488] I> RSA PSS signature check: OK
[0054.488] I> oem authentication of bpmp-fw-dtb header done
[0054.492] I> bpmp-fw-dtb: Authentication init Done
[0054.497] I> parsing oem signed section of cpubl-dtb header done
[0054.503] I> cpubl-dtb binary copied from blob
[0054.509] I> bpmp-fw-dtb: Authentication Finalize Done
[0054.608] I> RSA PSS signature check: OK
[0054.608] I> oem authentication of cpubl-dtb header done
[0054.609] I> cpubl-dtb: Authentication init Done
[0054.610] I> parsing oem signed section of eks header done
[0054.610] I> eks binary copied from blob
[0054.612] I> cpubl-dtb: Authentication Finalize Done
[0054.616] I> RSA PSS signature check: OK
[0054.616] I> oem authentication of eks header done
[0054.619] I> eks: Authentication init Done
[0054.623] I> eks: Authentication Finalize Done
[0054.627] I> EKB detected (length: 0x410) @ VA:0x526fb800
��NOTICE: BL31: v1.3(release):b5eeb33f7
NOTICE: BL31: Built : 12:15:32, Jul 26 2021
ipc-unittest-main: 1519: Welcome to IPC unittest!!!
ipc-unittest-main: 1531: waiting forever
ipc-unittest-srv: 329: Init unittest services!!!
hwkey-agent: 41: hwkey-agent is running!!
hwkey-agent: 315: key_mgnt_processing .......
hwkey-agent: 162: ekb_verification: EKB_CMAC verification is not match.
hwkey-agent: 368: key_mgnt_processing: failed (-7)
hwkey-agent: 45: main: Failed to verify or extract EKB (-7).
exit called, thread 0xffffffffea8a4d58, name trusty_app_2_92b92883-f96a-4177
luks-srv: 40: luks-srv is running!!
platform_bootstrap_epilog: trusty bootstrap complete
��
welcome to lk
calling constructors
initializing heap
creating bootstrap completion thread
top of bootstrap2()
initializing platform
bpmp: platform_init
tag is e73a758761f0c6d24a1e69a2ac6b5035
tag_show initialized
dt initialized
mail initialized
chipid initialized
fuse initialized
sku initialized
speedo initialized
ec_get_ec_list: found 45 ecs
ec initialized
ec_mrq initialized
vmon_populate_monitors: found 3 monitors
vmon initialized
adc initialized
fmon_populate_monitors: found 73 monitors
fmon initialized
fmon_mrq initialized
reset initialized
nvhs initialized
391 clocks registered
clk_mrq_init: mrq handler registered
clk initialized
nvlink initialized
io_dpd initialized
io_dpd initialized
thermal initialized
i2c5 controller initialized
initialized i2c mrq handling
i2c initialized
regulator initialized
avfs_clk_platform_init: bad clk id in clock@cluster1_avfs
avfs_clk_platform initialized
soctherm initialized
aotag initialized
powergate initialized
dvs initialized
pm initialized
pg_late initialized
strap initialized
tag initialized
emc initialized
clk_dt initialized
avfs_ccplex_platform initialized
tj_max: dt node not found
tj_init initialized
/uphy is not enabled status = disabled
uphy_dt initialized
uphy initialized
safereg_init: period 80 ms
ec_late initialized
mrq initialized
��
[0054.979] I> Welcome to TBoot-CPU Recovery
��WARNING: no registered clock for FMON_NAFLL_CLUSTER1 (id 281)
fmon_post initialized
��[0054.980] I> Heap: [0xa4000000 ... 0xaa000000
[0054.990] I> gpio framework initialized
��clk_set_parent failed for clk i2c2, parent pll_aon (-22)
clk_set_parent failed for clk i2c8, parent pll_aon (-22)
clk_dt_late initialized
machine_check initialized
pm_post initialized
dbells initialized
avfs_clk_platform_post initialized
dmce initialized
cvc initialized
ccplex_avfs_hw_init: nafll_cluster0: not monitored
ccplex_avfs_hw_init: nafll_cluster2: not monitored
ccplex_avfs_hw_init: nafll_cluster3: not monitored
avfs_clk_mach_post initialized
regulator_post initialized
rm initialized
sc7_diag initialized
thermal_test initialized
serial_late initialized
clk_post initialized
clk_dt_post initialized
mc_reg initialized
pg_post initialized
dyn_modules initialized
sku_debugfs initialized
speedo_debugfs initialized
adc_debugfs initialized
Failed to register PTO counter for id 281
Failed to register PTO counter for id 281
Failed to register PTO counter for id 281
Failed to register PTO counter for id 281
clk_debugfs initialized
emc_debugfs initialized
dvs_debugfs initialized
fmon_debugfs_init_one: no clock debugfs node to attach FMON_NAFLL_CLUSTER1
fmon_debugfs initialized
vmon_debugfs initialized
pg_debugfs initialized
profile_fs initialized
debugfs_cons initialized
mail_fs initialized
profile initialized
cvc_debugfs initialized
dmce_debugfs initialized
ec_debugfs initialized
rm_rail_debugfs_init: /rm/vdd_cpu: failed
rm_rail_debugfs_init: /rm/vdd_cpu: failed
rm_debugfs initialized
soctherm_debug initialized
gr_reader initialized
mods initialized
dt_fs initialized
debugfs_mrq initialized
debug_mrq initialized
debug_safereg initialized
initializing target
calling apps_init()
starting app shell
entering main console loop
] ��[0055.000] I> tegrabl_gpio_driver_register: register 'nvidia,tegra194-gpio'
driver
[0055.154] I> tegrabl_gpio_driver_register: register 'nvidia,tegra194-gpio-aon'
driver
[0055.159] I> tegrabl_tca9539_init: i2c bus: 1, slave addr: 0x46
[0055.168] W> fetch_driver_phandle_from_dt: failed to get node with compatible t
i,tca9539
[0055.176] W> fetch_driver_phandle_from_dt: failed to get node with compatible n
xp,tca9539
[0055.180] W> tegrabl_tca9539_init: failed to fetch phandle from dt
[0055.186] I> tegrabl_tca9539_init: i2c bus: 1, slave addr: 0x44
[0055.194] W> fetch_driver_phandle_from_dt: failed to get node with compatible t
i,tca9539
[0055.202] W> fetch_driver_phandle_from_dt: failed to get node with compatible n
xp,tca9539
[0055.208] W> tegrabl_tca9539_init: failed to fetch phandle from dt
[0055.216] I> fixed regulator driver initialized
[0055.227] I> CPU: Nvidia Carmel
[0055.227] I> CPU: MIDR: 0x4e0f0040, MPIDR: 0x80000000
[0055.228] I> chip revision : A02
[0055.230] I> Boot-device: eMMC
[0055.233] I> Boot_device: SDMMC_BOOT instance: 3
[0055.656] I> sdmmc DDR50 mode
[0055.666] I> sdmmc-3 params source = safe params
[0055.667] I> QSPI source rate = 19200 Khz
[0055.668] I> Requested rate for QSPI clock = 19000 Khz
[0055.668] I> BPMP-set rate for QSPI clk = 19200 Khz
[0055.669] I> QSPI Flash Size = 32 MB
[0055.671] E> CR3V cmd failed, (err:0x0)
[0055.674] I> Qspi initialized successfully
[0055.674] I> qspi flash-0 params source = safe params
[0055.675] I> sdmmc bdev is already initialized
[0055.680] I> sdmmc-3 params source = safe params
[0055.700] W> Cannot find any partition table for 00000003
[0055.713] W> Cannot find any partition table for 00010003
[0055.714] W> Cannot find any partition table for 00030000
[0055.714] I> Recovery boot_type: 0
[0055.715] I> Entering 3p server
[0055.715] I> USB configuration success
[0058.339] I> Populate storage info
[0058.791] I> Erasing device 3: 0
[0058.791] I> QSPI: Erasing entire device
[0061.794] I> Writing device 3: 0.
[0061.876] W> Cannot find any partition table for 00030000
[0061.876] E> NV3P_SERVER: Failed to initialize partition table from GPT.
The only other mention I’ve found about the NV3P_SERVER: Failed to initialize partition table from GPT.
was in this thread, where the advice was to the RMA the board. Seeing as this board worked fine until I enabled SBK/PKC, it seems more likely that I’m getting the error due to something related to that.
Fuses used were: JtagDisable
(0x1), SecureBootKey
, Kek0
, Kek1
, Kek2
, PublicKeyHash
, BootSecurityInfo
(0x6), SwReserved
(0x28), and SecurityMode
(0x1).
Possibly relevant is that I burned the fuses while there was a non-signed/non-encrypted OS on the board.
I’ve also tried using nvmassflashgen.sh
, which results in the same error during the nvaflash.sh
run.
Any ideas on what I’m doing / have done wrong would be appreciated, before I subject a second board to the same treatment.
Thanks.