2024-10-16 08:19 AM
Hi, we are using the STEVAL-CAM-M0I board to evaluate the 55G0 protomodule.
I have it connected to a raspberry pi CM4 IO breakout board, to the CAM1 CSI-2 interface.
There is a provided driver, etc for this from ST, but it appears the pinout is not 1:1. But most of the documentation shows the eval board connecting directly to a raspberry pi. So I am wondering where does the issue lie here? Is the RST controlled by the GPIO, or am I missing something about the compatibility?
It was attractive because we didn't need to make an interface board.
I see the Reset pin and the Cam GPIO pins are swapped, along with the data lines. Raspberry PI Pinout:
and the STEVAL-CAM-M0I pinout:
Thanks
Solved! Go to Solution.
2024-10-18 05:32 AM
I realized the issue. If others see this, here is the solution.
The labeling in the DTS folder of the driver provided by ST is unclear (and imo, wrong). I would request it be fixed or clarified to avoid this in the future.
The two DTS folders in the provided driver, which are labeled "rpi1_to_4" and "rpi5" are not categorized by *pi type/generation*, as they are named. But categorized by *board type*. The generic Pi 1-4 boards share a 15 pin FFC connector with a specific pinout. The Pi 3/4 CM-IO breakout boards, along with the generic Pi 5 board share the 22 pin FFC with a different pinout. These are the two DTS categories.
If using the CM4 on the CM4 IO board (and also the CM3 and CM3 IO board), it shares pin compatibility with the Pi 5. So you must use the Pi 5 DTS, not the Pi 4. Which was my issue.
2024-10-16 05:06 PM
Hello,
Yes, the camera board is fully compatible with the Raspberry Pi as mentioned in the documentation. Indeed, the reset is controlled by the GPIO. Regarding the swapped pins you mentioned, it will be fine if you simply swap the flex cable; it should be compatible.
Thank you, Megane.
2024-10-17 04:43 AM
Hi Megane,
Thanks for the reply.
Using the ST provided driver and device tree overlay, I am unfortunately seeing that the NRST line on the ST board is being held low by the CM4's CAM_GPIO pin. I must manually set it high in the terminal (`$ gpioset 1 5=1`) in order for the i2c communication to work and the driver's probe to be successful. It seems this is not handled automatically in this hardware configuration.
Has ST verified specifically with the Pi CM4 IO board? I think maybe there are hardware differences here in GPIO routing and pin usage, perhaps.
Best regards
2024-10-17 05:04 AM
After raising the GPIO line that was preventing the driver from loading, I am able to successfully re-insert the driver with insmod. I built it with debug enabled, and see:
$ sudo insmod /lib/modules/6.6.31+rpt-rpi-v8/vd55g0.ko
$ dmesg
...
[ 145.911583] vd55g0 10-0010: tx uses 1 lanes
[ 145.911599] vd55g0 10-0010: log2phy[0] = 0
[ 145.911603] vd55g0 10-0010: phy2log[0] = 0
[ 145.911607] vd55g0 10-0010: polarity[0] = 1
[ 145.911611] vd55g0 10-0010: log2phy[1] = 1
[ 145.911614] vd55g0 10-0010: phy2log[1] = 1
[ 145.911617] vd55g0 10-0010: polarity[1] = 1
[ 145.911621] vd55g0 10-0010: log2phy[2] = 2
[ 145.911624] vd55g0 10-0010: phy2log[2] = 2
[ 145.911627] vd55g0 10-0010: polarity[2] = 0
[ 145.911631] vd55g0 10-0010: oif_ctrl = 0x00c9
[ 146.715000] vd55g0 10-0010: patch 2.11 applied
[ 146.730401] vd55g0 10-0010: vd55g0 probe successfully
Then, I try to interface with the camera using rpicam-hello (libcamera library/interface). I can see it:
$ rpicam-hello --list
Available cameras
-----------------
0 : vd55g0 [644x604 10-bit MONO] (/base/soc/i2c0mux/i2c@1/foxy@10)
Modes: 'R8' : 320x240 [189.93 fps - (2, 62)/640x480 crop]
640x480 [122.99 fps - (2, 62)/640x480 crop]
640x600 [122.99 fps - (2, 2)/640x600 crop]
644x604 [122.99 fps - (0, 0)/644x604 crop]
'R10_CSI2P' : 320x240 [189.93 fps - (2, 62)/640x480 crop]
640x480 [122.99 fps - (2, 62)/640x480 crop]
640x600 [122.99 fps - (2, 2)/640x600 crop]
644x604 [122.99 fps - (0, 0)/644x604 crop]
But trying to open a stream fails:
$ rpicam-hello
[0:08:18.325982224] [2500] INFO Camera camera_manager.cpp:325 libcamera v0.0.0+5043-4369fb9f-dirty (2024-10-01T13:21:48UTC)
[0:08:18.344259853] [2506] WARN CameraSensor camera_sensor.cpp:257 'vd55g0 10-0010': Recommended V4L2 control 0x009a0922 not supported
[0:08:18.344358520] [2506] WARN CameraSensor camera_sensor.cpp:329 'vd55g0 10-0010': The sensor kernel driver needs to be fixed
[0:08:18.344377445] [2506] WARN CameraSensor camera_sensor.cpp:331 'vd55g0 10-0010': See Documentation/sensor_driver_requirements.rst in the libcamera sources for more information
[0:08:18.345044294] [2506] WARN CameraSensorProperties camera_sensor_properties.cpp:305 No static properties available for 'vd55g0'
[0:08:18.345074275] [2506] WARN CameraSensorProperties camera_sensor_properties.cpp:307 Please consider updating the camera sensor properties database
[0:08:18.345092294] [2506] WARN CameraSensor camera_sensor.cpp:477 'vd55g0 10-0010': Failed to retrieve the camera location
[0:08:18.345109534] [2506] WARN CameraSensor camera_sensor.cpp:499 'vd55g0 10-0010': Rotation control not available, default to 0 degrees
[0:08:18.377315463] [2506] WARN RPiSdn sdn.cpp:40 Using legacy SDN tuning - please consider moving SDN inside rpi.denoise
[0:08:18.378996899] [2506] INFO RPI vc4.cpp:447 Registered camera /base/soc/i2c0mux/i2c@1/foxy@10 to Unicam device /dev/media2 and ISP device /dev/media0
[0:08:18.379125065] [2506] INFO RPI pipeline_base.cpp:1126 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
Made X/EGL preview window
Mode selection for 322:302:12:P
R8,320x240/0 - Score: 2228.17
R8,640x480/0 - Score: 2224.17
R8,640x600/0 - Score: 2154.17
R8,644x604/0 - Score: 2156
R10_CSI2P,320x240/0 - Score: 1228.17
R10_CSI2P,640x480/0 - Score: 1224.17
R10_CSI2P,640x600/0 - Score: 1154.17
R10_CSI2P,644x604/0 - Score: 1156
Stream configuration adjusted
[0:08:19.566141470] [2500] INFO Camera camera.cpp:1197 configuring streams: (0) 322x302-YUV420 (1) 640x600-R10_CSI2P
[0:08:19.566604153] [2506] INFO RPI vc4.cpp:622 Sensor: /base/soc/i2c0mux/i2c@1/foxy@10 - Selected sensor format: 640x600-Y10_1X10 - Selected unicam format: 640x600-Y10P
[0:08:19.570453245] [2520] WARN IPARPI ipa_base.cpp:1065 Could not set SHARPNESS - no sharpen algorithm
[0:08:20.113279494] [2506] ERROR V4L2 v4l2_videodevice.cpp:1994 /dev/video0[13:cap]: Failed to start streaming: Connection timed out
ERROR: *** failed to start camera ***
And related driver debug messages in the kernel log for the above command:
[ 500.120632] vd55g0 10-0010: sensor reset failed -110
[ 500.120667] unicam fe801000.csi: stream on failed in subdev
Feel a bit stuck, and not sure if this is supposed to work out of the box. Thanks for the help!
2024-10-18 05:32 AM
I realized the issue. If others see this, here is the solution.
The labeling in the DTS folder of the driver provided by ST is unclear (and imo, wrong). I would request it be fixed or clarified to avoid this in the future.
The two DTS folders in the provided driver, which are labeled "rpi1_to_4" and "rpi5" are not categorized by *pi type/generation*, as they are named. But categorized by *board type*. The generic Pi 1-4 boards share a 15 pin FFC connector with a specific pinout. The Pi 3/4 CM-IO breakout boards, along with the generic Pi 5 board share the 22 pin FFC with a different pinout. These are the two DTS categories.
If using the CM4 on the CM4 IO board (and also the CM3 and CM3 IO board), it shares pin compatibility with the Pi 5. So you must use the Pi 5 DTS, not the Pi 4. Which was my issue.
2024-10-21 12:31 AM
Hello ,
Glad to hear it work!
I the DTS folder is more related to the type connector
RPI1-4 is 15pin FPC connector
RPI5 is 22pin FPC connector