TX2 UARTS

the line

dtc -I dts -o /boot/modified_tegra186-quill-p3310-1000-c03-00-base.dtb extracted.dts

has an argument -I which you did set to dts
it means that you are using inputr file format there of source type

-I, --in-format <arg>      
	Input formats are:
		dts - device tree source text
		dtb - device tree blob
		fs  - /proc/device-tree style directory

than you say to create dtb file from extracted.dts there.

However the phrase "I created modified_tegra186-quill-p3310-1000-c03-00-base.dtb extracted.dts file "

has two files mentioned"

As I understand you should have created the extracted.dts file first from the existing dtb file and than edit it and than create the dtb from the edited dts file.
How did you create extracted.dts file?
In my case it returns:

root@tegra-ubuntu:/tmp# dtc -I dtb -o dts extracted.dts /boot/tegra186-quill-p3310-1000-c03-00-base.dtb 
Usage: dtc [options] <input file>

Options: -[qI:O:o:V:d:R:S:p:fb:i:H:sW:E:hv]
  -q, --quiet                
	Quiet: -q suppress warnings, -qq errors, -qqq all
  -I, --in-format <arg>      
	Input formats are:
		dts - device tree source text
		dtb - device tree blob
		fs  - /proc/device-tree style directory
  -o, --out <arg>            
	Output file
  -O, --out-format <arg>     
	Output formats are:
		dts - device tree source text
		dtb - device tree blob
		asm - assembler source
  -V, --out-version <arg>    
	Blob version to produce, defaults to %d (for dtb and asm output)
  -d, --out-dependency <arg> 
	Output dependency file
  -R, --reserve <arg>        
	tMake space for <number> reserve map entries (for dtb and asm output)
  -S, --space <arg>          
	Make the blob at least <bytes> long (extra space)
  -p, --pad <arg>            
	Add padding to the blob of <bytes> long (extra space)
  -b, --boot-cpu <arg>       
	Set the physical boot cpu
  -f, --force                
	Try to produce output even if the input tree has errors
  -i, --include <arg>        
	Add a path to search for include files
  -s, --sort                 
	Sort nodes and properties before outputting (useful for comparing trees)
  -H, --phandle <arg>        
	Valid phandle formats are:
		legacy - "linux,phandle" properties only
		epapr  - "phandle" properties only
		both   - Both "linux,phandle" and "phandle" properties
  -W, --warning <arg>        
	Enable/disable warnings (prefix with "no-")
  -E, --error <arg>          
	Enable/disable errors (prefix with "no-")
  -h, --help                 
	Print this help and exit
  -v, --version              
	Print version and exit

Error: missing files

Yes, by mistake I copied whole line in my previous post.

This is what I have done:

I created “extracted.dts” file via command:

dtc -I dtb -o extracted.dts /boot/tegra186-quill-p3310-1000-c03-00-base.dtb

Then modified it and created “modified_tegra186-quill-p3310-1000-c03-00-base.dtb” using command:

dtc -I dts -o /boot/modified_tegra186-quill-p3310-1000-c03-00-base.dtb extracted.dts

Edit: To create these files I had to change “-o dts” and “-o dtb” to “-o” and “-o”

thanks for the update
that way it creates the file at the /boot folder with size 333041 bytes [not modified]
from your log file it seems that it loads the file somwhow from there

Retrieving file: /boot/modified_tegra186-quill-p3310-1000-c03-00-base.dtb
333037 bytes read in 85 ms (3.7 MiB/s)

If you do the factory reset you need to connect the Host OS with the Jetson, power on the Jetson and hold the force recovery mode button, than press reset button, than wait ~2 seconds and release the force recovery button. Than you can try run JetPack 3.0 from the Host OS and perform the flash OS.

I see this in the U-Boot info you posted:

boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf


if you can find a way to copy or download a new extlinux.conf anywhere (e.g., ext4write), then edit of this variable to point at the new extlinux.conf would do the job. For example, if you can create a new extlinux.conf directly in the root partition (“/extlinux.conf” instead of “/boot/extlinux/extlinux.conf”), then this should do the job.

The reason loading anything in U-Boot for the dtb fails is because at the moment extlinux.conf is read the extlinux.conf tells it to search for the missing dtb file
this failure will block boot even if valid dtb info is ready
it is the search for the missing file which blocks, and is unrelated to the actual data provided by that file.

Trivia: dtc is actually part of the kernel source, and is also generally available as a package download. You couldn’t use the binary dtc from an x86_64 machine directly on the Jetson (you couldn’t copy the binary to the Jetson). You can enable the right repository (I don’t know which) and the Jetson can have a compatible dtc, or you could compile it from the kernel source (dtc does not need a 32-bit compiler so you should be able to directly compile it on the Jetson).

@linuxdev: thank you for the update

The dtc installed on the jetson by default in /usr/src/linux-headers-4.4.15-tegra/scripts/dtc/dtc is an x86 executable, likely just copied over from the host:

> file dtc
dtc: ELF 64-bit LSB executable, x86-64...

It needs to be rebuilt for the TX2 (ARM aarch64).

(ESJS) retreived from https://devtalk.nvidia.com/default/topic/1001771/jetson-tx2/no-usb-support-on-custom-base-carrier-board/post/5132201/#5132201

Here’s what I have:

sudo apt-get install device-tree-compiler
which dtc
# replies /usr/bin/dtc
file /usr/bin/dtc
# Replies "/usr/bin/dtc: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1..."

This version installed by the package manager runs on the Jetson
I suspect the one in header files were published without first running make clean. The header version is not intended to be shipped with dtc and should not be part of any source distribution
basically it’s an oversight.

Unfortunatelly I did not manage to boot Jetson, so finally I performed Factory Reset.

Now I realized there is a patch, which enables /ttyTHS2 device: 0001-dts-quill-common-enable-uartc-instance.patch. Could anyone tell me how to apply this patch, as I don’t want to mess anything up again?

What that patch does is update the device tree. The complicated way of doing this is to patch parts of kernel source code, configure the kernel, and build a new device tree blob. The simpler way is to turn the existing dtb file into source, and hand edit what that patch would do. This hand edited version can be recompiled. Either dtb can then be pointed at in your extlinux.conf file (just be sure the file you name is where you point extlinux.conf at).

When I created my modified dts (which is subsequently compiled back to dtb format) all I changed was one line which had this:

status = "disabled";


to instead be this:

status = "okay";


which is quite simple.

If I do a context diff between the original (decompiled) file and the edited file (which gets recompiled), this is what I see:

*** extracted_tegra186-quill-p3310-1000-c03-00-base.dts 2017-04-11 15:09:54.992228828 -0600
--- modified_tegra186-quill-p3310-1000-c03-00-base.dts  2017-04-11 15:23:48.223947168 -0600
***************
*** 4094,4100 ****
                clock-names = "serial", "parent";
                resets = <0xd 0x31>;
                reset-names = "serial";
!               status = "disabled";
                nvidia,adjust-baud-rates = <0x1c200 0x1c200 0x64>;
                linux,phandle = <0x7f>;
                phandle = <0x7f>;
--- 4094,4100 ----
                clock-names = "serial", "parent";
                resets = <0xd 0x31>;
                reset-names = "serial";
!               status = "okay";
                nvidia,adjust-baud-rates = <0x1c200 0x1c200 0x64>;
                linux,phandle = <0x7f>;
                phandle = <0x7f>;

The line at or near 4097 needs to go from “disabled” to “okay”. Then recompile with dtc (shown in an earlier post how to extract the original
then hand edit
then recompile). Place the resulting .dtb file in “/boot”, and add an FDT key/value pair pointing at this .dtb file. Reboot.

Remember, if you have a serial console, you can leave your original boot entry alone and select an alternate boot entry naming the FDT for test boot until you are satisfied it works. An example would be something like this:

TIMEOUT 30
DEFAULT primary

MENU TITLE p2771-0000 eMMC boot options

LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/Image
      APPEND fbcon=map:0 net.ifnames=0 console=tty0 OS=l4t console=ttyS0,115200n8 memtype=0 video=tegrafb no_console_suspend=1 earlycon=uart8250,mmio32,0x03100000 gpt tegraid=18.1.2.0.0 tegra_keep_boot_clocks maxcpus=6 android.kerneltype=normal androidboot.serialno=0335115020673 vpr_resize root=/dev/mmcblk0p1 rw rootwait

