CSI cameras customization
This page is intended to guide customers to be able to add support for custom camera module on DroneCore.Pilot board.
Brief introduction
To support custom CSI camera on Jetson platform, there is a need for specific v4l2 driver and device tree matching hardware configuration of carrier board. Those files are usually provided by camera module manufacturers. For this tutorial it is assumed that customer has obtained patched kernel sources in the working directory (obtaining kernel sources), v4l2 camera driver sources ".c" and camera related device tree sources ".dts".
Camera manufacturers\`s guides how to implement support for custom camera module, intended to be used on some of the Jetson developer kits, not works in most cases on custom carrier boards (.Pilot board including). Those are usually based on principle of copying whole kernel image and device tree, built specifically for developer kit and do not match other hardware configurations. {% endhint %}
Steps to do:
Device tree:
Camera driver:
Device tree
Device tree source files customization
To start with device tree customization, we recommend to grab one of out working device tree source files, rename it and gradually modify it according to camera manufacturer device tree sources. For example sources for ov9281 camera module can be used: "tegra194-camera-ov9281-hexa.dtsi" and "tegra194-camera-jakku-ov9281-hexa.dtsi", which are located in : $target_working_directory/kernel_sources_xaviernx/hardware/nvidia/platform/t19x/jakku/kernel-dts/common .
{% hint style="info" %} If you need more information or explanation of specific device tree camera nodes, please read Sensor Software Driver Programming guide written by Nvidia. {% endhint %}
Next copy new dtsi files into same repository and include main file in the upper device tree file "tegra194-p3509-0000-a00.dtsi" , which is also located in the same repository :
Common device tree modification mistakes:
Wrong definition of control GPIOs:
Wrong camera indexes:
I2C multiplexor driver match
Building device tree and deploying to running target
Please read this section to build whole Jetson`s device tree on host PC and apply compiled output into running target.
Camera driver
Assumed that "driver.c" and optionally "driver_mode_tbls.h" "driver.h" files are obtained from camera provider.
Copying driver files to right destination
Driver files must be copied into compilation folder.
Destination path for "driver.c" and optionally "driver_mode_tbls.h" files: $target_working_directory/Linux_for_Tegra/kernel_sources_xaviernx/kernel/nvidia/drivers/media/i2c
Destination path for optional "driver.h" file:
$target_working_directory/Linux_for_Tegra/kernel_sources_xaviernx/kernel/nvidia/include/media
Compiling kernel
Add driver to end of make file ($target_working_directory/Linux_for_Tegra/kernel_sources_xaviernx/kernel/nvidia/drivers/media/i2c/Makefile)
Next follow this section to compile kernel sources, create kernel image on host PC and deploy it to target Jetson device.
Last updated
