Modified DTB not getting updated

Hi,

I took the /boot/dtb/tegra194-p3668-all-p3509-0000.dtb file from my Xavier NX, decompiled it to .dts file and modified to add a new codec over SPI interface. So when I try to flash the modified dtb back into the xavier according to the steps mentioned here, the console finally shows
*** The [kernel-dtb] has been updated successfully. ***
at the end, but the new Device Tree is not getting loaded. It is still the same old DTB. What am I missing here?

Can anybody please help me?

Thanks,
Abhigyan

  1. Which software version is in use here?

  2. Please also dump the uart log

  3. Please list out the whole commands you used.

  1. Jetpack 4.6

  2. Is Serial log.txt (71.4 KB) the one that you are asking for?

  3. After making changes to the dts file as mentioned above, I compiled it using
    dtc -I dts -O dtb -o tegra194-p3668-all-p3509-0000.dtb output.dts
    and then flashed using:
    sudo ./flash.sh -k kernel-dtb jetson-xavier-nx-devkit mmcblk0p1

Like in this post, is it ok to just copy the dtb to /boot/?

Thanks,
Abhigyan

No, copy to /boot won’t work… the flash path is kernel/dtb.

Ok, so can you please tell me why the changes in the DT are not taking effect?

  1. No, Serial log.txt is not the uart log.
  1. Please try to tell more about how do you copy your dtb. For example, after you convert it back to “ouput.dts”, then what did you do on your side?

I took the /boot/dtb/tegra194-p3668-all-p3509-0000.dtb file from the Xavier and copied it to the home directory in my host.
Then I decompiled it to output.dts using dtc -I dtb -O dts -o output.dts tegra194-p3668-all-p3509-0000.dtb .
Then I made the following changes to the dts file:

spi@3210000 {
		...

		cs47l35: spi@0 {
			compatible = "cirrus,cs47l35";
			spi-max-frequency = <0x5b8d80>; 
			reg = <0x00>;
		};
sound {
		...
		nvidia,audio-routing = "x Headphone\0x OUT
								\0x IN\0x Mic
								\0y Headphone\0y OUT
								\0y IN\0y Mic
								\0z	Headphone\0z OUT
								\0z IN\0z Mic
								\0m Headphone\0m OUT
								\0m IN\0m Mic
								\0n	Headphone\0n OUT
								\0n IN\0n Mic
								\0o Headphone\0o OUT
								\0o IN\0o Mic
								\0a	IN\0a Mic
								\0b IN\0b Mic
								\0c IN\0c Mic
								\0d IN\0d Mic
								\0[78 00] Headphone\0[78 00] HPOUTL
								\0[78 00] Headphone\0[78 00] HPOUTR";
...

nvidia,dai-link-5 {
			link-name = "cs47l35-codec";
			cpu-dai = <&cs47l35_i2s5>;
			codec-dai = <&cs47l35>;
			cpu-dai-name = "I2S5";
			codec-dai-name = "cs47l35-aif1";
			format = "i2s";
			bit-format = "s16_le";
			srate = <0xbb80>; 
			num-channel = <0x02>;
			ignore_suspend;
			name-prefix = [78 00];
			status = "okay";
			#linux,phandle = <0xc3>;
			#phandle = <0xc3>;
		};
cs47l35_i2s5: i2s@2901400 {
				compatible = "nvidia,tegra210-i2s";
				reg = <0x00 0x2901400 0x00 0x100>;
				nvidia,ahub-i2s-id = <0x04>;
				clocks = <0x04 0x40 0x04 0x68 0x04 0x41 0x04 0x95 0x04 0x41>;
				clock-names = "i2s\0i2s_clk_parent\0ext_audio_sync\0audio_sync\0clk_sync_input";
				assigned-clocks = <0x04 0x40>;
				assigned-clock-parents = <0x04 0x68>;
				assigned-clock-rates = <0xbb8000>;
				fsync-width = <0x1f>;
				status = "okay";
				linux,phandle = <0x32>;
				phandle = <0x32>;
			};

After this, I compiled it back to .dtb using the command: dtc -I dts -O dtb -o tegra194-p3668-all-p3509-0000.dtb output.dts

Then moved tegra194-p3668-all-p3509-0000.dtb to
/nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_XAVIER_NX_TARGETS/Linux_for_Tegra/kernel/dtb/ and then ran the flash.sh in /nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_XAVIER_NX_TARGETS/Linux_for_Tegra/ using: sudo ./flash.sh -k kernel-dtb jetson-xavier-nx-devkit mmcblk0p1

Please dump the log.

Hi, I don’t see any ttyUSB as mentioned here. I am using Xavier NX from a Virtual Machine running Ubuntu 18.04. But when I do a lsusb, I see a Bus 002 Device 015: ID 0955:7020 NVidia Corp.

VM may not support well. Please use native 18.04 host.

If you are using NX, please refer to:

Need to buy extra cable.

I will share the log as soon as possible. And are the changes made in the Device Tree as mentioned above correct?

I don’t read your device tree content. They are not related to the issue here.

But your step to flash should be correct.

Hi, here is the uart log.txt (27.6 KB)

Previously when flashing didn’t work, I also tried to copy the .dtb to /boot/dtb and /boot/ before posting here. As expected, it didn’t work.

Hi,

Your log reveals what is going on here.

[0004.239] I> Look for boot partition
[0004.239] I> Fallback: assuming 0th partition is boot partition
[0004.239] I> Detect filesystem
[0004.260] I> Loading extlinux.conf …
[0004.260] I> rootfs path: /sd/boot/extlinux/extlinux.conf
[0004.289] I> L4T boot options
[0004.289] I> [1]: “primary kernel”
[0004.289] I> [2]: “Custom 40-pin Header Config”
[0004.290] I> Enter choice:
[0007.291] I> Continuing with default option: 2
[0007.291] I> Loading kernel sig file from rootfs …
[0007.291] I> rootfs path: /sd/boot/Image.sig
[0007.304] I> Loading kernel binary from rootfs …
[0007.304] I> rootfs path: /sd/boot/Image
[0010.129] I> Validate kernel …
[0010.129] I> T19x: Authenticate kernel (bin_type: 37), max size 0x5000000
[0010.458] I> Loading kernel-dtb sig file from rootfs …
[0010.458] I> rootfs path: /sd/boot/tegra194-p3668-all-p3509-0000-user-custom.dtb.sig
[0014.592] I> lookup_linear_dir:441: Invalid file block num
[0014.593] I> ext2_walk:142: ‘tegra194-p3668-all-p3509-0000-user-custom.dtb.sig’ lookup failed
[0014.593] I> ext4_open_file:647: ‘/boot/tegra194-p3668-all-p3509-0000-user-custom.dtb.sig’ lookup failed
[0014.594] E> file /sd/boot/tegra194-p3668-all-p3509-0000-user-custom.dtb.sig open failed!!
[0014.599] W> Failed to load kernel-dtb sig file (err=202113041)
[0014.604] I> Loading kernel-dtb binary from rootfs …
[0014.609] I> rootfs path: /sd/boot/tegra194-p3668-all-p3509-0000-user-custom.dtb
[0014.647] I> Validate kernel-dtb …

Since you once used the jetson-io, extlinux.conf tells cboot to load dtb from /sd/boot/tegra194-p3668-all-p3509-0000-user-custom.dtb on your sdcard.

I took the tegra194-p3668-all-p3509-0000.dtb, renamed it to tegra194-p3668-all-p3509-0000-user-custom.dtb, copied it to /sd/boot/ and reconfigured the pins using jetson-io. Checked in /sd/proc/device-tree/ and the DT seems to load now. So is this it?

For your case, yes.

Make it more easier to understand, we have multiple methods to load dtb. If you never tried any customization, then the default one will be on the kernel-dtb partition. However, since your case is not the default setting, kenrel dtb is loaded from somewhere else.

That is why need to dump the uart log to find the answer.

Can you please tell me why it worked without flashing? What exactly is the difference?

Thanks for the help. :)

Abhigyan.

The uart log already told.

We checked your extlinux.conf. It says “load the dtb from sdcard with path “boot/tegra194-p3668-all-p3509-0000-user-custom.dts””.

If there is no such one mentioned in extlinux.conf, then it will read from partition. For any case read from partition, then it has to be updated by using flash.