본 글에서는 Jetson Orin NX/NANO 모듈을 복제하고 "l4t_backup_restore.sh" 스크립트 파일을 사용하여 다른 모듈을 복원합니다.
Orin NX/NANO 는 기본적으로 emmc를 사용하지 않고 Nvme ssd 나 usb 부팅 방식을 사용하기 때문에 기존에 사용하던 backup 이미지 생성 방식과는 다르다.
Orin NX/NANO BSP 폴더에 있는 l4t_bakcup_restore.sh 은 기본적으로 emmc를 기준으로 설정되어 있다. 이를 NVMe SSD에 작동하게 하려면 다음과 같이 설정을 바꿔야 한다.
nvbackup_partitions.sh과 nvrestore_partitions.sh 파일을 열어 mmcblk0을 nvme0 n1로 수정해 준다.
gedit Linux_for_Tegra/tools/backup_restore/nvbackup_partition.sh
gedit Linux_for_Tegra/tools/backup_restore/nvrestore_partition.sh
한 번에 수정할 수 있게 Ctrl + H 버튼을 눌러 mmcblk0 을 nvme0n1 변경한다.
아래 명령어를 통해서도 변경이 가능하다.
sudo sed -i "s/mmcblk0/nvme0n1/g" tools/backup_restore/nvbackup_partitions.sh
sudo sed -i "s/mmcblk0/nvme0n1/g" tools/backup_restore/nvrestore_partitions.sh
Backup을 수행하기 전 Linux_for_Tegra/bootloader/tegra234-mb2-bct-misc-p3767-0000.dts 파일을 열어 아래와 같이 수정해 준다.
*본 글에서 사용하고 있는 Orin NX/NANO carrier board는 eeprom이 달려있지 않아 flash 과정 중에 eeprom 읽는 부분에서 에러가 발생한다. 하지만 Orin NX/NANO Devkit 버전에서는 해당 작업을 안 해도 무관하다.
cvb_eeprom_read_size = <0x100> -> cvb_eeprom_read_size = <0x0>;
Backup:
ORIN NX :
$ sudo ./tools/backup_restore/l4t_backup_restore.sh -b p3509-a02+p3767-0000
ORIN NANO :
$ sudo ./tools/backup_restore/l4t_backup_restore.sh -b jetson-orin-nano-devkit
정상적으로 Backup이 되었다면 backup_restore에 images 폴더와 그 안에 압축파일이 생성된다.
생성된 images 폴더를 압축해 준다.
sudo tar -jcvpf 파일명.tar.bz2 images
적용하고 싶은 BSP 폴더에 압축을 풀어준다.
sudo tar -jcxpf 파일명.tar.bz2 Linux_for_Tegra/tools/backup_restore
그다음 Orin NX/NANO 를 Recovery Mode로 변경 후 복원을 진행한다.
RECOVERY MODE :
0955:7323 NVidia Corp for Orin NX 16GB
0955:7423 NVidia Corp for Orin NX 8GB
0955:7523 NVidia Corp for Orin Nano 8GB
0955:7623 NVidia Corp for Orin Nano 4GB
Restore:
ORIN NX :
$ sudo ./tools/backup_restore/l4t_backup_restore.sh -r p3509-a02+p3767-0000
ORIN NANO :
$ sudo ./tools/backup_restore/l4t_backup_restore.sh -r jetson-orin-nano-devkit
TroubleShooting:
백업 진행 하던 중 발생한 에러
1. PARTITION 에러
아래 오류 발생 시 사용 중인 NVME SSD 포맷 진행 시 GPT 타입으로 했는지 확인
Run command:
ln -s /proc/self/fd /dev/fd && mount -o nolock [fc00:1:1::1]:/home/zebes/Documents/Linux_for_Tegra/tools/backup_restore /mnt && /mnt/nvrestore_partitions.sh -n
on root@fc00:1:1::2
/mnt/images ~
nvrestore_partitions.sh: Use the default nvpartitionmap.txt as the index file.
partx: specified range <1:0> does not make sense
2. BOARD MATCH 에러
해당 에러는 모듈마다 버전(?) 다른 거 같은 고로 에러 발생 시 nvrestore_partitons.sh 수정이 필요
Waiting for target to boot-up...
Waiting for device to expose ssh ......RTNETLINK answers: File exists
RTNETLINK answers: File exists
Device has booted into initrd. You can ssh to the target by the command:
$ ssh root@fe80::1%usb0
Cleaning up...
Log is saved to Linux_for_Tegra/initrdlog/flash_3-1_0_20230731-162502.log
Run command:
ln -s /proc/self/fd /dev/fd && mount -o nolock [fc00:1:1::1]:/home/ubuntu/nvidia/nvidia_sdk/JetPack_5.1.1_Linux_JETSON_ORIN_NX_TARGETS/Linux_for_Tegra/tools/backup_restore /mnt && /mnt/nvrestore_partitions.sh -n
on root@fc00:1:1::2
/mnt/images ~
nvrestore_partitions.sh: Use the default nvpartitionmap.txt as the index file.
/mnt/nvrestore_partitions.sh: line 415: syntax error: unexpected end of file
nvrestore_partitons.sh 파일의 244행부터 248 행까지 주석 처리 후 다시 restore 진행 시 에러가 나타나지 않음
출처 :
Orin NX 8G restore failed with the backup_restore tool
I only changed the code below. #done #if [ ${BOARD_MATCH} = false ]; then # echo "${SCRIPT_NAME}: You are trying to flash images from a board model that does not" # echo "match the current board you're flashing onto." # exit 1 #fi And this is the script I
forums.developer.nvidia.com
'NVIDIA > Orin NX' 카테고리의 다른 글
Orin NX/NANO Lane Polarity (0) | 2024.11.17 |
---|---|
JETPACK 5 Flash (0) | 2023.08.22 |
Jetson GPIO Control (0) | 2023.07.01 |