Orin nx real-time 无法在设备中无法编译指定驱动

jp6.2 real-time orin nx
客户自定板子

$ uname -r
5.15.148-rt-tegra
$ ls /lib/modules/
5.15.148-rt-tegra  5.15.148-tegra

但是安装ethercat,能正常编译,但是无法加载。发现编译制定到模块5.15.148-tegra中,实际build内核为5.15.148-rt-tegra。所以导致ethercat无法加载,请问如何制定5.15.148-rt-tegra,不然第三方编译外设都无法正常工作

*** Please note that this reply is generated by LLM automatically ***

Based on the provided context, I will attempt to provide a comprehensive answer to the question.

The question appears to be related to the Jetson Orin NX platform, specifically with regards to real-time capabilities and EtherCAT support. Here’s a breakdown of the relevant information:

  1. Jetson Orin NX: The Jetson Orin NX is a platform from NVIDIA, part of the Jetson Orin series, which is designed for AI and computer vision applications.
  2. JP62: This likely refers to JetPack 6.2, which is a software development kit (SDK) from NVIDIA for the Jetson platform. JetPack 6.2 provides a comprehensive set of tools and libraries for developing AI and computer vision applications on the Jetson platform.
  3. Real-time: Real-time capabilities are crucial for applications that require predictable and low-latency responses, such as robotics, autonomous vehicles, and industrial control systems. The Jetson Orin NX platform is designed to provide real-time capabilities, but the extent of these capabilities depends on various factors, including the specific hardware configuration, software optimization, and application requirements.
  4. EtherCAT: EtherCAT (Ethernet for Control Automation Technology) is a high-performance Ethernet-based fieldbus protocol widely used in industrial automation and robotics. The Jetson Orin NX platform supports EtherCAT, but the specific implementation and performance may vary depending on the hardware and software configuration.

Comparing the Jetson Orin NX with other platforms in the context:

  • Jetson AGX Orin: The Jetson AGX Orin is a more powerful platform than the Jetson Orin NX, with a more extensive set of features and capabilities. However, the Jetson AGX Orin may not be as optimized for real-time applications as the Jetson Orin NX.
  • Jetson Orin Nano: The Jetson Orin Nano is a smaller and more power-efficient platform than the Jetson Orin NX, but it may not offer the same level of real-time capabilities or EtherCAT support.

In summary, the Jetson Orin NX platform is designed to provide real-time capabilities and supports EtherCAT, making it suitable for applications that require predictable and low-latency responses. However, the specific performance and capabilities of the platform depend on various factors, including the hardware and software configuration.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

你編好的東西就install進去5.15.148-rt-tegra 就可以了

编译install不受我控制,直接就用/lib/modules/5.15.148-rt-tegra/,而且/lib/modules/5.15.148-rt-tegra/下面没有ethercat

$ sudo insmod master/ec_master.ko
insmod: ERROR: could not insert module master/ec_master.ko: Invalid module format

ls /lib/modules/5.15.148-tegra/
build     kernel         modules.alias.bin  modules.builtin.alias.bin  modules.builtin.modinfo  modules.dep.bin  modules.order    modules.symbols      updates
ethercat  modules.alias  modules.builtin    modules.builtin.bin        modules.dep              modules.devname  modules.softdep  modules.symbols.bin

$ ls /lib/modules/5.15.148-rt-tegra/
build   modules.alias      modules.builtin            modules.builtin.bin      modules.dep      modules.devname  modules.softdep  modules.symbols.bin
kernel  modules.alias.bin  modules.builtin.alias.bin  modules.builtin.modinfo  modules.dep.bin  modules.order    modules.symbols  updates

在5.15.148-tegra下面有ethercat,但是5.15.148-rt-tegra下面却没有ethercat,如何用/lib/modules/5.15.148-rt-tegra/

而且我试过jp6.2.1 oirn nx,和agx orin jp6.2和agx oirn jp6.2.1都都有此问题

而且我试过如果不用rt内核,就能正常的加载

你built的這一個ec_master.ko並不是跟著rt kernel的吧. 看起來還是跟著non-RT kernel編出來的.

你built的這一個ec_master.ko並不是跟著rt kernel的吧. 看起來還是跟著non-RT kernel編出來的. -->是的,但是uname -r已经显示系统是rt kernel。

