我裁剪内核进行编译,烧写后,正常模式连接显示屏上电,但是显示屏一直处于黑屏状态。编译,烧写都是成功的。
另外,如果直接解压Linux_for_Tegra和rootfs并烧写的话,是不会报错。但是如果编译内核,就会在media/i2c中的nv_0234.c和hawk.c这两个驱动文件中报错,必须修改一下才能编译通过。这两个都该如何解决?
而且我发现,当read checkpoint读到了810000的时候,烧写就会失败
Moving to the Jetson forums for visibility.
Latest Autonomous Machines/Jetson & Embedded Systems topics - NVIDIA Developer Forums
Are you using devkit or with custom carrier board?
Which JetPack SW you’re using?
Do you have any custom modification in kernel before building the source?
Are you using Ubuntu 16.04 or 18.04 as your host PC?
The steps mentioned in the official documentation (Kernel Customization — Jetson Linux Developer Guide documentation) are as follows:
Step 2: Building the Real-Time Kernel:
- After successfully compiling the kernel using nvbuild.sh, it is mentioned to copy the nvgpu.ko file to rootfs/lib/modules. However, if the “modules” folder does not exist at that location, it will be created in the next step.
Step 3: Installing Kernel Modules:
- The command “sudo make ARCH=arm64 O=$TEGRA_KERNEL_OUT modules_install INSTALL_MOD_PATH=/Linux_for_Tegra/rootfs/” is mentioned in the official documentation. This command will generate the “modules” folder under rootfs/lib. The absence of the “usr” directory in Linux_for_Tegra is not an issue, as the modules should be installed under rootfs.
Regarding your second question, if you only compile the kernel without building the display modules and flash it, you may encounter a situation where the fan and indicator lights work, but the display screen remains black. This is expected because the display drivers and modules are responsible for managing and driving the display. Without the display modules, the system might not be able to initialize and communicate properly with the display, resulting in a black screen. To resolve this issue, you should also build and install the necessary display modules along with the kernel.
我的步骤是根据官方文档来的:Kernel Customization — Jetson Linux Developer Guide documentation
事实上,我在执行的过程中发现了一些问题:
在构建实时内核的第二步中:当我成功的用nvbuild.sh编译内核到kernel_out目录中后,接下来需要将nvgpu.ko文件拷贝到rootfs/lib/modules中,但是我发现里面并没有moduls这个文件夹,只有在构建实时内核的第三步中执行sudo make ARCH=arm64 O=$TEGRA_KERNEL_OUT modules_install INSTALL_MOD_PATH=/Linux_for_Tegra/rootfs/这个命令才会在rootfs/lib下生成modules文件夹。
并且,在官方文档中说:Build the kernel modules:
$ cd <path_to_kernel_source>
$ sudo make ARCH=arm64 O=$TEGRA_KERNEL_OUT modules_install INSTALL_MOD_PATH=/Linux_for_Tegra/rootfs/
Make sure there is a new folder with -rt63- in its name under Linux_for_Tegra/usr/lib/modules/.
但是执行完命令后在Linux_for_tegra中没有usr这个目录,只有在rootfs中才有,这是否有问题
另外,如果我只编译了内核,并没有构建显示模块就进行烧录,是否就会出现上电后风扇和指示灯都在工作,但是显示屏黑屏的情况
如果是我們pre-built的kernel的話,/lib/modules/
是透過apply_binaries.sh這個script生出來的
如果你自己重新build kernel的話就要用這個指令安裝kernel modules
(但是通常沒有改kernel suffix或是不是RT kernel的話,kernel modules是不用重裝的)
那個只是文件不小心寫錯了… 35.4.1的時候有更新成對的
是的
感谢你的回答,我想明确一下, apply_binaries.sh这个命令我是否应该在 To Build the Kernel这个小节的第4步编译内核成后,在第5步复制nvgpu.ko文件之前执行。来让rootfs/lib/目录下生成modules文件?
因为据我了解,这个命令是在烧录前执行的步骤,如果我编译完后就执行这个命令,后面又执行了Build the kernel modules:和 1. Build the display drivers.,这两个步骤,是否会对结果产生不好的影响。
因为我最终的目的是向解压出来的drivers/media/i2c中添加对于imx586摄像头的驱动文件,使得jetson orin nano能够支持这个摄像头,我是否需要使用别的方式编译,这是我的步骤,不知道有没有问题
添加IMX586并烧录.docx (547.2 KB)
可以 沒問題
感谢你的肯定,可以告诉我为了在rootfs/lib/目录下生成modules文件夹, apply_binaries.sh这个命令应该在哪一步执行吗?另外,我之前就是按照这样的文档进行操作,但是最后烧录成功后显示屏没有亮,我是否应该在执行 apply_binaries.sh后,烧录之前构建显示器模块
什麼時候做都可以,你只要確定你build出來的kernel image/modules那些東西有放對位置就好
是的
感谢你的回答。我想请问,在构建显示驱动时,这个命令中:
$ make
modules
SYSSRC=
SYSOUT=<KERNEL_OUTDIR>
CC=$(CROSS_COMPILE_AARCH64)gcc
LD=$(CROSS_COMPILE_AARCH64)ld.bfd
AR=$(CROSS_COMPILE_AARCH64)ar
CXX=$(CROSS_COMPILE_AARCH64)g++
OBJCOPY=$(CROSS_COMPILE_AARCH64)objcopy
TARGET_ARCH=aarch64
ARCH=arm64
如下这两个的路径应该在Linux_for_Tegra中的哪个目录下
SYSSRC=
SYSOUT=<KERNEL_OUTDIR> \
SYSSRC和SYSOUT的路径是对应Linux_for_Tegra/source/public/NVIDIA-kernel-module-source-TempVersion/目录下的src和kernel-open吗
还是说不用具体设置路径,只需要使用它的默认值,比如
make modules -j12
TARGET_ARCH=aarch64
CC=aarch64-linux-gnu-gcc
LD=aarch64-linux-gnu-ld
AR=aarch64-linux-gnu-ar
CXX=aarch64-linux-gnu-g++
OBJCOPY=aarch64-linux-gnu-objcopy
这样执行后,是否也能实现相同的效果
SYSSRC是kernel source的路徑(linux-5.10)
SYSOUT隨便放在哪裡都可以
SYSOUT是之前设置的那个kernel_out吗还是自己再随便设置一个输出路径
可以用你之前設定的那個
感谢你的回答。
在我执行完这个命令:
make modules -j16
SYSSRC=~/Desktop/Folder/Linux_for_Tegra/source/public/kernel/kernel-5.10/
SYSOUT=~/Desktop/Folder/Linux_for_Tegra/source/public/NVIDIA-kernel-module-source-TempVersion/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
后,出现了错误提示如下:
…/common/displayport/src/dp_connectorimpl.cpp: In member function ‘virtual bool DisplayPort::ConnectorImpl::updatePsrConfiguration(vesaPsrConfig)’:
…/common/displayport/src/dp_connectorimpl.cpp:6596:6: note: parameter passing for argument of type ‘vesaPsrConfig’ {aka ‘VesaPsrConfig’} changed in GCC 9.1
6596 | bool ConnectorImpl::updatePsrConfiguration(vesaPsrConfig config)
| ^~~~~~~~~~~~~
[ nvidia ] CC src/libraries/nvport/sync/sync_rwlock.c
…/common/displayport/src/dp_connectorimpl.cpp: In member function ‘virtual bool DisplayPort::ConnectorImpl::writePsrErrorStatus(vesaPsrErrorStatus)’:
…/common/displayport/src/dp_connectorimpl.cpp:6606:6: note: parameter passing for argument of type ‘vesaPsrErrorStatus’ {aka ‘VesaPsrErrorStatus’} changed in GCC 9.1
6606 | bool ConnectorImpl::writePsrErrorStatus(vesaPsrErrorStatus psrErr)
| ^~~~~~~~~~~~~
…/common/displayport/src/dp_connectorimpl.cpp: In member function ‘virtual bool DisplayPort::ConnectorImpl::writePsrEvtIndicator(vesaPsrEventIndicator)’:
…/common/displayport/src/dp_connectorimpl.cpp:6616:6: note: parameter passing for argument of type ‘vesaPsrEventIndicator’ {aka ‘VesaPsrEventIndicator’} changed in GCC 9.1
6616 | bool ConnectorImpl::writePsrEvtIndicator(vesaPsrEventIndicator psrEvt)
大意是 ../common/displayport/src/dp_connectorimpl.cpp
文件中的 ConnectorImpl
类的三个成员函数中的参数类型与 GCC 9.1 中发生了改变。
具体来说,这三个函数分别是 updatePsrConfiguration
、writePsrErrorStatus
和 writePsrEvtIndicator
。对应的参数类型为 vesaPsrConfig
、vesaPsrErrorStatus
和 vesaPsrEventIndicator
。然而,这些参数类型在 GCC 9.1 中发生了改变,并被重命名为 VesaPsrConfig
、VesaPsrErrorStatus
和 VesaPsrEventIndicator
。
因此,编译器提醒您需要更新这三个函数的参数类型,以与 GCC 9.1 兼容。您需要在相关代码中将参数类型修正为新的类型名,以解决这个编译错误。
我使用的是gcc9.3,官网上提供的也是9.3,但它提示我要和gcc9.1兼容。对于这个问题,该如何解决呢,是否需要将对应的错误函数名修改为正确的,除了这个办法,还有没有其他的解决办法。
請問你的編譯器是用我們官網提供的版本嗎
https://developer.nvidia.com/embedded/jetson-linux/bootlin-toolchain-gcc-93
改回一開始build kernel的kernel_out路徑再試一次