Skip to content

nadavelkabets/jetson-peripheral-drivers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

jetson-peripheral-drivers

A bash utility to compile and setup Jetson Linux kernel modules for adc, pwm and iio peripheries

In future releases, Device Tree Overlays will be included to automate board configuration as well.

build.sh

A helper script to build Jetson Linux kernel modules for selected peripherals (currently PWM PCA9685).

Prerequisites

  • A Linux host with bash, tar, make, and scripts/config (provided in the kernel sources).

Downloading BSP Sources

  1. Go to NVIDIA’s Jetson Linux archive: https://developer.nvidia.com/embedded/jetson-linux-archive
  2. Select the Jetson platform and release you’re targeting.
  3. In the table, download Driver Package (BSP) Sources (e.g., public_sources.tbz2).
  4. Save the tarball somewhere accessible.

Cross-Compilation Support

The script automatically detects the host architecture:

  • x86_64 (Ubuntu/Debian): Enables cross-compilation for ARM64. The script will automatically install gcc-aarch64-linux-gnu and configure the build with ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-.
  • aarch64 (Jetson device): Uses native compilation.

This allows you to build Jetson kernel modules on a faster x86_64 development machine and then transfer the .ko files to your Jetson device.

Usage

./build.sh [--pwm-pca9685] [--ads1015] [--sc16is7xx] [--output-dir DIR] <public_sources.tbz2>
  • --pwm-pca9685 : Compile the PWM PCA9685 kernel module.
  • --ads1015 : Compile the IIO ADC ADS1015 kernel module.
  • --sc16is7xx : Compile the SC16IS7XX I2C/SPI to UART bridge kernel module.
  • --output-dir DIR: (Optional) Directory to copy the built .ko file (defaults to current directory).
  • <public_sources.tbz2>: The downloaded BSP sources tarball.

Installation and Testing

After building, the module .ko file should be placed into the kernel modules tree for your running kernel:

sudo install -m 644 pwm-pca9685.ko /lib/modules/$(uname -r)/kernel/drivers/pwm/

Then update the module dependency list:

sudo depmod -a

To verify the module is available (either by filesystem or via modprobe):

modprobe -l | grep pwm_pca9685

Loading and Listing Modules

  • Load the module:

    sudo modprobe pwm-pca9685
  • Check that it’s loaded:

    lsmod | grep pwm_pca9685
  • View module information:

    modinfo pwm-pca9685

Debugging

If you encounter issues loading or running the module, check:

  • Kernel messages: dmesg | tail -n 50

  • System logs: journalctl -k --since "5 minutes ago"

  • Driver‑specific logs: filter for the driver name, e.g.:

    dmesg | grep -i pca9685
    journalctl -k | grep -i pca9685

These commands can help you identify configuration errors, missing dependencies, or driver load failures.

About

A bash utility to compile and setup Jetson Linux kernel modules for adc, pwm and iio peripheries

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages