报错一:No such file or directory: 'dtc'
在使用 SDK Manager 刷写Jetson Linux 时,在完成了 Creating OS image 时,无法往下进行,直接报错fail。查看 Terminal 报错信息显示如下:
14:56:20 ERROR: Flash Jetson Linux - flash: File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
14:56:20 ERROR: Flash Jetson Linux - flash: FileNotFoundError: [Errno 2] No such file or directory: 'dtc'
14:56:20 ERROR: Flash Jetson Linux - flash: --- Error: Reading board information failed.
14:56:20 ERROR: Flash Jetson Linux - flash: command terminated with error
14:56:20 SUMMARY: DateTime Target Setup - target: Depends on failed component
解决方案
使用 控制台刷写sudo ./nvsdkmanager_flash.sh --storage nvme0n1p1
可以看到详细错误:
Traceback (most recent call last):
File "/home/sangsq/nvidia/nvidia_sdk/JetPack_5.1.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/bootloader/tegraflash.py", line 1383, in <module>
tegraflash_run_commands()
File "/home/sangsq/nvidia/nvidia_sdk/JetPack_5.1.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/bootloader/tegraflash.py", line 1217, in tegraflash_run_commands
interpreter.onecmd(command)
File "/usr/lib/python3.8/cmd.py", line 217, in onecmd
return func(arg)
File "/home/sangsq/nvidia/nvidia_sdk/JetPack_5.1.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/bootloader/tegraflash.py", line 855, in do_dump
self.chip_inst.tegraflash_dump(exports, args)
File "/home/sangsq/nvidia/nvidia_sdk/JetPack_5.1.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/bootloader/tegraflash_impl_t234.py", line 2387, in tegraflash_dump
self.tegraflash_preprocess_configs()
File "/home/sangsq/nvidia/nvidia_sdk/JetPack_5.1.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/bootloader/tegraflash_impl_t234.py", line 360, in tegraflash_preprocess_configs
values[config] = self.run_dtc_tool(
File "/home/sangsq/nvidia/nvidia_sdk/JetPack_5.1.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/bootloader/tegraflash_impl_t234.py", line 3290, in run_dtc_tool
run_command(command, False)
File "/home/sangsq/nvidia/nvidia_sdk/JetPack_5.1.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/bootloader/tegraflash_internal.py", line 277, in run_command
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=use_shell, env=cmd_environ)
File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'dtc'
--- Error: Reading board information failed.
错误消息表明程序无法找到预处理配置文件所需的“dtc”工具。这可能是由于系统上缺少或损坏了设备树编译器(dtc)的安装。
要解决此问题,可以尝试在终端中运行以下命令来重新安装dtc工具:
sudo apt-get install device-tree-compiler
这应该安装dtc工具并解决FileNotFoundError问题。安装该工具后,可以再次尝试运行该程序,看看问题是否已经解决。
报错二:ERROR sshpass not found 等其他执行刷写的依赖包
Terminal 报错并不详尽,使用控制台重试刷写操作,可以发现:
--- Reading board information succeeded.
Parsing module EEPROM:
--- Parsing board ID (3767) succeeded.
--- Parsing board version (300) succeeded.
--- Parsing board SKU (0003) succeeded.
--- Parsing board REV (L.3) succeeded.
jetson-orin-nano-devkit found.
Parsing boardid successful
Target board is jetson-orin-nano-devkit
External storage specified nvme0n1p1
Flashing Jeton Orin Nano
/home/sangsq/nvidia/nvidia_sdk/JetPack_5.1.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/tools/kernel_flash/l4t_initrd_flash_internal.sh --no-flash --external-device nvme0n1p1 -c tools/kernel_flash/flash_l4t_external.xml --showlogs --network usb0 -p --no-systemimg -c bootloader/t186ref/cfg/flash_t234_qspi.xml jetson-orin-nano-devkit internal
ERROR sshpass not found! To install - please run: "sudo apt-get install sshpass"
Cleaning up...
解决方案
根据提示安装 sshpass
sudo apt-get install sshpass
同时可能还缺少其他的软件包:
sudo apt-get install abootimg
sudo apt-get install nfs-kernel-server
sudo apt-get install libxml2-utils
使用以上命令安装依赖。
结论
出现问题可以通过 Terminal 查看其执行的命令,在控制台中运行可以看到更详细的报错信息,通过这些信息可以更方便的找到问题的源头以定位处理。
另外,当使用SDKM刷写失败时,也可以直接前往操作目录,尝试直接使用命令行的方式刷写处理。