To configure Jetson AGX Orin Linux kernel for CAN bus and GPIO device tree, follow these steps:
Download and install the latest version of JetPack SDK from the NVIDIA website.
Set up your development environment by opening a terminal window and navigating to the root directory of your Jetson AGX Orin system.
Clone the Linux kernel source code repository by running the following command:
git clone https://github.com/NVIDIA/linux.git
- Configure the kernel build options by running the following command:
make ARCH=arm64 O=build/jetson-agx-defconfig tegra_defconfig
- Modify the device tree configuration file located at
linux/arch/arm64/boot/dts/nvidia/tegra194-p2888-0001-p2822-0000.dts
to add CAN bus and GPIO support. Add the following code snippet inside thegpio@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>;
};
};
Save and close the device tree configuration file.
Build the Linux kernel by running the following command:
make ARCH=arm64 O=build Image tegra194-p2888-0001-p2822-0000.dtb modules
- Install the new kernel by copying the generated image and device tree blob to the boot partition of your Jetson AGX Orin system:
sudo cp build/Image /boot/Image
sudo cp build/tegra194-p2888-0001-p2822-0000.dtb /boot/tegra194-p2888-0001-p2822-0000.dtb
Reboot your Jetson AGX Orin system and verify that CAN bus and GPIO support have been added by running the
ls /sys/class/gpio
andip link show can0
commands.You can now use the
echo
command and file system interface to control the GPIOs on your Jetson AGX Orin board, as well as communicate over the CAN bus using thecan-utils
package or other software.