Building and Flashing Kernel and Device Trees


I’ve read lots of documentation about building and flashing the kernel and dtb files and typically follow the following guides

I’ve been successful on the TX2 using Jetpack 3.2.1 but since moving to Jetpack 4.2 have has some difficulties.

I managed to build and flash the kernel and device tree successfully but have managed to break things by making changes to the device tree to get the USB ports working on the J120 carrier board, as I previously did for 3.2.1. I have tried to revert my changes but this has no effect, so I am obviously missing something.

There is some different information regarding flashing the dtb, i.e. one recommendation is

cp $DEVDIR/images/arch/arm64/boot/dts/tegra186-quill-p3310-1000-c03-00-base.dtb $DEVDIR/kernel/dtb
sudo ./ 
sudo ./ -r -d kernel/dtb/tegra186-quill-p3310-1000-c03-00-base.dtb -K kernel/Image jetson-tx2 mmcblk0p1

And another

cp $DEVDIR/images/arch/arm64/boot/dts/*.dtb $DEVDIR/kernel/dtb
cp $DEVDIR/images/arch/arm64/boot/dts/*.dtb $DEVDIR/bootloader
cp $DEVDIR/images/arch/arm64/boot/dts/*.dtb $DEVDIR/rootfs/boot 
sudo ./ -r -k kernel-dtb jetson-tx2 mmcblk0p1

There are guides available to follow but with minimal explanation as to what is going on. I appreciate that there is a lot going on when building and flashing and explaining everything would be information overload, however I would like to understand things more to help diagnose my problem. I therefore have some questions to help clarify things.

1)Given that a lot of dtb files get built, how many of them need to be flashed onto the target?
2)When we rebuild the device tree, do we need to create a new system image or can we simply flash the dtb files? I have found that for J120 patch on Jetpack 3.2.1 a new system image was required and the kernel-dtb option was required.
3)Do the dtb files need to be copied to the bootloader folder?.
4)Is there anything else I have missed? It would be good to know the things to check rather than blindly following a guide.

Thanks in advance.

Hi Marc,

  1. Only one dtb file has to be flashed. For example in this command:
sudo ./ -r -d kernel/dtb/tegra186-quill-p3310-1000-c03-00-base.dtb -K kernel/Image jetson-tx2 mmcblk0p1

the only dtb file that is flashed is the tegra186-quill-p3310-1000-c03-00-base.dtb

  1. You can only flash the dtb by running the following command:
sudo ./ -r -k kernel-dtb -d kernel/dtb/tegra186-quill-p3310-1000-c03-00-base.dtb jetson-tx2 mmcblk0p1

, there is no need to regenerate another image since that should only be afecting the filesystem.

  1. No, there’s no need for that

  2. You should double check that the dtb that you are flashing is the one that you are modifying.

Also, are you using the Auvidea firmware changes?:

Thanks for your help. This clarifies a lot for me. I think the problem I was seeing was due to a bad hdmi connection to my monitor, with the black screen making me thing the flashed dtb had broke things.

Yes I am using the Auvidea firmware changes. I can get the new firmware working on the J120 by including their changes to the following files