ZBLOG

how to config jetson orin linux kernel can bus gpio device-tree

To configure Jetson Orin Linux kernel for CAN bus and GPIO device tree, follow these steps:

  1. Download and install the latest version of JetPack SDK from the NVIDIA website.

  2. Set up your development environment by opening a terminal window and navigating to the root directory of your Jetson Orin system.

  3. Clone the Linux kernel source code repository by running the following command:

   git clone https://github.com/NVIDIA/linux.git
  1. Configure the kernel build options by running the following command:
   make ARCH=arm64 O=build/jetson_orin_defconfig tegra_defconfig
  1. Modify the device tree configuration file located at linux/arch/arm64/boot/dts/tegra194-jetson-xavier-nx-devkit.dts to add CAN bus and GPIO support. Add the following code snippet inside the gpio@2200000 node:
   can {
           pinctrl-names = "default";
           pinctrl-0 = <&can_pins>;
           status = "okay";

           can0: can@0 {
                   reg = <0>;
                   interrupts = <TEGRA194_MAIN_IRQ(EE, 0) IRQ_TYPE_LEVEL_HIGH>;
                   status = "okay";
           };
   };

   can_pins: can_pins {
           can0_pinmux {
                   nvidia,pins = "can0_tx", "can0_rx";
                   nvidia,function = "rsvd1", "rsvd1";
                   nvidia,pull = <TEGRA_PIN_PULL_DOWN>, <TEGRA_PIN_PULL_DOWN>;
                   nvidia,tristate = <TEGRA_PIN_DISABLE>, <TEGRA_PIN_ENABLE>;
           };
   };
  1. Save and close the device tree configuration file.

  2. Build the Linux kernel by running the following command:

   make ARCH=arm64 O=build Image tegra194-jetson-xavier-nx-devkit.dtb modules
  1. Install the new kernel by copying the generated image and device tree blob to the boot partition of your Jetson Orin system:
   sudo cp build/Image /boot/Image
   sudo cp build/tegra194-jetson-xavier-nx-devkit.dtb /boot/tegra194-jetson-xavier-nx-devkit.dtb
  1. Reboot your Jetson Orin system and verify that CAN bus and GPIO support have been added by running the ls /sys/class/gpio and ip link show can0 commands.

  2. You can now use the echo command and file system interface to control the GPIOs on your Jetson Orin board, as well as communicate over the CAN bus using the can-utils package or other software.

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://golang.0voice.com/?id=1998

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?