Skip to content

Stm32n6 tof - #68

Merged
andoma merged 3 commits into
masterfrom
stm32n6-tof
Oct 25, 2026
Merged

andoma merged 3 commits into
masterfrom
stm32n6-tof

Conversation

@andoma

@andoma andoma commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Adds a VL53L5CX driver and use it on the stm32n6-dk

andoma and others added 3 commits October 25, 2026 07:42
The heap starts at _ebss, so the larger region costs nothing at
runtime. The FSBL sits at +1.5 MB in AXISRAM, well clear. Needed for
the 84 KB VL53L5CX firmware blob.

Co-Authored-By: Claude <noreply@anthropic.com>
Own implementation of the register level sequences from ST's VL53L5CX
ULD driver (BSD-3-Clause). The sensor has no flash, so the 84 KB
firmware and default calibration blobs (vl53l5cx_fw.c, generated from
ST's vl53l5cx_buffers.h with the original notice kept) are uploaded
over I2C at init.

Supports 4x4 and 8x8 zones, ranging frequency, start/stop and frame
read-out (distance, sigma, signal, ambient, target status). Transfers
are split into 252 byte chunks since the STM32 I2C driver moves at most
255 bytes per transfer.

The MCU boot wait uses the GO2 status poll from ST's later ULD; the
1.x "0x06 == 0" check can pass before the firmware is up, which made
the NVM read fail with a garbage status. Boot errors log the failing
step and the raw status bytes.

Built with ENABLE_VL53L5CX.

Co-Authored-By: Claude <noreply@anthropic.com>
The B-CAMS-IMX module has a VL53L5CX on the camera I2C bus. It is
created at the end of the camera init thread, as the firmware upload
takes a few seconds. LPn (PQ5) is pulled up on the module and left
alone; TOF_INT (PQ0) is unused, the driver polls.

  tof start [4|8] [hz]   start ranging (default 8x8 at 15 Hz)
  tof stop
  tof [frames]           print the distance grid

Co-Authored-By: Claude <noreply@anthropic.com>
@andoma
andoma merged commit 1b7c777 into master Oct 25, 2026
1 check failed
@andoma
andoma deleted the stm32n6-tof branch October 25, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant