The Toradex IMX676 crops active sensor area

Hello,

We chose the IMX676 sensor for our project, because it has a square sensor with a resolution of 3552 x 3552 according to its datasheet. However, it seems that Toradex’s driver is hard-coded to vertically crop the active sensor area. I am wondering if this is intentional, and whether it is possible for Toradex to modify the driver to use the entire active sensor area. I am not an experienced driver developer and hesitate to attempt this change myself.

I followed the driver and device tree setup in the documentation. That went well. The camera is working great and I am streaming video to my application.

The issue is that I can see my image is not perfectly square and is clearly cropped on the top and bottom. Digging deeper into the drivers in the imx676-driver folder, I see the following:

// imx676-driver/imx676_regs.h

#define IMX676_DEFAULT_WIDTH            3552
#define IMX676_DEFAULT_HEIGHT           3092

And this:

// imx676-driver/imx676_mipi.c

static struct vvcam_mode_info_s pimx676_mode_info[] = {
	{
		.index          = 0,
		.size           = {
			.bounds_width  = IMX676_DEFAULT_WIDTH,
			.bounds_height = IMX676_DEFAULT_HEIGHT,
			.top           = 12,
			.left          = 8,
			.width         = 3536,
			.height        = 3072,
		},
// ...

I don’t suppose I can simply change those values? It seems like they may have been picked for a particular reason. Let me know what you think.

Thank you,
William


Output of tdx-info:

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           6.6.84-7.2.0-g87bfb710b6f1 #1-Torizon SMP PREEMPT Mon Mar 31 08:47:48 UTC 2025
Kernel command line:      root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/157a467dd3b97eaebfbf6e17d0c8859fdd0abc1d397c637c6ecd808f79dc0260/0
Distro name:              NAME="Torizon OS"
Distro version:           VERSION_ID=7.2.0-build.13
Distro variant:           VARIANT="Docker"
Hostname:                 verdin-imx8mp-15601692
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Plus WB on Verdin Development Board
Toradex version:          0070 V1.1A
Serial number:            15601692
Processor arch:           aarch64
------------------------------------------------------------

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

Did you like my answer? :+1: :-1:


Hello William,

Thank you for your detailed explanation and the information from your setup!

About the Sensor Cropping

Based on the details you provided, it appears the default mode defined in your IMX676 driver does not use the full sensor area—specifically, it’s using 3552 x 3092 rather than 3552 x 3552 pixels. This cropping (notably, a reduction in height) is likely intentional for reasons such as providing a format that matches a particular output resolution, accounting for sensor-specific requirements, or ensuring driver stability with the tested range.

Within the driver, these values define the “active” area reported to the system. Adjusting them affects how much of the raw sensor is presented to your video pipeline.

Is It Safe to Change These Values?

You’re correct not to change these values lightly, as they may have been chosen to match:

  • Output image format requirements (e.g., for working with standard video resolutions).
  • Sensor limitations (certain rows/columns may not be valid for readout).
  • Constraints based on interface bandwidth, performance, or electrical characteristics.
  • Requirements for correct MIPI CSI-2 framing or camera controller compatibility.

The areas named top, left, width, height, etc., in the driver specify what subset of the sensor is used. If the hardware and the driver support full-resolution (3552x3552) output, you could try adjusting these values as an experiment, but:

  • Changing only the width/height may not be sufficient. You’ll also need to ensure the sensor registers and any MIPI configuration align with the new image size.
  • Driver, sensor firmware, and ISP (Image Signal Processor) constraints could prevent using the entire sensor area. Some “edge” pixels are not used due to quality or sensor design.
  • Other components (such as GStreamer pipelines or V4L2) may expect typical aspect ratios. Native square might not be broadly supported.

Next Steps (Driver Customization Context)

Since Toradex’s Torizon documentation recommends using device tree overlays for configuration but does not cover deep driver changes, and since you are not experienced in Linux driver development, you should carefully consider the following options:

1. Device Tree Overlays

Overlays are a safe way to enable hardware features or change basic configuration (such as I2C addresses or GPIOs). However, they cannot change sensor cropping or output resolution at the driver level. Device tree customization overview.

2. Driver Modification

If you wish to attempt using the full height:

  • Carefully edit the mode definition in your imx676_mipi.c to set bounds_height and height to 3552.
  • Check if register settings in imx676_regs.h or similar source files for frame/ROI (region of interest) match these dimensions.
  • Rebuild and deploy the updated kernel module or device tree. Monitor kernel logs for errors.

3. Testing

After rebuilding, check video output for errors such as:

  • No image (sensor initialization failure)
  • Artifacts at the image edge (invalid pixel data)
  • MIPI/CSI errors in dmesg or kernel logs

Summary

  • The cropping is likely intentional and may be fundamental to stable operation.
  • If you modify mode dimensions, do so cautiously, and be prepared for possible video subsystem problems.
  • Broad compatibility with image pipelines often favors standard aspect ratios and resolutions.

If you need further details about device tree overlays (which are safer to experiment with), you can refer to the official Toradex guide:
Device tree customization overview

If you would like more specific tips for building and deploying a modified driver, please let me know!

Best regards,
Toradex AI Assistant.

Please note that these are Framos Imaging drivers, not developed by Toradex. According to the release notes, the sensor resolution was cropped due to an ‘NXP limitation’. Unfortunately, we do not have details regarding this limitation. However, you may be able to obtain more information by contacting NXP directly via the NXP Community.

Ah, my mistake! Thank you @alex.tx

Thanks also for those helpful links. I will take this up with NXP and FRAMOS. We can live with the cropping for now.

Thank you!
William