This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM62A7-Q1: linux kernel service and driver failure(v4l2)

Part Number: AM62A7-Q1

Tool/software:

In order to reduce the startup time.
We disable initial init script and systemd and

create an init script called myinit.sh and ln -s myinit.sh init and add v4l2 into the script.

It will be very appreciate that if you can help me analyze the reasons why v4l2 and the driver failed to load successfully.


below is the context in myinit.sh

#!/bin/sh

export PATH=/usr/bin:/sbin:/bin
export LD_LIBRARY_PATH=/lib:/usr/lib:$LD_LIBRARY_PATH
mount -t proc proc /proc
mount -n -t sysfs none /sys
mount -n -t tmpfs none /run


insmod /lib/modules/6.6.58-ti-01497-ga7758da17c28-dirty/kernel/drivers/rpmsg/rpmsg_char.ko



modprobe videobuf2-common
modprobe videobuf2-v4l2
modprobe v4l2_fwnode
modprobe v4l2_cci
modprobe v4l2-cci
# 基础框架层

modprobe i2c-atr

insmod /lib/modules/6.6.58-ti-01497-ga7758da17c28-dirty/kernel/drivers/media/i2c/ds90ub960.ko
insmod /lib/modules/6.6.58-ti-01497-ga7758da17c28-dirty/kernel/drivers/media/i2c/ds90ub953.ko
insmod /lib/modules/6.6.58-ti-01497-ga7758da17c28-dirty/kernel/drivers/media/i2c/imx219.ko

echo "Hello world!!!!!!"

exec /bin/sh

/bin/sh


but when i power on start.  It seems that the v4l2 was not insert into the project.  here is the log:


[    2.628647] devtmpfs: mounted
[    2.632259] Freeing unused kernel memory: 2496K
[    2.636861] Run /sbin/init as init process
[    2.841165] mc: Linux media interface: v0.10
[    2.863777] videodev: Linux video capture interface: v2.00
[    2.910912] ds90ub960 4-0030: supply vddio not found, using dummy regulator
[    3.045877] /bus@f0000/i2c@20020000/i2c-switch@71/i2c@1/deser@30: Fixed dependency cycle(s) with /bus@f0000/i2c@20020000/i2c-switch@71/i2c@1/deser@30/links/link@0/serializer
[    3.061416] /bus@f0000/i2c@20020000/i2c-switch@71/i2c@1/deser@30/links/link@0/serializer: Fixed dependency cycle(s) with /bus@f0000/i2c@20020000/i2c-switch@71/i2c@1/deser@30/links/link@0/serializer/i20
[    3.080192] /bus@f0000/i2c@20020000/i2c-switch@71/i2c@1/deser@30/links/link@0/serializer: Fixed dependency cycle(s) with /bus@f0000/i2c@20020000/i2c-switch@71/i2c@1/deser@30
[    3.095704] /bus@f0000/i2c@20020000/i2c-switch@71/i2c@1/deser@30/links/link@0/serializer/i2c/sensor@10: Fixed dependency cycle(s) with /bus@f0000/i2c@20020000/i2c-switch@71/i2c@1/deser@30/links/link@0r
[    3.122886] ds90ub953 4-0044: Found ub953 rev/mask 0x20
[    3.130300] /bus@f0000/i2c@20020000/i2c-switch@71/i2c@1/deser@30/links/link@0/serializer/i2c/sensor@10: Fixed dependency cycle(s) with /bus@f0000/i2c@20020000/i2c-switch@71/i2c@1/deser@30/links/link@0r
[    3.149572] /bus@f0000/i2c@20020000/i2c-switch@71/i2c@1/deser@30/links/link@0/serializer: Fixed dependency cycle(s) with /bus@f0000/i2c@20020000/i2c-switch@71/i2c@1/deser@30/links/link@0/serializer/i20
[    3.168448] /bus@f0000/i2c@20020000/i2c-switch@71/i2c@1/deser@30/links/link@0/serializer/i2c/sensor@10: Fixed dependency cycle(s) with /bus@f0000/i2c@20020000/i2c-switch@71/i2c@1/deser@30/links/link@0r
[    3.195089] imx219 5-0010: supply VANA not found, using dummy regulator
[    3.201864] imx219 5-0010: supply VDIG not found, using dummy regulator
[    3.208507] imx219 5-0010: supply VDDL not found, using dummy regulator
Starting systemd-udevd version 255.13^
Hello world!!!!!!
sh: cannot set terminal process group (-1): Inappropriate ioctl for device
sh: no job control in this shell
sh-5.2# Collecting audit messages is enabled.
[    3.343341] audit: type=1335 audit(2.908:2): pid=109 uid=0 auid=4294967295 tty=(none) ses=4294967295 subj=kernel comm="systemd-journal" exe="/usr/lib/systemd/systemd-journald" nl-mcgrp=1 op=disconnect1
Failed to acquire cgroup root path: No medium found

