Jetson Orin Nano 编译内核烧写后显示屏不亮

是的,我的编译器使用的是https://developer.nvidia.com/embedded/jetson-linux这个网址下载的9.3版本,aarch64--glibc--stable-final.tar.gz压缩包。
当我修改SYSOUT的路径后,现在是这样的:
make modules -j16
SYSSRC=~/Desktop/Folder/Linux_for_Tegra/source/public/kernel/kernel-5.10/
SYSOUT=~/Desktop/Folder/Linux_for_Tegra/source/public/kernel_out/SYSOUT/
CC=~/Desktop/Folder/l4tgcc/bin/aarch64-buildroot-linux-gnu-gcc
LD=~/Desktop/Folder/l4tgcc/bin/aarch64-buildroot-linux-gnu-ld.bfd
AR=~/Desktop/Folder/l4tgcc/bin/aarch64-buildroot-linux-gnu-ar
CXX=~/Desktop/Folder/l4tgcc/bin/aarch64-buildroot-linux-gnu-g++
OBJCOPY=~/Desktop/Folder/l4tgcc/bin/aarch64-buildroot-linux-gnu-objcopy
TARGET_ARCH=aarch64
ARCH=arm64
(我把kernel_out放在了source/public目录下,和kernel,hardware同级,我不知道这是否有问题)
执行完这个命令后,显示的报错信息是:
make -C src/nvidia
make -C src/nvidia-modeset
make[1]: Entering directory ‘/home/user/Desktop/Folder/Linux_for_Tegra/source/public/NVIDIA-kernel-module-source-TempVersion/src/nvidia’
make[1]: Entering directory ‘/home/user/Desktop/Folder/Linux_for_Tegra/source/public/NVIDIA-kernel-module-source-TempVersion/src/nvidia-modeset’
make[1]: Nothing to be done for ‘default’.
make[1]: Leaving directory ‘/home/user/Desktop/Folder/Linux_for_Tegra/source/public/NVIDIA-kernel-module-source-TempVersion/src/nvidia-modeset’
cd kernel-open/nvidia-modeset/ && ln -sf …/…/src/nvidia-modeset/_out/Linux_aarch64/nv-modeset-kernel.o nv-modeset-kernel.o_binary
make[1]: Nothing to be done for ‘default’.
make[1]: Leaving directory ‘/home/user/Desktop/Folder/Linux_for_Tegra/source/public/NVIDIA-kernel-module-source-TempVersion/src/nvidia’
cd kernel-open/nvidia/ && ln -sf …/…/src/nvidia/_out/Linux_aarch64/nv-kernel.o nv-kernel.o_binary
make -C kernel-open modules
make[1]: Entering directory ‘/home/user/Desktop/Folder/Linux_for_Tegra/source/public/NVIDIA-kernel-module-source-TempVersion/kernel-open’
make[2]: Entering directory ‘/home/user/Desktop/Folder/Linux_for_Tegra/source/public/kernel/kernel-5.10’
make[3]: Entering directory ‘/home/user/Desktop/Folder/Linux_for_Tegra/source/public/kernel_out/SYSOUT’

ERROR: Kernel configuration is invalid.
include/generated/autoconf.h or include/config/auto.conf are missing.
Run ‘make oldconfig && make prepare’ on kernel src to fix it.

make[3]: *** [/home/user/Desktop/Folder/Linux_for_Tegra/source/public/kernel/kernel-5.10/Makefile:750: include/config/auto.conf] Error 1
make[3]: Leaving directory ‘/home/user/Desktop/Folder/Linux_for_Tegra/source/public/kernel_out/SYSOUT’
make[2]: *** [Makefile:213: __sub-make] Error 2
make[2]: Leaving directory ‘/home/user/Desktop/Folder/Linux_for_Tegra/source/public/kernel/kernel-5.10’
make[1]: *** [Makefile:82: modules] Error 2
make[1]: Leaving directory ‘/home/user/Desktop/Folder/Linux_for_Tegra/source/public/NVIDIA-kernel-module-source-TempVersion/kernel-open’
make: *** [Makefile:50: modules] Error 2
大意似乎是,执行 “make -C kernel-open modules” 命令编译内核模块,并在进入 kernel-5.10 目录后出现了一些错误信息,这些错误信息表明内核的配置文件缺失或无效,需要运行 “make oldconfig && make prepare” 命令来进行修复。由于缺失配置文件,内核模块编译失败,导致整个编译过程失败
对于这个问题,应该如何解决

