NX does not boot after flashing DTB only

sudo ./flash.sh -r -k kernel-dtb jetson-xavier-nx-devkit-emmc mmcblk0p1

After flash complete, I can see the Nvidia Logo and after that black screen with a blinking cursor:
This is the UART boot log:

.
.
.
.
.

[0002.252] I> Hit any key to stop autoboot: 4 3 2 1
[0004.260] initializing target
[0004.260] calling apps_init()
[0004.261] starting app kernel_boot_app
[0004.267] I> found decompressor handler: lz4-legacy
[0004.267] I> decompressing BMP blob …
[0004.271] I> Kernel type = Normal
[0004.271] I> Loading kernel-bootctrl from partition
[0004.271] I> Loading partition kernel-bootctrl at 0xa42b0000 from device(0x1)
[0004.279] W> tegrabl_get_kernel_bootctrl: magic number(0x00000000) is invalid
[0004.280] W> tegrabl_get_kernel_bootctrl: use default dummy boot control data
[0004.281] I> ########## SD boot ##########
[0004.286] W> Error: failed to get sd-card params
[0004.290] I> -0 params source =
[0004.293] E> Failed to initialize device 6-0
[0004.297] E> SD boot failed, err: 252641293
[0004.301] I> ########## USB boot ##########
[0004.310] W> No valid slot number is found in scratch register
[0004.311] W> Return default slot: _a
[0004.322] I> USB Firmware Version: 60.06 release
[0004.377] I> regulator of usb2-0 already enabled
[0004.381] I> regulator of usb2-1 already enabled
[0004.387] I> enabling ‘vdd-usb2-5v’ regulator
[0005.388] E> failed to initialize xhci controller
[0005.388] E> Error in init of XUSB host driver, err: 79790026
[0005.389] E> Failed to initialize device 5-0
[0005.389] E> USB boot failed, err: 2037973030
[0005.389] I> ########## Fixed storage boot ##########
[0005.390] I> Already published: 00010003
[0005.390] I> Look for boot partition
[0005.393] I> Fallback: assuming 0th partition is boot partition
[0005.399] I> Detect filesystem
[0005.426] I> Loading extlinux.conf …
[0005.426] I> rootfs path: /sdmmc_user/boot/extlinux/extlinux.conf
[0005.457] I> L4T boot options
[0005.457] I> [1]: “primary kernel”
[0005.458] I> Enter choice:
[0007.977] I> Selected option: 1
[0007.977] I> Loading kernel sig file from rootfs …
[0007.978] I> rootfs path: /sdmmc_user/boot/Image.sig
[0007.996] I> Loading kernel binary from rootfs …
[0007.997] I> rootfs path: /sdmmc_user/boot/Image
[0008.416] I> Validate kernel …
[0008.417] I> T19x: Authenticate kernel (bin_type: 37), max size 0x5000000
[0008.745] I> No kernel-dtb binary path
[0008.745] W> No valid slot number is found in scratch register
[0008.746] W> Return default slot: _a
[0008.746] I> A/B: bin_type (38) slot 0
[0008.746] I> Loading kernel-dtb from partition
[0008.747] I> Loading partition kernel-dtb at 0x91000000 from device(0x1)
[0008.764] I> Validate kernel-dtb …
[0008.764] I> T19x: Authenticate kernel-dtb (bin_type: 38), max size 0x400000
[0008.767] I> Loading ramdisk from rootfs …
[0008.767] I> rootfs path: /sdmmc_user/boot/initrd
[0008.845] I> Kernel hdr @0xa42b0000
[0008.845] I> Kernel dtb @0x90000000
[0008.845] I> decompressor handler not found
[0008.845] I> Copying kernel image (34265104 bytes) from 0xa42b0000 to 0x80080000 … [0008.856] I> Done
[0008.857] I> Updated bpmp info to DTB
[0008.858] I> Ramdisk: Base: 0x92000000; Size: 0x54ec8f
[0008.858] I> Updated initrd info to DTB
[0008.858] W> WARN: Fail to override “console=none” in commandline
[0008.859] E> tegrabl_linuxboot_add_disp_param, du 0 failed to get display params
[0008.865] E> tegrabl_linuxboot_add_disp_param, du 0 failed to get display params
[0008.872] E> tegrabl_linuxboot_add_disp_param, du 0 failed to get display params
[0008.879] W> No valid slot number is found in scratch register
[0008.885] W> Return default slot: _a
[0008.889] I> Active slot suffix:
[0008.892] I> add_boot_slot_suffix: slot_suffix =
[0008.896] I> Linux Cmdline: console=ttyTCU0,115200 video=tegrafb no_console_suspend=1 earlycon=tegra_comb_uart,m
[0008.921] I> Updated bootarg info to DTB
[0008.925] W> MAC addr invalid!
[0008.927] E> Failed to get WIFI MAC address
[0008.931] W> MAC addr invalid!
[0008.934] E> Failed to get Bluetooth MAC address
[0008.939] I> eeprom_get_mac_addr: MAC (type: 2): 48:b0:2d:05:a1:af
[0008.945] E> “plugin-manager” doesn’t exist, creating
[0008.950] I> Adding /chosen/plugin-manager/cvm
[0008.954] E> “chip-id” doesn’t exist, creating
[0008.958] I> Adding /chosen/plugin-manager/chip-id
[0008.963] E> “configs” doesn’t exist, creating
[0008.967] I> Adding /chosen/plugin-manager/configs
[0008.972] E> “ids” doesn’t exist, creating
[0008.976] I> Adding /chosen/plugin-manager/ids
[0008.980] E> “odm-data” doesn’t exist, creating
[0008.985] I> Adding /chosen/plugin-manager/odm-data
[0008.992] E> “memory” doesn’t exist, creating
[0008.994] I> [0] START: 0x80000000, END: 0xac000000
[0008.998] I> [1] START: 0xac004000, END: 0xf09d0000
[0009.003] I> [2] START: 0xf09dc000, END: 0xf09e0000
[0009.008] I> dram_block larger than 80000000
[0009.012] I> [3] START: 0x100000000, END: 0x280000000
[0009.017] I> added [base:0x80000000, size:0x2c000000] to /memory
[0009.022] I> added [base:0xac200000, size:0x44600000] to /memory
[0009.028] I> added [base:0x100000000, size:0x180000000] to /memory
[0009.035] I> Updated memory info to DTB
[0009.038] E> add_disp_param: failed to get display params for du=0
[0009.044] E> “reset” doesn’t exist, creating
[0009.049] I> NVG: Logical CPU: 0; MPIDR: 0x80000000
[0009.053] I> NVG: Logical CPU: 1; MPIDR: 0x80000001
[0009.058] I> NVG: Logical CPU: 2; MPIDR: 0x80000100
[0009.062] I> NVG: Logical CPU: 3; MPIDR: 0x80000101
[0009.067] I> NVG: Logical CPU: 4; MPIDR: 0x80000200
[0009.072] I> NVG: Logical CPU: 5; MPIDR: 0x80000201
[0009.077] I> Deleted cpu@6 node in DT
[0009.080] I> Deleted cpu@7 node in DT
[0009.084] I> Deleted cluster3 node in FDT
[0009.088] I> Update arm-pmu in FDT
[0009.091] I> - update property: interrupts
[0009.095] I> - update property: interrupt-affinity
[0009.100] E> “misc-data” doesn’t exist, creating
[0009.104] I> Boot-device: QSPI
[0009.107] W> Unknown boot device
[0009.110] I> Add storage-qspi to plugin-manager/misc-data
[0009.115] W> Unknown storage device
[0009.118] I> Add serial number:1421320004307 as DT property
[0009.124] I> Plugin-manager override starting
[0009.128] I> node /plugin-manager/fragement-tegra-wdt-en matches
[0009.136] I> node /plugin-manager/fragement-tegra-sdhci-sd-dis matches
[0009.142] I> node /plugin-manager/fragment-pcie-c5-rp matches
[0009.148] I> Disable plugin-manager status in FDT
[0009.150] I> Plugin-manager override finished successfully
[0009.156] I> tegrabl_load_kernel_and_dtb: Done
[0009.160] E> tegrabl_display_clear: display is not initialized
[0009.165] W> Boot logo display failed…
[0009.169] I> Kernel EP: 0x80080000, DTB: 0x90000000
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.9.140-tegra (buildbrain@mobile-u64-3193) (gcc version 7.3.1 20180425 [linaro-7.3-20
[ 0.000000] Boot CPU: AArch64 Processor [4e0f0040]
[ 0.000000] OF: fdt:memory scan node memory, reg size 48,
[ 0.000000] OF: fdt: - 80000000 , 2c000000
[ 0.000000] OF: fdt: - ac200000 , 44600000
[ 0.000000] OF: fdt: - 100000000 , 180000000
[ 0.000000] earlycon: tegra_comb_uart0 at MMIO32 0x000000000c168000 (options ‘’)
[ 0.000000] bootconsole [tegra_comb_uart0] enabled
��WARNING: at platform/drivers/pg/pg-cv-t194.c:73
WARNING: at platform/drivers/pg/pg-cv-t194.c:73
WARNING: at platform/drivers/pg/pg-cv-t194.c:73
WARNING: at platform/drivers/pg/pg-cv-t194.c:73
WARNING: pll_d2 has no dyn ramp
WARNING: at platform/drivers/pg/pg-gpu-t194.c:185
WARNING: at platform/drivers/pg/pg-gpu-t194.c:185
WARNING: at platform/drivers/pg/pg-cv-t194.c:73
WARNING: at platform/drivers/pg/pg-cv-t194.c:73
��bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell

Any ideas?

Related issue:

The only way to currently flash is to flash everything (except the system image)

$ sudo ./flash.sh -r --no-systemimg jetson-xavier-nx-devkit-emmc mmcblk0p1

I use the following Makefile target to make DTB updates easier (well, easier in my opinion at least!). With these rules I can execute make sync-dtb. We have a few more rules that make it so we can execute make sync no matter the Jetson device. It updates the kernel and dtb without putting the device in recovery mode. I find this very convenient for kernel development!

sync-dtb: sign-dtb
	$(vecho) "SYNC     $(SIGNED_DTB)"
	$(v)scp $(SIGNED_DTB) @TARGET_HOST@:~/device_tree.dtb.encrypt
	$(v)ssh @TARGET_HOST@ sudo dd if=device_tree.dtb.encrypt of=/dev/disk/by-partlabel/kernel-dtb

$(DEPLOY_BUILD_PATH)/boot/%_sigheader.dtb.encrypt: $(DTB_BUILD_PATH)/%.dtb
	$(vecho) "SIGN      $^"
	$(v)cd $(DEPLOY_BUILD_PATH)/boot; \
		@L4TDIR@/bootloader/tegraflash.py --chip $(FLASH_CHIP_ID) \
		--cmd "sign $^" --skipuid;

sign-dtb: $(SIGNED_DTB)

SIGNED_DTB=$(DEPLOY_BUILD_PATH)/boot/$(patsubst %.dtb,%_sigheader.dtb.encrypt,$(notdir @DTB_FILE@))

That’s one way. Another way is to just copy the signed dtb and the .sig file to /boot/ on the device and add an FDT line to extlinux.conf. Cboot looks for the file first before pulling from the flash storage.

Oh, I didn’t realize cboot was back to reading FDT from extlinux.conf. That’s great if it’s doing that again!

Hi,
It looks like I used the wrong DTB.
We are developing camera drive for the NX. The resulted DTB is :
tegra194-p3668-p3509-0000.dtb
And that’s the one that caused the NX to halt during boot.
Once I have changes the dtb to:
tegra194-p3668-all-p3509-0000.dtb
and flash using this command:
sudo ./flash.sh -r -k kernel-dtb jetson-xavier-nx-devkit-emmc mmcblk0p1
The system was able to boot.