sh-5.2#
sh-5.2# media-ctl -p
Failed to enumerate /dev/media0 (-2)
sh-5.2# ls /dev/
autofs           mmcblk0boot1  ptmx      tty16  tty46   ttyS8
bus              mmcblk0p1     ptp0      tty17  tty47   ttyS9
console          mmcblk0p2     ptyp0     tty18  tty48   ttyp0
cpu_dma_latency  mmcblk0rpmb   ptyp1     tty19  tty49   ttyp1
dma_heap         mmcblk1       ptyp2     tty2   tty5    ttyp2
full             mmcblk1p1     ptyp3     tty20  tty50   ttyp3
gpiochip0        mmcblk1p2     ptyp4     tty21  tty51   ttyp4
gpiochip1        mtd0          ptyp5     tty22  tty52   ttyp5
gpiochip2        mtd0ro        ptyp6     tty23  tty53   ttyp6
gpiochip3        mtd1          ptyp7     tty24  tty54   ttyp7
gpiochip4        mtd1ro        ptyp8     tty25  tty55   ttyp8
gpiochip5        mtd2          ptyp9     tty26  tty56   ttyp9
gpiochip6        mtd2ro        ptypa     tty27  tty57   ttypa
hwrng            mtd3          ptypb     tty28  tty58   ttypb
i2c-0            mtd3ro        ptypc     tty29  tty59   ttypc
i2c-1            mtd4          ptypd     tty3   tty6    ttypd
i2c-2            mtd4ro        ptype     tty30  tty60   ttype
i2c-3            mtd5          ptypf     tty31  tty61   ttypf
i2c-4            mtd5ro        random    tty32  tty62   ubi_ctrl
i2c-5            mtd6          rtc1      tty33  tty63   urandom
kmsg             mtd6ro        snapshot  tty34  tty7    vcs
loop-control     mtdblock0     snd       tty35  tty8    vcs1
loop0            mtdblock1     tee0      tty36  tty9    vcsa
loop1            mtdblock2     teepriv0  tty37  ttyS0   vcsa1
loop2            mtdblock3     tty       tty38  ttyS1   vcsu
loop3            mtdblock4     tty0      tty39  ttyS10  vcsu1
loop4            mtdblock5     tty1      tty4   ttyS11  vfio
loop5            mtdblock6     tty10     tty40  ttyS2   vga_arbiter
loop6            net           tty11     tty41  ttyS3   zero
loop7            null          tty12     tty42  ttyS4
mem              pfsm-1-0x48   tty13     tty43  ttyS5
mmcblk0          port          tty14     tty44  ttyS6
mmcblk0boot0     pps0          tty15     tty45  ttyS7
sh-5.2#

  • and i have update the myinit.sh to below:

    right now the v4l2 is work ok, but problem happen below. and I can not see that the camera was add into subdev:

    sh-5.2# ls /dev/video*
    /dev/video0  /dev/video2  /dev/video4  /dev/video6  /dev/video8
    /dev/video1  /dev/video3  /dev/video5  /dev/video7
    sh-5.2#

    [    5.943056] imx219 6-0010: supply VANA not found, using dummy regulator
    [    5.950209] imx219 6-0010: supply VDIG not found, using dummy regulator
    [    5.956942] imx219 6-0010: supply VDDL not found, using dummy regulator
    [    6.509689] I/O error, dev mtdblock0, sector 0 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 2
    [    6.518869] I/O error, dev mtdblock0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
    [    6.527500] Buffer I/O error on dev mtdblock0, logical block 0, async page read
    [    6.534967] I/O error, dev mtdblock0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
    [    6.543584] Buffer I/O error on dev mtdblock0, logical block 0, async page read
    [    6.551307] I/O error, dev mtdblock0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
    [    6.559941] Buffer I/O error on dev mtdblock0, logical block 0, async page read
    [    6.567576] I/O error, dev mtdblock0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
    [    6.576221] Buffer I/O error on dev mtdblock0, logical block 0, async page read

    #!/bin/sh

    export PATH=/usr/bin:/sbin:/bin
    export LD_LIBRARY_PATH=/lib:/usr/lib:$LD_LIBRARY_PATH
    mount -t proc proc /proc
    mount -n -t sysfs none /sys
    mount -n -t tmpfs none /run

    insmod /lib/modules/6.6.58-ti-01497-ga7758da17c28-dirty/kernel/drivers/rpmsg/rpmsg_char.ko

    /usr/lib/systemd/systemd-udevd --daemon
    /usr/lib/systemd/systemd-journald &
    /sbin/udevd --daemon
    /sbin/udevadm trigger --action=add
    /sbin/udevadm settle

    media-ctl -V '"imx219 2-003c":0 [fmt:SRGGB8_1X8/1920x1080 field:none]'
    media-ctl -V '"cdns_csi2rx.30101000.csi-bridge":0 [fmt:SRGGB8_1X8/1920x1080 field:none]'
    media-ctl -V '"30102000.ticsi2rx":0 [fmt:SRGGB8_1X8/1920x1080 field:none]'


    ./opt/edgeai-gst-apps/apps_cpp/bin/Release/app_edgeai  ./opt/edgeai-gst-apps/configs/imx219_cam_example.yaml

    echo "Hello world!!!!!!"

    exec /bin/sh


    /bin/sh