Skip to content

drivers/video: Add the ST VL53L5CX multizone ToF driver - #22026

Open
raiden00pl wants to merge 4 commits into
apache:masterfrom
raiden00pl:video-vl53l5cx
Open

raiden00pl wants to merge 4 commits into
apache:masterfrom
raiden00pl:video-vl53l5cx

Conversation

@raiden00pl

Copy link
Copy Markdown
Member

Summary

  • video: Add the Z16 depth pixel format.
  • video/v4l2_cap: Enumerate frame intervals per frame size.
    Entries that set a size or format now only match a request for it
    (this also filters the UVC host driver's per-size entries).
  • drivers/video: Add the ST VL53L5CX multizone ToF driver.
    V4L2 depth capture device (V4L2_PIX_FMT_Z16, mm): 8x8 at 1-15 Hz or
    4x4 at 1-60 Hz. The sensor INT output starts each frame read on the LP
    work queue. The sensor keeps its firmware in RAM; the build downloads
    it from ST's VL53L5CX ULD (X-CUBE-TOF1 v3.4.3, BSD-3-Clause), so the
    driver depends on ALLOW_BSD_COMPONENTS.
  • boards/stm32n6570-dk: Add the VL53L5CX ToF sensor.
    INT on PQ0, LPn on PQ5, /dev/video1. INT takes EXTI0, so the TAMP
    button has no interrupt when the sensor is enabled.

Impact

New driver, a new pixel format (Z16) and a fix in frame interval
enumeration. No change for existing boards.

Testing

STM32N6570-DK, nsh + VIDEO_VL53L5CX (10 ms tick), V4L2 capture of
/dev/video1:

  • first stream start (firmware write at 1 MHz I2C): 1.10 s
  • 8x8 at 15 Hz: 150/150 frames, 15.0 fps
  • 4x4 at 60 Hz: 300/300 frames, 59.8 fps
  • 4x4 at 1 Hz: 60/60 frames
  • both buffers held for 500 ms: streaming resumes, 60/60 frames
  • STREAMOFF: INT stops, the sensor stops ranging
  • 2/15 s frame interval: 24/24 frames at 7.9 fps

V4L2_PIX_FMT_Z16 carries a 16-bit little endian distance per pixel, as
used by time-of-flight depth sensors.  Add the imgdata and imgsensor
values and pass it through the V4L2 capture format handling.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: raiden00pl <raiden00@railab.me>
VIDIOC_ENUM_FRAMEINTERVALS returned every sensor entry whatever the
requested size and format.  Entries that set a width, height or pixel
format now only match a request for it.  This also filters the per-size
entries of the UVC host driver; tables without them work as before.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: raiden00pl <raiden00@railab.me>
The VL53L5CX is a V4L2 depth capture device with its own image sensor
and image data interfaces: V4L2_PIX_FMT_Z16 in millimetres, 8x8 at
1-15 Hz or 4x4 at 1-60 Hz.  The sensor INT output starts each frame
read on the low priority work queue.  The sensor keeps its firmware in
RAM: the build downloads it from ST's VL53L5CX ULD (X-CUBE-TOF1), which
is under the BSD-3-Clause license, so the driver depends on
ALLOW_BSD_COMPONENTS.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: raiden00pl <raiden00@railab.me>
The camera module carries a VL53L5CX on I2C1, with INT on PQ0 and LPn on
PQ5.  The board powers the module with the IMX335 held in reset and
registers the sensor as /dev/video1.  INT takes EXTI0, so the TAMP
button has no interrupt when the sensor is enabled.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: raiden00pl <raiden00@railab.me>
@github-actions github-actions Bot added Area: Documentation Improvements or additions to documentation Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. Board: arm labels Nov 18, 2026
@github-actions

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

No memory changes detected for:


Catch memory regressions in CI with MemBrowse. Free for open source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Documentation Improvements or additions to documentation Board: arm Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant