Finally, I have made the driver works, but I cannot preview the camera or record any YUV data to file, following are details:
- change my code base to 5.15.71-2.2.0 refers to https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-%E6%9C%BA%E5%99%A8%E4%BA%BA%E5%B9%B... , because this code base 's kernel version is 5.15.71 which has the same driver of ap1302 as imx93 does;
- patch the attached path of kernel, the patch is about the dts config for imx8mp-ai-robot platform;
- copy the imx93's ap1302.fw to the bord refers to https://docs.nxp.com/bundle/UM11933/page/topics/getting_started.html , I got the log says that the fw load success:
[ 2.805324] ap1302_mipi 1-003c: AP1302 Chip ID is 0x265
[ 2.810659] ap1302_mipi 1-003c: Direct firmware load for imx/camera/ap1302.fw failed with error -2
[ 2.813112] ap1302_mipi 1-003c: AP1302 is found
[ 2.819672] ap1302_mipi 1-003c: Falling back to sysfs fallback for: imx/camera/ap1302.fw
[ 6.530390] mx8-img-md: Registered mxc_isi.0.capture as /dev/video3
[ 6.549580] mxc-md 32c00000.bus:camera: Entity type for entity ap1302_mipi 1-003c was not initialized!
[ 6.560558] mx8-img-md: Registered sensor subdevice: ap1302_mipi 1-003c (1)
[ 6.568136] mx8-img-md: created link [mxc_isi.0] => [mxc_isi.0.capture]
[ 6.577608] mx8-img-md: created link [mxc-mipi-csi2.0] => [mxc_isi.0]
[ 6.589038] mx8-img-md: created link [ap1302_mipi 1-003c] => [mxc-mipi-csi2.0]
[ 24.478006] ap1302_mipi 1-003c: Load firmware successfully.
4. use the comand to preview or record YUV data fo file refers to https://docs.nxp.com/bundle/UM11933/page/topics/software_introduction.html , unfortunately it got nothing, no preview on my HDMI monitor, the record file size is 0, here is the terminal log when do preview
root@imx-robot-foxy:~# gst-launch-1.0 -v v4l2src device=/dev/video3 ! "video/x-raw,format=YUY2,width=1280,height=800" ! queue ! waylandsink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipelin[ 57.387455] bypass csc
e0/GstV4l2Src:v4l2src0.GstPad:src[ 57.392240] input fmt YUV4
: caps = video/x-raw, format=(str[ 57.397812] output fmt YUYV
ing)YUY2, width=(int)1280, height=(int)800, framerate=(fraction)120/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:5:1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)800, framerate=(fraction)120/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:5:1
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)800, framerate=(fraction)120/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:5:1
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)800, framerate=(fraction)120/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:5:1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)800, framerate=(fraction)120/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:5:1
/GstPipeline:pipeline0/GstWaylandSink:waylandsink0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)800, framerate=(fraction)120/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:5:1
[ 1018.967454] audit: type=1006 audit(1651206601.900:4): pid=1459 uid=0 old-auid=4294967295 auid=0 tty=(none) old-ses=4294967295 ses=3 res=1
[ 1018.979853] audit: type=1300 audit(1651206601.900:4): arch=c00000b7 syscall=64 success=yes exit=1 a0=3 a1=ffffe9948370 a2=1 a3=ffff90756020 items=0 ppid=416 pid=1459 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=3 comm="crond" exe="/usr/sbin/crond" key=(null)
[ 1019.005595] audit: type=1327 audit(1651206601.900:4): proctitle=2F7573722F7362696E2F63726F6E64002D6E
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:20:14.988214000
Setting pipeline to NULL ...
Freeing pipeline ...
5.I check the voltage test points on RPI-CAM-MIPI board, the voltages are correct.
Please give me some advice to inspect the issue.
Thanks in advance.