Skip to main content
By the end of this section, you will have learned about the following topics.
  • Checking whether a sensor fits the board
  • Scaffolding a sensor with camera-isp-sdk new and filling in the overlay fragment and the descriptor
  • Bringing the sensor up on the board one layer at a time
The example in this section is how sensors/ov5647 was added to the repository, so each step can be compared with the files there. You can replace the names with your sensor’s.
1

Checking the Sensor Fits

The sensor’s output, bit depth and link rate must be within the board’s limits.
2

Kernel Driver

The sensor needs a V4L2 driver with exposure and gain controls.
3

Scaffolding

camera-isp-sdk new creates the descriptor, the overlay fragment and the DCC sources.
4

Filling in the Overlay and the Descriptor

Sensor specific values come from the driver’s DT binding and the datasheet.
5

Building, Installing and Bring-up

The package is built, installed on the board and the sensor is tested step by step.

1. Checking the Sensor Fits

  • The sensor must deliver RAW Bayer at 8, 10 or 12 bits over MIPI CSI-2 D-PHY with at most 2 data lanes (both connectors of the board are 2-lane). YUV sensors do not need the ISP.
  • The mode width must be a multiple of 8 for RAW10/RAW12 and of 16 for RAW8. If it is not, the driver has to crop (as the IMX477 driver does).
  • The pixel rate must fit the link: width × height × fps × bits below lanes × 2 × link frequency.

2. Kernel Driver

The ISP path needs these controls:
  • In the T3 Gemstone kernel already (grep VIDEO_<SENSOR> t3_gem_o1_defconfig): nothing to do. If the module is not on the image, the T3 Gemstone package repository may have it as kernel-module-<name>-6.12.24-ti (as for the OV5647).
  • In the mainline or Raspberry Pi kernel: you need to copy the driver to sensors/<id>/driver/ with a Kbuild (obj-m += <id>.o) and set driver=driver in the descriptor. Embedded data pads of Raspberry Pi drivers use MEDIA_BUS_FMT_SENSOR_DATA, which the TI kernel does not have, and must be removed. You can build it with task drivers SENSORS=<id> KDIR=... (Building Sensor Drivers); the package then carries it.

3. Scaffolding

This creates sensors/ov5647/ with a descriptor, an overlay fragment, a README checklist and DCC sources copied from imx230. In the sources the camera module ID is set to 5647, the AE/AWB statistics grid is fitted to 1920x1080 and the demosaic coefficients are moved to the BGGR order of --code.
  • The DCC ID must be one no other sensor uses; the sensor’s part number usually works.
  • --dcc-from must name a sensor with the same bit depth: imx230 is 10-bit, imx477 12-bit. The tool warns otherwise (ISP Tuning).

4. Filling in the Overlay and the Descriptor

4.1 Overlay Fragment

sensors/ov5647/overlay.dtsi is written once for both ports with these macros. The fragment must define CAM_DATA_LANES, and CAM_CLOCK_NONCONTINUOUS if the sensor uses a non-continuous clock. The compatible string, I2C address, clock and supplies are taken from the driver’s DT binding.

4.2 Descriptor

The fields marked TODO in sensors/ov5647/sensor.conf are filled in. [gain] models: The formula is in the sensor’s datasheet or in libcamera’s cam_helper_<sensor>.cpp.

5. Building, Installing and Bring-up

You can build the package and install it on the board as in Installation.
On the board, you can run the commands below in order, as root with the Edge AI environment loaded (Installation). Each step isolates one layer.
For problems, you can refer to the table in Usage. Once the sensor has been verified on a board, status=supported is set in the descriptor and the ISP is tuned (ISP Tuning).