LABEL <b>testing</b>
      MENU LABEL <b>test kernel</b>
      LINUX /boot/Image
      <b>FDT /boot/modified_tegra186-quill-p3310-1000-c03-00-base.dts</b>
      APPEND fbcon=map:0 net.ifnames=0 console=tty0 OS=l4t console=ttyS0,115200n8 memtype=0 video=tegrafb no_console_suspend=1 earlycon=uart8250,mmio32,0x03100000 gpt tegraid=18.1.2.0.0 tegra_keep_boot_clocks maxcpus=6 android.kerneltype=normal androidboot.serialno=0335115020673 vpr_resize root=/dev/mmcblk0p1 rw rootwait

The above seems as a Grub list.
It turned out to be a delusion that dtc was of non- aarch64 nature.
What I have is:

file /usr/bin/dtc
/usr/bin/dtc: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=2ed636067a8e7f5b80309b4fbc19b16ca9654520, stripped

sorry ,i just want to know how to patch 0001-dts-quill-common-enable-uartc-instance.7z. i still can’t use j17 to capture from serial.

Extracting 0001-dts-quill-common-enable-uartc-instance.7z:

7z e 0001-dts-quill-common-enable-uartc-instance.7z

To use this the difficult way you can apply to kernel source file (or rather the set of files from the source download which has kernel and other source packaged together). See the patch file itself for details on which file when done this way.

Or you can just edit the existing dtb file. You’d reverse it to plain text, edit, and then recompile it (this is quite simple). You can name this anything you want, including keeping the original “tegra186-quill-p3310-1000-c03-00-base.dtb”. The point about adding the “extracted” or other name change is so that the original is not lost. If you reverse “tegra186-quill-p3310-1000-c03-00-base.dtb”, then recompile, you will have the same device tree. If the extlinux.conf FDT key/value pair names a dtb file
whether of the original name or edited name
any edits to the dtb will take effect on boot.

Perhaps the more subtle issue is that on a TX2 the tegra186-quill-p3310-1000-c03-00-base.dtb file is present in “/boot”, but the FDT key/value pair entry is not present in “/boot/extlinux/extlinux.conf” until you add it. Without that entry the dtb file will never be used (unless you modify the dtb file you won’t need the entry because U-Boot passes that information on by default
modifying that file and adding it as an extlinux.conf entry is what activates the change without changing everything else).

@linuxdev,I also wrongly modify the extlinux.conf, but I find command ext4load and ext4write which can load data from the mmc. In fact ,I use

  1. ext4load mmc 0 0x30008000 /boot/extlinux/extlinux.conf

then I should get the content of extlinux.conf at RAM addr 0x30008000,but it did not. Do you know why? thx.

Sorry, I just saw this
obviously it has been a long time. I have not experimented with loading extlinux.conf this way.

I facing the same issue as ‘Krzychu’ faced.
I am editing dts file by hand as per your instruction. After following all the steps. I rebooted Jetson and I am observing same thing as ‘Krzychu’ described.

Adding a device tree changed from earlier releases versus R28.1 or R28.2. Which release are you using? Did you use flash.sh to add the device tree (versus putting the dtb file in “/boot” which no longer works)?

I am using R27.1.0.
Since I generated modified dtb files on Jetson directly and placed it under the /boot folder on jetson. So hoping I don’t need to use flash.sh for copying it again.

Looks like the default in R27.1 is to not use the FDT entry, although it might still work. Here are a couple of URLs related to the topic:
[url]http://elinux.org/Jetson/TX2_DTB[/url]
[url]extlinux.conf: FDT No Longer Used for DTB File Specification? - Jetson TX2 - NVIDIA Developer Forums

Note that there are different stages of boot using different parts of the device tree. Somewhere in U-Boot a device tree gets loaded into RAM just before handing off to the kernel. I’m not sure if the FDT entry is 100% non-edited by U-Boot or not for R27.1 (R28.1 definitely edits that file and using FDT in R28.1 will definitely not do what you think it should do).

If device tree edits succeed you will see them reflected in “/proc/device-tree/”.

I am a newer, I would like to know how to make the patch so that J17 can work as /dev/ttyTHS2?

On recent releases J17 already works as “/dev/ttyTHS2”. If this is R28.1 or R28.2 there should be no issue.

My versions maybe isn’t R28.1 or R28.2. Should I continue to solve this problem or update version?

I try the following command:

dtc -I dtb -o dts extracted.dts /boot/tegra186-quill-p3310-1000-c03-00-base.dtb

but give an error ----- error:missing files

I don’t know how to solve it