Skip to main content
Associate
August 17, 2026
Solved

IMX219 driver for x-cube-n6-camera-capture on NUCLEO-N657X0-Q — seeking guidance

  • August 17, 2026
  • 4 replies
  • 101 views

Hi,

I'm trying to bring up an IMX219 (Raspberry Pi Camera Module v2) on the “x-cube-n6-camera-capture” reference project for nucleo657x0q, 

I first tried this under Zephyr and got working capture, but only at reduced resolution.  I've since moved to writing a native driver for “stm32-mw-camera” instead, using “imx335.c” “cmw_imx335.c” as a structural reference template but only at the code/flow level since IMX335's actual register map isn't in any public datasheet I could find. For register values, PLL chain, and gain formula I relied entirely on the official Sony IMX219 datasheet instead, since the two sensors don't share a register layout.

My questions are:


1. Is there any official guidance for integrating a third-party sensor into `stm32-mw-camera` — driver/BSP side?

2. Beyond the lane count and PHY bitrate, is there anything else specific to porting from a 4-lane sensor (IMX335) to a 2-lane one (IMX219) that I should watch out for?

 

If writing a custom driver isn't the recommended path here, I'd appreciate pointers to a supported alternative instead.

Thanks

Best answer by MOBEJ

Hello ​@theconverter , 

A custom driver is the recommended approach for an unsupported sensor such as IMX219. You can use imx335.c and cmw_imx335.c as a software-flow reference, but IMX219 register settings must come from its own datasheet.

Besides the 2 CSI-2 lanes and PHY bitrate, please verify lane mapping/polarity, sensor clock and PLL settings,  DCMIPP pixel format, and resolution/frame-rate timings.

Please also check this similar ST Community post, which may help address your questions: STM32N6 Camera Module | Community.

Br

4 replies

MOBEJ
MOBEJBest answer
ST Employee
August 17, 2026

Hello ​@theconverter , 

A custom driver is the recommended approach for an unsupported sensor such as IMX219. You can use imx335.c and cmw_imx335.c as a software-flow reference, but IMX219 register settings must come from its own datasheet.

Besides the 2 CSI-2 lanes and PHY bitrate, please verify lane mapping/polarity, sensor clock and PLL settings,  DCMIPP pixel format, and resolution/frame-rate timings.

Please also check this similar ST Community post, which may help address your questions: STM32N6 Camera Module | Community.

Br

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Associate
August 23, 2026

Hello,

First of all, ​@MOBEJ thank you for your previous guidance that helped me successfully bring up the IMX219 sensor on the STM32N6 Nucleo Board.

The camera is streaming properly at the desired frame rates, but I now need to improve the image colors using ISP tuning. Since the IMX219 is not natively supported in the X-CUBE-ISP middleware and the IQTune tool, I would like to ask:

  • Do I need to manually add the IMX219 profile to the ISP middleware stack, similarly to how I implemented the custom camera sensor driver? If manual integration is required, what is the recommended workflow to generate or adapt an ISP tuning profile for an unsupported sensor? Are there any critical parameters that I should pay close attention to during this process?

Thanks in advance for your support,

Best regards,

YBAYR.1
Associate III
September 2, 2026

Hi,

I am facing the same issue, and I haven't been able to fully connect the IMX219. How exactly should I proceed with the project to get this working? Could you share the project you worked on?

Best regards,

Visitor
September 17, 2026

Hi, 

I got the example working with IMX219, too. I have created a fork and uploaded the code here: https://github.com/hm-benidiet/x-cube-n6-camera-capture-imx219

You need arm-gcc-none-eabi, cmake, ninja and pyocd installed on your system.

I haven’t really had time yet, to test the setup, but streaming to the PC is working on my side. 

Best regards
Benedikt