我发现我的kernel-5.10/include目录下似乎并没有报告提示的/generated/和/config/目录,但是这个是我通过如下方式进行解压缩得到的:
tar -xvjf Jetson_Linux_R35.4.1_aarch64.tbz2
cd Linux_for_Tegra/rootfs
sudo tar xpf …/…/Tegra_Linux_Sample-Root-Filesystem_R35.4.1_aarch64.tbz2
cd …/…/
tar -xvjf public_sources.tbz2
cd Linux_for_Tegra/source/public
tar -xvjf kernel_src.tbz2
完整的步骤在附件
step.txt (2.6 KB)

进一步发现:
终端提示的的kernel-5.10/include/generated/autoconf.h在我这里的路径是有好几个:
有drivers/staging/rtl8723bs/inlcude/
还有tools/testing/radix-tree/generated/
另一个auto.conf在我的路径下没有找到,对于这个终端提示的报错信息,是否是因为gcc的版本不同导致的,应该怎么解决呢

你有run這一步嗎

make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_defconfig

你是说需要在./nvbuild.sh -o ~/Desktop/Folder/Linux_for_Tegra/source/public/kernel_out编译内核文件这一步之前执行make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_defconfig这一步吗,
但据我观察,./nvbuild.sh -o ~/Desktop/Folder/Linux_for_Tegra/source/public/kernel_out这个命令的执行终端信息里,会首先wirte to .config,是否问题的原因就出在这里?或许nvidia已经有了完善的在jetson orin nano 的35.4.1版本上进行内核的裁剪编译、显示驱动编译的成熟的官方文档

請問你確定你是在正確的路徑下編譯嗎?
我剛才測試過這個步驟是沒有問題的

還有,不用

SYSOUT=~/Desktop/Folder/Linux_for_Tegra/source/public/kernel_out/SYSOUT/

這樣子就好…

SYSOUT=~/Desktop/Folder/Linux_for_Tegra/source/public/kernel_out/

根据你的指导意见,我将解压出来的NVIDIA-kernel-module-source-TempVersion文件夹放在了source/public下,和kernel,kernel_out,hardware目录同级。接下来我进入该文件夹,执行如下命令:
ser@ubuntu:~/Desktop/Folder/Linux_for_Tegra/source/public/NVIDIA-kernel-module-source-TempVersion$ make modules -j16 \

SYSSRC=~/Desktop/Folder/Linux_for_Tegra/source/public/kernel/kernel-5.10/ \
SYSOUT=~/Desktop/Folder/Linux_for_Tegra/source/public/kernel_out/ \
CC=~/Desktop/Folder/l4tgcc/bin/aarch64-buildroot-linux-gnu-gcc \
LD=~/Desktop/Folder/l4tgcc/bin/aarch64-buildroot-linux-gnu-ld.bfd \
AR=~/Desktop/Folder/l4tgcc/bin/aarch64-buildroot-linux-gnu-ar \
CXX=~/Desktop/Folder/l4tgcc/bin/aarch64-buildroot-linux-gnu-g++ \
OBJCOPY=~/Desktop/Folder/l4tgcc/bin/aarch64-buildroot-linux-gnu-objcopy \
TARGET_ARCH=aarch64 \
ARCH=arm64

中间有一些note和warning信息,我不确定这是否会对最终的烧录产生影响,最后的执行信息是:
LD [M] /home/user/Desktop/Folder/Linux_for_Tegra/source/public/NVIDIA-kernel-module-source-TempVersion/kernel-open/nvidia-drm.o
MODPOST /home/user/Desktop/Folder/Linux_for_Tegra/source/public/NVIDIA-kernel-module-source-TempVersion/kernel-open/Module.symvers
CC [M] /home/user/Desktop/Folder/Linux_for_Tegra/source/public/NVIDIA-kernel-module-source-TempVersion/kernel-open/nvidia-drm.mod.o
CC [M] /home/user/Desktop/Folder/Linux_for_Tegra/source/public/NVIDIA-kernel-module-source-TempVersion/kernel-open/nvidia-modeset.mod.o
CC [M] /home/user/Desktop/Folder/Linux_for_Tegra/source/public/NVIDIA-kernel-module-source-TempVersion/kernel-open/nvidia.mod.o
LD [M] /home/user/Desktop/Folder/Linux_for_Tegra/source/public/NVIDIA-kernel-module-source-TempVersion/kernel-open/nvidia-modeset.ko
LD [M] /home/user/Desktop/Folder/Linux_for_Tegra/source/public/NVIDIA-kernel-module-source-TempVersion/kernel-open/nvidia.ko
LD [M] /home/user/Desktop/Folder/Linux_for_Tegra/source/public/NVIDIA-kernel-module-source-TempVersion/kernel-open/nvidia-drm.ko
make[3]: Leaving directory ‘/home/user/Desktop/Folder/Linux_for_Tegra/source/public/kernel_out’
make[2]: Leaving directory ‘/home/user/Desktop/Folder/Linux_for_Tegra/source/public/kernel/kernel-5.10’
make[1]: Leaving directory ‘/home/user/Desktop/Folder/Linux_for_Tegra/source/public/NVIDIA-kernel-module-source-TempVersion/kernel-open’
我想请问一下您在执行的过程中是否有那些note和warning信息,这最终的信息是否代表make成功了

只要不是error中斷就好,warning不用管它

感谢你的指导,我成功的编译了显示驱动,
另外,在编译成功后,我发现在Linux_for_Tegra/rootfs/usr/lib/modules/下有两个文件夹
5.10.120-rt70-tegra
5.10.120-tegra
我把对应的.ko文件复制到了5.10.120-tegra/extra/opensrc-disp/下。
我想问的是:
1.接下来通过sudo ./l4t_create_default_user -u -p 这个命令设置用户之后,是不是就可以在recovery模式下进行烧录了?
2.这个Linux_for_Tegra/rootfs/usr/lib/modules/下的两个文件夹是否会产生冲突?
3.之前在烧录过程中会出现waiting for boot-up,在这个过程中,我是否需要拔掉跳线帽重新插上?还是在烧录过程中什么都不用做

你要用RT kernel的話應該是放到5.10.120-rt7-tegra下面,不是原本那個

你要用RT kernel的話可以直接把原本那個刪掉

不用

感谢你的回答,
我删除了~/Desktop/Folder/Linux_for_Tegra/rootfs/usr/lib/modules/5.10.120-tegra 我也不知道这个是什么时候出现的
并且在另一个5.10.120-rt70-tegra文件夹下创建了对应的extra/opensrc-disp路径,并将对应的三个ko文件复制了进去
然后,我用sudo ./l4t_create_default_user.sh -u nvidia-user -p 123 -a预设了用户,最后使用
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c tools/kernel_flash/flash_l4t_external.xml -p “-c bootloader/t186ref/cfg/flash_t234_qspi.xml” --showlogs --network usb0 jetson-orin-nano-devkit internal
这个命令进行烧录,烧录的结果显示:
tar: Read checkpoint 820000
tar: Read checkpoint 830000
writing item=16, 9:0:secondary_gpt, 62545444352, 16896, gpt_secondary_9_0.bin, 16896, fixed--0, f1a4a05400fc3d3005791804f801bc98cb75c596
[ 518]: l4t_flash_from_kernel: Successfully flash the external device
[ 518]: l4t_flash_from_kernel: Flashing success
[ 518]: l4t_flash_from_kernel: The device size indicated in the partition layout xml is smaller than the actual size. This utility will try to fix the GPT.
Flash is successful
Reboot device
Cleaning up…
Log is saved to Linux_for_Tegra/initrdlog/flash_3-2_0_20231109-190004.log
看起来似乎是烧录成功了,我的问题是:
1.[ 518]: l4t_flash_from_kernel: The device size indicated in the partition layout xml is smaller than the actual size. This utility will try to fix the GPT.这个信息是否会对模组产生不好的影响
2.我很确定我编译了显示器驱动,但是上电后显示器还是没有反应,风扇和指示灯都在工作
3.官方文档上说
In Orin, fix the black screen. This is not required on Xavier.

  1. Flash the system into your Jetson device.
  2. At the first boot, log in, type sudo depmod -a, and then reboot. The GUI should now be back
    我不太明白既然显示屏已经黑屏了,我该如何 type sudo depmod -a

