Lasiyan
Tech

JetPack 5.1.2 버전에서 ttyTHS1가 없을 때

#Jetson#JetPack#Linux#DTB#UART

문제 환경

  • OS: JetPack 5.1.2
  • HW: Custom Carrier B’d + Jetson Orin NX

증상

user@user-desktop:~$ ll /dev/ttyTHS1
ls: cannot access '/dev/ttyTHS1': No such file or directory

해결 방법

DTB 파일을 Decompile -> Edit -> Compile 순서로 진행한다.

Decompile

먼저 본인의 /boot/dtb 폴더에 존재하는 .dtb 파일을 체크한다.

user@user-desktop:~$ ll /boot/dtb/
total 356
drwxr-xr-x 2 root root   4096 Apr 15 15:37 ./
drwxr-xr-x 4 root root  12288 May 20 16:04 ../
-rw-r--r-- 1 root root 346787 Jun 25 10:51 kernel_tegra234-p3767-0000-p3768-0000-a0.dtb

해당 파일을 Decompile하여 디바이스 트리 파일을 생성한다.

# 파일명은 개인마다 다르므로 위에서 확인된 파일을 사용한다.
sudo dtc -I dtb -O dts -o devicetree.dts /boot/dtb/kernel_tegra234-p3767-0000-p3768-0000-a0.dtb

Edit

De-compile시 경고가 발생하지만 정상적으로 devicetree.dts파일이 생성되었으면 serial@3110000 문구를 검색한다. 그럼 아래와 같은 블록이 보인다.

여기서 status 값을 disabled에서 okay로 변경한다.

serial@3110000 {
    compatible = "nvidia,tegra194-hsuart";
    iommus = <0x06 0x04>;
    dma-coherent;
    reg = <0x00 0x3110000 0x00 0x10000>;
    reg-shift = <0x02>;
    interrupts = <0x00 0x71 0x04>;
    nvidia,memory-clients = <0x0e>;
    dmas = <0x3f 0x09 0x3f 0x09>;
    dma-names = "rx\0tx";
    clocks = <0x02 0x9c 0x02 0x66>;
    clock-names = "serial\0parent";
    resets = <0x02 0x65>;
    reset-names = "serial";
    status = "okay"; # 여기 부분을 disabled에서 okay로 수정한다.
    phandle = <0x2ff>;
};

Compile

수정 후 dts파일을 다시 dtb로 컴파일하고 기존 파일에 덮어쓴다.

sudo dtc -I dts -O dtb devicetree.dts -o /boot/dtb/kernel_tegra234-p3767-0000-p3768-0000-a0.dtb

참조

https://forums.developer.nvidia.com/t/missing-dev-ttyths1-for-uart0-uartb-on-nvidia-jetson-orin-nx/249685/7

https://gist.github.com/TobidieTopfpflanze/c162f551ffc4a2be21dbd168371ef347