我是按照上面文档编译出来的

uname -r 只代表你現在系統上的kernel image已經換成RT kernel. 跟你這個獨立的.ko檔有沒有跟著rt kernel build是不相干的…

麻煩你直接寫出你的步驟. 很多用戶都跟我說他照著文件走, 結果步驟列出來沒一個真的照文件走.

dir=$(pwd)
export CROSS_COMPILE=/home/lcfc/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-
export ARCH=arm64
export KERNEL_HEADERS=${dir}/source/kernel/kernel-jammy-src
KERNEL_OUT_DIR=${dir}/kernel_out
export INSTALL_MOD_PATH=${dir}/rootfs


cd ${dir}/source
./generic_rt_build.sh "enable"

make -C kernel
sudo -E make install -C kernel



export IGNORE_PREEMPT_RT_PRESENCE=1
make modules


sudo -E make modules_install


cd ${dir}
sudo ./tools/l4t_update_initrd.sh

cd ${dir}/source
make dtbs

sudo cp ${dir}/source/out/nvidia-linux-header/arch/arm64/boot/Image ${dir}/kernel/Image
sudo cp ${dir}/source/kernel-devicetree/generic-dts/dtbs/* ${dir}/kernel/dtb/
sudo cp ${dir}/source/nvgpu/drivers/gpu/nvgpu/nvgpu.ko ${dir}/rootfs/usr/lib/modules/5.15.148-rt-tegra/updates/nvgpu.ko

我们是按照上面步骤操作的

sudo -E make modules_install

你這一步驟做完之後能否確認一下那些.ko到底被裝去哪?

编译出来口在rootfs/lib/modules/5.15.148-rt-tegra

SIGN    /home/lcfc/code/b500/jp6.2/Jetson6.2_orin_nx/JetPack_6.2_Linux_JETSON_ORIN_NX_TARGETS/Linux_for_Tegra/rootfs/lib/modules/5.15.148-rt-tegra/kernel/drivers/media/common/videobuf2/videobuf2-vmalloc.ko
  INSTALL /home/lcfc/code/b500/jp6.2/Jetson6.2_orin_nx/JetPack_6.2_Linux_JETSON_ORIN_NX_TARGETS/Linux_for_Tegra/rootfs/lib/modules/5.15.148-rt-tegra/kernel/drivers/media/dvb-frontends/a8293.ko
  SIGN    /home/lcfc/code/b500/jp6.2/Jetson6.2_orin_nx/JetPack_6.2_Linux_JETSON_ORIN_NX_TARGETS/Linux_for_Tegra/rootfs/lib/modules/5.15.148-rt-tegra/kernel/drivers/media/dvb-frontends/a8293.ko
  INSTALL /home/lcfc/code/b500/jp6.2/Jetson6.2_orin_nx/JetPack_6.2_Linux_JETSON_ORIN_NX_TARGETS/Linux_for_Tegra/rootfs/lib/modules/5.15.148-rt-tegra/kernel/drivers/media/dvb-frontends/af9013.ko
  SIGN    /home/lcfc/code/b500/jp6.2/Jetson6.2_orin_nx/JetPack_6.2_Linux_JETSON_ORIN_NX_TARGETS/Linux_for_Tegra/rootfs/lib/modules/5.15.148-rt-tegra/kernel/drivers/media/dvb-frontends/af9013.ko

那請問你那個裝不起來的ec_master.ko 為什麼沒有出現在這?

我是在orin nx设备上编译ethercat的,不是x86 PC交叉编译出来。ethercat里面还有很多配置,如果交叉编译可能有很多配置无法拷贝到设备中

如果我前面所說, 你也並沒有完全照著文件上面的做…

前面的討論基本上也沒什麼意義了. 現在問題就變成你在Orin NX上又是怎樣編譯的…
聽起來就是你那個編譯狀況並沒有用rt kernel source在做.

是没有用到rt kernel,那我怎么才能用到rt kernel呢。或者我那地方做的有问题

Have you checked Installing Real-Time Kernel — NVIDIA Jetson Linux Developer Guide

我们其他同事也试过了,没办法在jetson平台上编译,只能在x86 host机器上编译。也是按照如上文档方法编译的

Hi,
Please build the module along with RT kernel on the host PC. So that the ko file is part of RT kernel.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.