我上传了我的执行步骤,我不清楚是哪一步出了问题
step.txt (3.9 KB)

你要用serial console或是ssh之類的方法登入

您的意思是,烧录后显示器黑屏是正常情况,必须远程登录jetson orin nano的终端然后键入sudo depmod -a这个命令才能恢复吗?
确定不是我的操作步骤的问题吗?
如果我用Xshell想要远程连接jetson orin nano,我又该如何获取模块的ip地址呢?我不明白如何在显示屏黑屏的情况下进行操作

是的
或者是用UART

你在flash之前用QEMU chroot進rootfs跑這個指令可能也可以,
但是比較麻煩、我沒有試過不確定

感谢你的帮助,我成功的让显示屏亮了起来,于是我现在准备重新做一遍,并在这一遍中对内核文件进行修改,在media/i2c中增加了imx586摄像头的.c,.h文件,并在dtsi目录下增加了对应的dtsi文件,然后配置了menuconfig。问题来了:

  1. 当我再次使用./nvbuild.sh -o ~/Desktop/Folder/Linux_for_Tegra/source/public/kernel_out这个命令进行编译后,虽然编译显示成功,但是我在kernel_out/drivers/media/i2c/中没有找到imx586.ko文件。我用make ARCH=arm64 O=$TEGRA_KERNEL_OUT menuconfig这个命令打开一看发现我得imx586选项被取消了。对于这个问题,应该解决

2。 因为暂时不知道如何解决,于是我在make ARCH=arm64 O=$TEGRA_KERNEL_OUT menuconfig执行之后,使用了make ARCH=arm64 O=$TEGRA_KERNEL_OUT -j16这个命令进行编译内核。但是终端给我报错,信息如下:
gcc: error: unrecognized command line option ‘-mlittle-endian’
make[2]: *** [/home/user/Desktop/Folder/Linux_for_Tegra/source/public/kernel/kernel-5.10/scripts/Makefile.build:281: scripts/mod/empty.o] Error 1
make[2]: *** Waiting for unfinished jobs…
gcc: error: unrecognized command line option ‘-mlittle-endian’
make[2]: *** [/home/user/Desktop/Folder/Linux_for_Tegra/source/public/kernel/kernel-5.10/scripts/Makefile.build:118: scripts/mod/devicetable-offsets.s] Error 1
make[1]: *** [/home/user/Desktop/Folder/Linux_for_Tegra/source/public/kernel/kernel-5.10/Makefile:1246: prepare0] Error 2
make[1]: *** Waiting for unfinished jobs…
大意是 使用了一个未被识别的GCC命令行选项-mlittle-endian
这是什么原因造成的,该如何解决

进一步发现,出现这个问题和我是否在menuconfig中启用了imx586无关,那么如果我想用./nvbuild.sh -o ~/Desktop/Folder/Linux_for_Tegra/source/public/kernel_out这个命令进行编译,应该怎么做才可以让它不自动的将我的imx586模块选项取消掉

nvbuild.sh會run make tegra_defconfig,所以會把你的設定蓋掉
你可以把script裡的那一段刪掉,或者自己手動用make、不要用script編譯

或者直接把你的設定加在kernel-5.10/arch/arm64/configs/tegra_defconfig裡面

十分感谢,我已经成功的在内核中加入了imx586摄像头的驱动文件,编译出了inx586.ko文件,也成功的烧录进了jetson orin nano,并且在模块的/lib/modules/5.10.120-rt70-tegra/drivers/media/i2c/路径下也找到了586.ko文件。
但是当我连接了摄像头上电后,在终端执行nvgstcapture-1.0后,并没有成功,终端提示信息在附件。
我不太清楚具体是什么原因,或许在内核中增加摄像头驱动有更多的注意事项??
error-info.txt (4.0 KB)

跟你原本的問題不一樣的話建議發一個新的topic問