cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP257F-DK: Unable to collect images from MIPI camera

rdmikkelsen
Associate III

I am trying to collect images from a MIPI camera that is not supported by default on the STM32MP257F-DK, but for which I have a driver. With that driver, it's seeing the camera as an attached device, and I can see it in the dmesg output and also as /dev/media2 in v4l2-ctl --list-devices. I have followed the steps at this link (modified to use the imx664 instead of imx335), and also steps I have found elsewhere (below). Is there anything I need to look for or change in order to actually see image frames from the camera, now that I can see the camera itself?

media-ctl -d /dev/media2 -r
media-ctl -d /dev/media2 -l "'48020000.csi':1 -> 'dcmipp_input':0 [1]"
media-ctl -d /dev/media2 -l "'dcmipp_input':2 -> 'dcmipp_main_isp':0 [1]"
media-ctl -d /dev/media2 -V "'imx664 0-0010':0 [fmt:SRGGB12_1X12/2704x1540]"
media-ctl -d /dev/media2 -V "'48020000.csi':1 [fmt:SRGGB12_1X12/2704x1540]"
media-ctl -d /dev/media2 -V "'dcmipp_input':2 [fmt:SRGGB12_1X12/2704x1540]"
media-ctl -d /dev/media2 -V "'dcmipp_main_isp':1 [fmt:RGB888_1X24/2704x1540]"
media-ctl -d /dev/media2 -V "'dcmipp_main_postproc':0 [fmt:RGB888_1X24/2704x1540 compose:(0,0)/2704x1540]"
media-ctl -d /dev/media2 -V "'dcmipp_main_postproc':1 [fmt:RGB888_1X24/2704x1540]"
v4l2-ctl -d /dev/video1 --set-fmt-video=width=2704,height=1540,pixelformat=RGBP --stream-mmap --stream-to=test.raw --stream-count=1 --verbose

I either see no output, or an output file such as test.raw which is an empty file. The v4l2-ctl command above hangs forever at this point, and I have to Ctrl+C to stop it:

VIDIOC_QUERYCAP: ok
VIDIOC_G_FMT: ok
VIDIOC_S_FMT: ok
Format Video Capture:
Width/Height : 2704/1540
Pixel Format : 'RGBP' (16-bit RGB 5-6-5)
Field : None
Bytes per Line : 5408
Size Image : 8328320
Colorspace : Rec. 709
Transfer Function : Default (maps to Rec. 709)
YCbCr/HSV Encoding: Default (maps to Rec. 709)
Quantization : Default (maps to Full Range)
Flags :
VIDIOC_REQBUFS returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_G_FMT returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_STREAMON returned 0 (Success)

I have tried a few things, including changing the link frequency from 594MHz to be a multiple of the link frequency mentioned in the driver, adding a clock-noncontinuous; line in the device tree, changing the clock frequency, and changing the size and format used in the media-ctl and v4l2-ctl commands (2704x1540 and 640x480 seem to be default sizes for this sensor). It was changing the clock frequency to match the driver's expected value that let me see the device in the first place. 

Attached are the image showing the camera topology as specified in the link above, and also a screenshot showing an ever-increasing number of CSI interrupts and an unchanging number of 0 DCMIPP interrupts taken while the capture command was hanging forever. 

Note: this is the same sensor as used here, although those issues were resolved. 

0 REPLIES 0