AR0521 Camera Firmware Issue

Hello dear community,

I am currently trying to set up e-con Systems camera “5MP AR0521 Color” via MIPI CSI interface with a Toradex SoM. My issue is regarding camera firmware errors and missing recognition of the camera by the device.

Here is my setup:

Notably, “tdx-info” outputs that I am on a Verdin Development Board, but I am definitely on a Dahlia Carrier Board. Has this to be specified when building OS image with yocto? I couldn’t find this specification. Also “Toradex Version” is set at “V1.1A” although I am setup with “V1.0A” (intermediary adapter between camera and board).

Also, I am getting error logs in the kernel message buffer (see below). It seems that camera firmware is an issue. As stated at (First Steps with CSI Camera Set 5MP AR0521 Color (Linux) | Toradex Developer Center), I did not interrupt the system upon start up for at least 5 minutes to not corrupt camera firmware.
Is it possible to reset the camera firmware? And if, how?

I2cdetect cli tool reports a signal at position 0x42 for i2c-2 (see below). According to the device tree overlay (cannot post link due to newbie forum restrictions… its at github meta-toradex-econ), I would expect this signal for i2c-3. Is this correct behaviour? Deactivating the device tree overlay removes this signal.

Output of “tdx-info” cli tool:

root@verdin-imx8mp-15207768:~# tdx-info

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           5.15.148-6.9.0-devel+git.b8ff6db6dfa5 #1 SMP PREEMPT Mon Oct 28 11:46:29 UTC 2024
Kernel command line:      root=PARTUUID=8c14ef15-02 ro rootwait console=tty1 console=ttymxc2,115200 consoleblank=0 earlycon
Distro name:              NAME="TDX Wayland with XWayland"
Distro version:           VERSION_ID=6.9.0-devel-20241119190642-build.0
Distro variant:           -
Hostname:                 verdin-imx8mp-15207768
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Plus WB on Verdin Development Board
Toradex version:          0070 V1.1A
Serial number:            15207768
Processor arch:           aarch64

Logs (“dmesg”):

root@verdin-imx8mp-15207768:~# dmesg
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.15.148-6.9.0-devel+git.b8ff6db6dfa5 (oe-user@oe-host) (aarch64-tdx-linux-gcc (GCC) 11.5.0, GNU ld (GNU Binutils) 2.38.20220708) #1 SMP PREEMPT Mon Oct 28 11:46:29 UTC 2024
[    0.000000] Machine model: Toradex Verdin iMX8M Plus WB on Verdin Development Board
[    0.000000] efi: UEFI not found.
[    0.000000] Reserved memory: created CMA memory pool at 0x00000000a0000000, size 512 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] earlycon: ec_imx6q0 at MMIO 0x0000000030880000 (options '')
[    0.000000] printk: bootconsole [ec_imx6q0] enabled
[    0.000000] NUMA: No NUMA configuration found
[    0.000000] NUMA: Faking a node at [mem 0x0000000040000000-0x000000023fffffff]
[    0.000000] NUMA: NODE_DATA [mem 0x23ef94800-0x23ef96fff]
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000040000000-0x00000000ffffffff]
[    0.000000]   DMA32    empty
[    0.000000]   Normal   [mem 0x0000000100000000-0x000000023fffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000040000000-0x000000023fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x000000023fffffff]
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.2
[    0.000000] percpu: Embedded 20 pages/cpu s42712 r8192 d31016 u81920
[    0.000000] pcpu-alloc: s42712 r8192 d31016 u81920 alloc=20*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: detected: GIC system register CPU interface
[    0.000000] CPU features: detected: ARM erratum 845719
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 2064384
[    0.000000] Policy zone: Normal
[    0.000000] Kernel command line: root=PARTUUID=8c14ef15-02 ro rootwait console=tty1 console=ttymxc2,115200 consoleblank=0 earlycon
[    0.000000] Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes, linear)
[    0.000000] Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] software IO TLB: mapped [mem 0x00000000fbac0000-0x00000000ffac0000] (64MB)
[    0.000000] Memory: 7608052K/8388608K available (16448K kernel code, 1762K rwdata, 7148K rodata, 3264K init, 528K bss, 256268K reserved, 524288K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
[    0.000000]  Trampoline variant of Tasks RCU enabled.
[    0.000000]  Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GICv3: GIC: Using split EOI/Deactivate mode
[    0.000000] GICv3: 160 SPIs implemented
[    0.000000] GICv3: 0 Extended SPIs implemented
[    0.000000] GICv3: Distributor has no Range Selector support
[    0.000000] Root IRQ handler: gic_handle_irq
[    0.000000] GICv3: 16 PPIs implemented
[    0.000000] GICv3: CPU0: found redistributor 0 region 0:0x0000000038880000
[    0.000000] ITS: No ITS available, not enabling LPIs
[    0.000000] arch_timer: cp15 timer(s) running at 8.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 440795202120 ns
[    0.000000] sched_clock: 56 bits at 8MHz, resolution 125ns, wraps every 2199023255500ns
[    0.008603] Console: colour dummy device 80x25
[    0.012977] printk: console [tty1] enabled
[    0.016688] Calibrating delay loop (skipped), value calculated using timer frequency.. 16.00 BogoMIPS (lpj=32000)
[    0.026965] pid_max: default: 32768 minimum: 301
[    0.031640] LSM: Security Framework initializing
[    0.036328] Mount-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.043870] Mountpoint-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.053320] rcu: Hierarchical SRCU implementation.
[    0.057719] EFI services will not be available.
[    0.061530] smp: Bringing up secondary CPUs ...
[    0.066277] Detected VIPT I-cache on CPU1
[    0.066306] GICv3: CPU1: found redistributor 1 region 0:0x00000000388a0000
[    0.066343] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.066802] Detected VIPT I-cache on CPU2
[    0.066824] GICv3: CPU2: found redistributor 2 region 0:0x00000000388c0000
[    0.066843] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.067292] Detected VIPT I-cache on CPU3
[    0.067312] GICv3: CPU3: found redistributor 3 region 0:0x00000000388e0000
[    0.067330] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.067390] smp: Brought up 1 node, 4 CPUs
[    0.122432] SMP: Total of 4 processors activated.
[    0.127146] CPU features: detected: 32-bit EL0 Support
[    0.132329] CPU features: detected: 32-bit EL1 Support
[    0.137476] CPU features: detected: CRC32 instructions
[    0.149688] CPU: All CPU(s) started at EL2
[    0.150991] alternatives: patching kernel code
[    0.157491] devtmpfs: initialized
[    0.168649] KASLR disabled due to lack of seed
[    0.170388] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.180082] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.201092] pinctrl core: initialized pinctrl subsystem
[    0.204031] DMI not present or invalid.
[    0.207924] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.218248] DMA: preallocated 1024 KiB GFP_KERNEL pool for atomic allocations
[    0.223052] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.231029] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.238585] audit: initializing netlink subsys (disabled)
[    0.244126] audit: type=2000 audit(0.176:1): state=initialized audit_enabled=0 res=1
[    0.244587] thermal_sys: Registered thermal governor 'step_wise'
[    0.251734] thermal_sys: Registered thermal governor 'power_allocator'
[    0.258024] cpuidle: using governor menu
[    0.268447] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.275160] ASID allocator initialised with 65536 entries
[    0.280781] Serial: AMBA PL011 UART driver
[    0.284678] imx mu driver is registered.
[    0.288564] imx rpmsg driver is registered.
[    0.304912] imx8mp-pinctrl 30330000.pinctrl: initialized IMX pinctrl driver
[    0.320594] platform 32e80000.lcd-controller: Fixing up cyclic dependency with 32e60000.mipi_dsi
[    0.331783] platform 32fd8000.hdmi: Fixing up cyclic dependency with 32fc6000.lcd-controller
[    0.356577] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[    0.360484] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
[    0.367225] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.373940] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[    0.381844] cryptd: max_cpu_qlen set to 1000
[    0.388067] ACPI: Interpreter disabled.
[    0.390598] iommu: Default domain type: Translated
[    0.393978] iommu: DMA domain TLB invalidation policy: strict mode
[    0.400420] vgaarb: loaded
[    0.403223] SCSI subsystem initialized
[    0.406881] libata version 3.00 loaded.
[    0.407059] usbcore: registered new interface driver usbfs
[    0.412288] usbcore: registered new interface driver hub
[    0.417621] usbcore: registered new device driver usb
[    0.423774] mc: Linux media interface: v0.10
[    0.426978] videodev: Linux video capture interface: v2.00
[    0.432530] pps_core: LinuxPPS API ver. 1 registered
[    0.437450] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.446657] PTP clock support registered
[    0.450759] EDAC MC: Ver: 3.0.0
[    0.454777] FPGA manager framework
[    0.457218] Advanced Linux Sound Architecture Driver Initialized.
[    0.464327] clocksource: Switched to clocksource arch_sys_counter
[    0.469554] VFS: Disk quotas dquot_6.6.0
[    0.473377] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.480440] pnp: PnP ACPI: disabled
[    0.489929] NET: Registered PF_INET protocol family
[    0.492206] IP idents hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.502590] tcp_listen_portaddr_hash hash table entries: 4096 (order: 4, 65536 bytes, linear)
[    0.508406] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.516115] TCP established hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.524491] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes, linear)
[    0.532470] TCP: Hash tables configured (established 65536 bind 65536)
[    0.538172] UDP hash table entries: 4096 (order: 5, 131072 bytes, linear)
[    0.545031] UDP-Lite hash table entries: 4096 (order: 5, 131072 bytes, linear)
[    0.552417] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.558241] RPC: Registered named UNIX socket transport module.
[    0.563797] RPC: Registered udp transport module.
[    0.568533] RPC: Registered tcp transport module.
[    0.573241] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.579716] PCI: CLS 0 bytes, default 64
[    0.584313] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available
[    0.592697] kvm [1]: IPA Size Limit: 40 bits
[    0.597725] kvm [1]: GICv3: no GICV resource entry
[    0.600981] kvm [1]: disabling GICv2 emulation
[    0.605447] kvm [1]: GIC system register CPU interface enabled
[    0.611394] kvm [1]: vgic interrupt IRQ9
[    0.615349] kvm [1]: Hyp mode initialized successfully
[    0.623812] Initialise system trusted keyrings
[    0.625558] workingset: timestamp_bits=42 max_order=21 bucket_order=0
[    0.637544] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.641106] NFS: Registering the id_resolver key type
[    0.645658] Key type id_resolver registered
[    0.649832] Key type id_legacy registered
[    0.653922] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.660596] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[    0.668169] 9p: Installing v9fs 9p2000 file system support
[    0.709668] Key type asymmetric registered
[    0.710920] Asymmetric key parser 'x509' registered
[    0.715866] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 243)
[    0.723267] io scheduler mq-deadline registered
[    0.727812] io scheduler kyber registered
[    0.737632] EINJ: ACPI disabled.
[    0.746768] mxs-dma 33000000.dma-apbh: initialized
[    0.749988] SoC: i.MX8MP revision 1.1
[    0.752985] Bus freq driver module loaded
[    0.762843] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.768633] 30860000.serial: ttymxc0 at MMIO 0x30860000 (irq = 34, base_baud = 1500000) is a IMX
[    0.775615] 30880000.serial: ttymxc2 at MMIO 0x30880000 (irq = 35, base_baud = 1500000) is a IMX
[    0.784020] printk: console [ttymxc2] enabled
[    0.792666] printk: bootconsole [ec_imx6q0] disabled
[    0.802998] 30890000.serial: ttymxc1 at MMIO 0x30890000 (irq = 36, base_baud = 1500000) is a IMX
[    0.814679] 30a60000.serial: ttymxc3 at MMIO 0x30a60000 (irq = 44, base_baud = 1500000) is a IMX
[    0.823589] serial serial0: tty port ttymxc3 registered
[    0.844241] brd: module loaded
[    0.851380] loop: module loaded
[    0.855940] megasas: 07.717.02.00-rc1
[    0.866238] tun: Universal TUN/TAP device driver, 1.6
[    0.872713] e1000: Intel(R) PRO/1000 Network Driver
[    0.877615] e1000: Copyright (c) 1999-2006 Intel Corporation.
[    0.883417] e1000e: Intel(R) PRO/1000 Network Driver
[    0.888392] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[    0.894358] igb: Intel(R) Gigabit Ethernet Network Driver
[    0.899769] igb: Copyright (c) 2007-2014 Intel Corporation.
[    0.905376] igbvf: Intel(R) Gigabit Virtual Function Network Driver
[    0.911657] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
[    0.917861] usbcore: registered new device driver r8152-cfgselector
[    0.924171] usbcore: registered new interface driver r8152
[    0.929932] VFIO - User Level meta-driver version: 0.3
[    0.941018] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.947599] ehci-pci: EHCI PCI platform driver
[    0.952127] ehci-platform: EHCI generic platform driver
[    0.957611] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.963843] ohci-pci: OHCI PCI platform driver
[    0.968341] ohci-platform: OHCI generic platform driver
[    0.974476] usbcore: registered new interface driver uas
[    0.979848] usbcore: registered new interface driver usb-storage
[    0.985933] usbcore: registered new interface driver usbserial_generic
[    0.992493] usbserial: USB Serial support registered for generic
[    0.998538] usbcore: registered new interface driver ftdi_sio
[    1.004312] usbserial: USB Serial support registered for FTDI USB Serial Device
[    1.011670] usbcore: registered new interface driver usb_serial_simple
[    1.018226] usbserial: USB Serial support registered for carelink
[    1.024346] usbserial: USB Serial support registered for flashloader
[    1.030725] usbserial: USB Serial support registered for funsoft
[    1.036762] usbserial: USB Serial support registered for google
[    1.042709] usbserial: USB Serial support registered for hp4x
[    1.048483] usbserial: USB Serial support registered for kaufmann
[    1.054604] usbserial: USB Serial support registered for libtransistor
[    1.061161] usbserial: USB Serial support registered for moto_modem
[    1.067453] usbserial: USB Serial support registered for motorola_tetra
[    1.074093] usbserial: USB Serial support registered for nokia
[    1.079952] usbserial: USB Serial support registered for novatel_gps
[    1.086335] usbserial: USB Serial support registered for siemens_mpi
[    1.092714] usbserial: USB Serial support registered for suunto
[    1.098668] usbserial: USB Serial support registered for vivopay
[    1.104702] usbserial: USB Serial support registered for zio
[    1.110401] usbcore: registered new interface driver usb_ehset_test
[    1.116956] usbcore: registered new device driver onboard-usb-hub
[    1.126829] input: 30370000.snvs:snvs-powerkey as /devices/platform/soc@0/30000000.bus/30370000.snvs/30370000.snvs:snvs-powerkey/input/input0
[    1.141655] snvs_rtc 30370000.snvs:snvs-rtc-lp: registered as rtc1
[    1.148008] i2c_dev: i2c /dev entries driver
[    1.157569] EDAC MC: ECC not enabled
[    1.162571] sdhci: Secure Digital Host Controller Interface driver
[    1.168796] sdhci: Copyright(c) Pierre Ossman
[    1.173743] Synopsys Designware Multimedia Card Interface Driver
[    1.180559] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.189176] ledtrig-cpu: registered to indicate activity on CPUs
[    1.196163] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, skipping ....
[    1.203112] usbcore: registered new interface driver usbhid
[    1.208708] usbhid: USB HID core driver
[    1.217990]  cs_system_cfg: CoreSight Configuration manager initialised
[    1.219699] mmc2: SDHCI controller on 30b60000.mmc [30b60000.mmc] using ADMA
[    1.227680] hantrodec 0 : module inserted. Major = 510
[    1.237322] hantrodec 1 : module inserted. Major = 510
[    1.243972] hantroenc: HW at base <0000000038320000> with ID <0x80006200>
[    1.250914] hx280enc: module inserted. Major <509>
[    1.261303] NET: Registered PF_LLC protocol family
[    1.266666] NET: Registered PF_INET6 protocol family
[    1.274128] Segment Routing with IPv6
[    1.277849] In-situ OAM (IOAM) with IPv6
[    1.281837] NET: Registered PF_PACKET protocol family
[    1.287854] 8021q: 802.1Q VLAN Support v1.8
[    1.292167] 9pnet: Installing 9P2000 support
[    1.296490] tsn generic netlink module v1 init...
[    1.301294] Key type dns_resolver registered
[    1.306505] Loading compiled-in X.509 certificates
[    1.319136] mmc2: new HS400 Enhanced strobe MMC card at address 0001
[    1.326818] mmcblk2: mmc2:0001 IX2932 29.1 GiB
[    1.333415]  mmcblk2: p1 p2
[    1.334062] reg-fixed-voltage regulator-force-sleep-moci: nonexclusive access to GPIO for regulator-force-sleep-moci
[    1.337642] mmcblk2boot0: mmc2:0001 IX2932 4.00 MiB
[    1.347684] +V3.3_SD: supplied by +V3.3_SW
[    1.353318] mmcblk2boot1: mmc2:0001 IX2932 4.00 MiB
[    1.362961] mmcblk2rpmb: mmc2:0001 IX2932 4.00 MiB, chardev (234:0)
[    1.408168] nxp-pca9450 0-0025: pca9450bc probed.
[    1.420653] rtc-ds1307 0-0032: oscillator failed, set time!
[    1.426953] rtc-ds1307 0-0032: registered as rtc0
[    1.433805] rtc-ds1307 0-0032: hctosys: unable to read the hardware clock
[    1.446701] at24 0-0050: supply vcc not found, using dummy regulator
[    1.455062] at24 0-0050: 256 byte 24c02 EEPROM, writable, 16 bytes/write
[    1.461860] i2c i2c-0: IMX I2C adapter registered
[    1.467628] i2c i2c-1: IMX I2C adapter registered
[    1.473641] i2c 2-0042: Fixing up cyclic dependency with 32e40000.csi
[    2.461688] ddrc freq set to low bus mode
[    2.607355] Previous Firmware Version - (1150CU96RKV1901110d381894XXXXXXX)
[    2.614471]  Trying to Detect Bootloader mode
[    3.056921] i2c i2c-2: <i2c_imx_read> read timedout
[    3.061874] ar0521 2-0042: Failed reading register ret = -110!
[    3.067746] ar0521 2-0042: Read Failed
[    3.178095] ar0521 2-0042: Failed writing register.
[    3.183004] ar0521 2-0042: addr: 42; val = 1, ret = -6!
[    3.188264] ar0521 2-0042: Write Failed
[    3.298089] ar0521 2-0042: Failed writing register.
[    3.303000] ar0521 2-0042: addr: 42; val = 1, ret = -6!
[    3.308259] ar0521 2-0042: Write Failed
[    3.418119] ar0521 2-0042: Failed writing register.
[    3.423031] ar0521 2-0042: addr: 42; val = 1, ret = -6!
[    3.428290] ar0521 2-0042: Write Failed
[    3.537584] ar0521 2-0042: Failed writing register.
[    3.542491] ar0521 2-0042: addr: 42; val = 1, ret = -6!
[    3.547751] ar0521 2-0042: Write Failed
[    3.658114] ar0521 2-0042: Failed writing register.
[    3.663018] ar0521 2-0042: addr: 42; val = 1, ret = -6!
[    3.668280] ar0521 2-0042: Write Failed
[    3.778142] ar0521 2-0042: Failed writing register.
[    3.783048] ar0521 2-0042: addr: 42; val = 1, ret = -6!
[    3.788304] ar0521 2-0042: Write Failed
[    4.100878] i2c i2c-2: <i2c_imx_read> read timedout
[    4.105792] ar0521 2-0042: Failed reading register ret = -110!
[    4.111656] ar0521 2-0042: Read Failed
[    4.222093] ar0521 2-0042: Failed writing register.
[    4.226998] ar0521 2-0042: addr: 42; val = 1, ret = -6!
[    4.232259] ar0521 2-0042: Write Failed
[    4.342609] ar0521 2-0042: Failed writing register.
[    4.347525] ar0521 2-0042: addr: 42; val = 1, ret = -6!
[    4.352777] ar0521 2-0042: Write Failed
[    4.464890] ar0521 2-0042: Error getting firmware version in bootloader mode
[    4.471976] ar0521 2-0042: Error occurred when verifying MCU
[    4.477802] ar0521: probe of 2-0042 failed with error -22
[    4.484223] i2c i2c-2: IMX I2C adapter registered
[    4.497766] pca953x 3-0021: using no AI
[    4.503390] pca953x 3-0021: failed writing register
[    4.510687] i2c 3-0048: Fixing up cyclic dependency with 32e60000.mipi_dsi
[    4.517841] i2c 3-0048: Fixing up cyclic dependency with hdmi-connector
[    4.526783] at24 3-0050: supply vcc not found, using dummy regulator
[    4.535879] at24 3-0050: 256 byte 24c02 EEPROM, writable, 16 bytes/write
[    4.543385] at24 3-0057: supply vcc not found, using dummy regulator
[    4.552794] at24 3-0057: 256 byte 24c02 EEPROM, writable, 16 bytes/write
[    4.560802] i2c i2c-3: IMX I2C adapter registered
root@verdin-imx8mp-15207768:~# i2cdetect 2
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-2.
I will probe address range 0x08-0x77.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- 42 -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Thank you for your support. Any advice is welcome!

Best regards,
Aljoscha

Hi @ajsnp!

To change the HW model on tdx-info, you’ll need to change the device tree on U-Boot. To do that, you’ll have to stop it on U-Boot by pressing any key while it is booting, then you can use the following commands:

setenv fdt_board dahlia
setenv fdtfile
saveenv

After that, you can reboot the module and it should show the correct HW model on tdx-info.

About the Toradex Version, it is related to the version of your module/SoC (Verdin iMX8MP, in this case) and not to the camera or its adapter.

Going back to the camera issue, the signal reported on i2c-2 is correct. If you check the file imx8mp.dtsi, you can verify that the node i2c3 is “pointing” to i2c2, which is where you’ve found the signal.

About the error, it means that the device could not be found, so I will ask you to verify if it is correctly connected to the board (you can send a picture), and be sure that you didn’t bend the cable, as it could break it. Could you try with another cable too?

Feel free to ask if you have any doubts or issues.

Best regards.
Lucas Azeituno

1 Like

Hello @lucas_az.tx,

thank you for your reply!
I have attached images of the physical hardware setup:

I was able to verify electronical connection of the ffc cable with a multimeter by measuring resistance on the pins. So this seems to be fine and I did not try with another cable since I do not have any at hand. Also, when I connect the ffc cable flipped-alongside, I can not measure low resistance on the pins anymore.
However, I could not yet verify connection between camera and board overall, i.e. from camera module board to dahlia carrier board. Is there an extensive datasheet about this or do you have an idea which pins/parts I could measure resistance on camera and board to verify full connection?

Regarding the “tdx-info” output, I was able to enter boot menu over the serial interface and change board information as described. “tdx-info” now outputs the correct carrier board but the issue remains with same logs in “dmesg”.

Since the camera driver outputs return values like “-6” and “-110”. Is there any documentation on what these return values mean?

Also, hardware clock reports an error (“rtc-ds1307 0-0032: hctosys: unable to read the hardware clock”). Could this be an issue?

Thank you for your support!

Best regards,
Aljoscha Rydzyk

Hi @ajsnp!

We have never faced this issue. This camera is validated, and, as far as we knew, it was working properly.

That said, I would ask you to try to recover the camera because the firmware is probably broken. For that, what we tested before was:

Could you please do these steps and verify if it solves the problem?

About the error codes, you can check them on two files in the Linux kernel:

Feel free to ask if you have any doubts or issues.

Best regards.
Lucas Fernandes Azeituno

Hello @lucas_az.tx,

I followed your proposed procedure to try and recover the camera.
After some tries I have finally able to flash TorizonCore 5 (“Torizon OS 5” is not a thing, right?) with added device tree overlay for AR0521 onto the device.
It worked by using TorizonCore Builder with SSH deployment on the already running device (“torizoncore-builder deploy…”). Notably, it did not work using the Toradex Easy Installer (“image not compatible with this module”) but this is probably a different issue.

With TorizonCore 5 installed, the camera driver started properly! Full log to camera driver:

torizon@verdin-imx8mp-15207768:~$ dmesg
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.4.193-5.7.2+git.b60d3160fd04 (oe-user@oe-host) (gcc version 9.5.0 (GCC)) #1-TorizonCore SMP PREEMPT Fri Dec 23 15:47:24 UTC 2022
[    0.000000] Machine model: Toradex Verdin iMX8M Plus on Dahlia Board
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 1376 MiB at 0x00000000a8000000
[    0.000000] NUMA: No NUMA configuration found
[    0.000000] NUMA: Faking a node at [mem 0x0000000040000000-0x000000023fffffff]
[    0.000000] NUMA: NODE_DATA [mem 0x23f034500-0x23f035fff]
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000040000000-0x00000000ffffffff]
[    0.000000]   Normal   [mem 0x0000000100000000-0x000000023fffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000040000000-0x00000000557fffff]
[    0.000000]   node   0: [mem 0x0000000056000000-0x00000000923fffff]
[    0.000000]   node   0: [mem 0x00000000a4400000-0x000000023fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x000000023fffffff]
[    0.000000] On node 0 totalpages: 2021376
[    0.000000]   DMA32 zone: 11104 pages used for memmap
[    0.000000]   DMA32 zone: 0 pages reserved
[    0.000000]   DMA32 zone: 710656 pages, LIFO batch:63
[    0.000000]   Normal zone: 20480 pages used for memmap
[    0.000000]   Normal zone: 1310720 pages, LIFO batch:63
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.0
[    0.000000] percpu: Embedded 33 pages/cpu s96984 r8192 d29992 u135168
[    0.000000] pcpu-alloc: s96984 r8192 d29992 u135168 alloc=33*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: detected: ARM erratum 845719
[    0.000000] CPU features: detected: GIC system register CPU interface
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 1989792
[    0.000000] Policy zone: Normal
[    0.000000] Kernel command line: root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/83501eb34d8cb5d4c5ef828446b4be41595362f16727c17127644296f3e39db6/0
[    0.000000] Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes, linear)
[    0.000000] Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] software IO TLB: mapped [mem 0x8e400000-0x92400000] (64MB)
[    0.000000] Memory: 6410240K/8085504K available (16380K kernel code, 1972K rwdata, 7628K rodata, 3968K init, 1173K bss, 266240K reserved, 1409024K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
[    0.000000]  Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GICv3: GIC: Using split EOI/Deactivate mode
[    0.000000] GICv3: 160 SPIs implemented
[    0.000000] GICv3: 0 Extended SPIs implemented
[    0.000000] GICv3: Distributor has no Range Selector support
[    0.000000] GICv3: 16 PPIs implemented
[    0.000000] GICv3: no VLPI support, no direct LPI support
[    0.000000] GICv3: CPU0: found redistributor 0 region 0:0x0000000038880000
[    0.000000] ITS: No ITS available, not enabling LPIs
[    0.000000] random: get_random_bytes called from start_kernel+0x318/0x4a0 with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 8.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 440795202120 ns
[    0.000003] sched_clock: 56 bits at 8MHz, resolution 125ns, wraps every 2199023255500ns
[    0.000467] Console: colour dummy device 80x25
[    0.000475] printk: console [tty0] enabled
[    0.000539] Calibrating delay loop (skipped), value calculated using timer frequency.. 16.00 BogoMIPS (lpj=80000)
[    0.000546] pid_max: default: 32768 minimum: 301
[    0.000618] LSM: Security Framework initializing
[    0.000681] Mount-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.000704] Mountpoint-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.001837] ASID allocator initialised with 32768 entries
[    0.001911] rcu: Hierarchical SRCU implementation.
[    0.005198] EFI services will not be available.
[    0.005544] smp: Bringing up secondary CPUs ...
[    0.005948] Detected VIPT I-cache on CPU1
[    0.005970] GICv3: CPU1: found redistributor 1 region 0:0x00000000388a0000
[    0.005998] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.006453] Detected VIPT I-cache on CPU2
[    0.006467] GICv3: CPU2: found redistributor 2 region 0:0x00000000388c0000
[    0.006482] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.006882] Detected VIPT I-cache on CPU3
[    0.006897] GICv3: CPU3: found redistributor 3 region 0:0x00000000388e0000
[    0.006911] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.006973] smp: Brought up 1 node, 4 CPUs
[    0.006976] SMP: Total of 4 processors activated.
[    0.006980] CPU features: detected: 32-bit EL0 Support
[    0.006984] CPU features: detected: CRC32 instructions
[    0.013279] CPU: All CPU(s) started at EL2
[    0.013296] alternatives: patching kernel code
[    0.015547] devtmpfs: initialized
[    0.025748] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.025761] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.062236] pinctrl core: initialized pinctrl subsystem
[    0.062875] NET: Registered protocol family 16
[    0.069697] DMA: preallocated 256 KiB pool for atomic allocations
[    0.069717] audit: initializing netlink subsys (disabled)
[    0.069908] audit: type=2000 audit(0.060:1): state=initialized audit_enabled=0 res=1
[    0.070501] cpuidle: using governor menu
[    0.071234] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.072570] Serial: AMBA PL011 UART driver
[    0.072619] imx mu driver is registered.
[    0.072641] imx rpmsg driver is registered.
[    0.077852] imx8mp-pinctrl 30330000.pinctrl: initialized IMX pinctrl driver
[    0.098913] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[    0.098919] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
[    0.098923] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.098927] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[    0.099778] cryptd: max_cpu_qlen set to 1000
[    0.103433] ACPI: Interpreter disabled.
[    0.105017] iommu: Default domain type: Translated
[    0.105150] vgaarb: loaded
[    0.105493] SCSI subsystem initialized
[    0.105640] libata version 3.00 loaded.
[    0.105836] usbcore: registered new interface driver usbfs
[    0.105867] usbcore: registered new interface driver hub
[    0.105895] usbcore: registered new device driver usb
[    0.107603] mc: Linux media interface: v0.10
[    0.107635] videodev: Linux video capture interface: v2.00
[    0.107712] pps_core: LinuxPPS API ver. 1 registered
[    0.107717] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.107729] PTP clock support registered
[    0.107890] EDAC MC: Ver: 3.0.0
[    0.108937] No BMan portals available!
[    0.109218] QMan: Allocated lookup table at (____ptrval____), entry count 65537
[    0.109657] No QMan portals available!
[    0.110318] No USDPAA memory, no 'fsl,usdpaa-mem' in device-tree
[    0.110663] FPGA manager framework
[    0.110744] Advanced Linux Sound Architecture Driver Initialized.
[    0.111323] Bluetooth: Core ver 2.22
[    0.111348] NET: Registered protocol family 31
[    0.111350] Bluetooth: HCI device and connection manager initialized
[    0.111357] Bluetooth: HCI socket layer initialized
[    0.111362] Bluetooth: L2CAP socket layer initialized
[    0.111372] Bluetooth: SCO socket layer initialized
[    0.112333] clocksource: Switched to clocksource arch_sys_counter
[    0.727622] VFS: Disk quotas dquot_6.6.0
[    0.727667] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.728082] pnp: PnP ACPI: disabled
[    0.733992] thermal_sys: Registered thermal governor 'step_wise'
[    0.733995] thermal_sys: Registered thermal governor 'power_allocator'
[    0.734383] NET: Registered protocol family 2
[    0.734589] IP idents hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.737109] tcp_listen_portaddr_hash hash table entries: 4096 (order: 4, 65536 bytes, linear)
[    0.737188] TCP established hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.737592] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes, linear)
[    0.738485] TCP: Hash tables configured (established 65536 bind 65536)
[    0.738601] UDP hash table entries: 4096 (order: 5, 131072 bytes, linear)
[    0.738742] UDP-Lite hash table entries: 4096 (order: 5, 131072 bytes, linear)
[    0.739018] NET: Registered protocol family 1
[    0.739379] RPC: Registered named UNIX socket transport module.
[    0.739382] RPC: Registered udp transport module.
[    0.739384] RPC: Registered tcp transport module.
[    0.739387] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.739394] PCI: CLS 0 bytes, default 64
[    0.739539] Trying to unpack rootfs image as initramfs...
[    1.215607] Freeing initrd memory: 8956K
[    1.216448] hw perfevents: enabled with armv8_pmuv3 PMU driver, 7 counters available
[    1.216847] kvm [1]: IPA Size Limit: 40 bits
[    1.218191] kvm [1]: GICv3: no GICV resource entry
[    1.218194] kvm [1]: disabling GICv2 emulation
[    1.218209] kvm [1]: GIC system register CPU interface enabled
[    1.218271] kvm [1]: vgic interrupt IRQ1
[    1.218367] kvm [1]: Hyp mode initialized successfully
[    1.221311] Initialise system trusted keyrings
[    1.221395] workingset: timestamp_bits=44 max_order=21 bucket_order=0
[    1.226164] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    1.226607] NFS: Registering the id_resolver key type
[    1.226629] Key type id_resolver registered
[    1.226632] Key type id_legacy registered
[    1.226640] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.226643] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[    1.226663] jffs2: version 2.2. (NAND) \xc2\xa9 2001-2006 Red Hat, Inc.
[    1.240632] NET: Registered protocol family 38
[    1.240641] Key type asymmetric registered
[    1.240645] Asymmetric key parser 'x509' registered
[    1.240674] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 246)
[    1.240798] io scheduler mq-deadline registered
[    1.240802] io scheduler kyber registered
[    1.242560] imx8-pcie-phy 32f00000.pcie-phy: failed to get imx pcie phy clock
[    1.245690] EINJ: ACPI disabled.
[    1.251714] i.MX8MP clock driver probe done
[    1.253552] mxs-dma 33000000.dma-apbh: initialized
[    1.254237] Bus freq driver module loaded
[    1.259632] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    1.261818] 30860000.serial: ttymxc0 at MMIO 0x30860000 (irq = 29, base_baud = 1500000) is a IMX
[    1.262251] 30880000.serial: ttymxc2 at MMIO 0x30880000 (irq = 30, base_baud = 1500000) is a IMX
[    1.262267] imx-uart 30880000.serial: Console IMX rounded baud rate from 114286 to 114300
[    1.277087] printk: console [ttymxc2] enabled
[    1.277540] 30890000.serial: ttymxc1 at MMIO 0x30890000 (irq = 31, base_baud = 1500000) is a IMX
[    1.280278] imx-drm display-subsystem: no available port
[    1.297960] brd: module loaded
[    1.303457] loop: module loaded
[    1.303820] zram: Added device: zram0
[    1.313536] Freescale FM module, FMD API version 21.1.0
[    1.313835] Freescale FM Ports module
[    1.314195] imx-dwmac 30bf0000.ethernet: IRQ eth_lpi not found
[    1.314268] imx-dwmac 30bf0000.ethernet: no reset control found
[    1.314943] VFIO - User Level meta-driver version: 0.3
[    1.319294] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.319319] ehci-pci: EHCI PCI platform driver
[    1.319892] usbcore: registered new interface driver usb-storage
[    1.319964] usbcore: registered new interface driver usbserial_generic
[    1.319983] usbserial: USB Serial support registered for generic
[    1.322532] input: 30370000.snvs:snvs-powerkey as /devices/platform/soc@0/30000000.bus/30370000.snvs/30370000.snvs:snvs-powerkey/input/input0
[    1.324377] snvs_rtc 30370000.snvs:snvs-rtc-lp: registered as rtc1
[    1.324489] i2c /dev entries driver
[    1.333242] imx2-wdt 30280000.watchdog: timeout 60 sec (nowayout=0)
[    1.333577] EDAC MC: ECC not enabled
[    1.334755] sdhci: Secure Digital Host Controller Interface driver
[    1.334757] sdhci: Copyright(c) Pierre Ossman
[    1.335031] Synopsys Designware Multimedia Card Interface Driver
[    1.335746] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.339023] ledtrig-cpu: registered to indicate activity on CPUs
[    1.340527] caam 30900000.crypto: device ID = 0x0a16040100000100 (Era 9)
[    1.340533] caam 30900000.crypto: job rings = 3, qi = 0
[    1.342838] caam_jr 30901000.jr: failed to flush job ring 0
[    1.348522] caam_jr: probe of 30901000.jr failed with error -5
[    1.359995] caam algorithms registered in /proc/crypto
[    1.360748] caam 30900000.crypto: caam pkc algorithms registered in /proc/crypto
[    1.360757] caam 30900000.crypto: registering rng-caam
[    1.360991] Device caam-keygen registered
[    1.361806] caam-snvs 30370000.caam-snvs: violation handlers armed - non-secure state
[    1.362258] hidraw: raw HID events driver (C) Jiri Kosina
[    1.362452] usbcore: registered new interface driver usbhid
[    1.362455] usbhid: USB HID core driver
[    1.362654] mxc-md 32c00000.bus:camera: deferring cap_device device registration
[    1.364147] mxc-isi 32e00000.isi: mxc_isi.0 registered successfully
[    1.365162] mxc-mipi-csi2-sam 32e40000.csi: 32e40000.csi supply mipi-phy not found, using dummy regulator
[    1.365467] mxc-mipi-csi2-sam 32e40000.csi: lanes: 4, hs_settle: 13, clk_settle: 2, wclk: 1, freq: 500000000
[    1.366585] No fsl,qman node
[    1.366590] Freescale USDPAA process driver
[    1.366592] fsl-usdpaa: no region found
[    1.366593] Freescale USDPAA process IRQ driver
[    1.371555] hantrodec 0 : module inserted. Major = 238
[    1.372019] hantrodec 1 : module inserted. Major = 238
[    1.373096] hantroenc: HW at base <0000000038320000> with ID <0x80006200>
[    1.373249] hx280enc: module inserted. Major <237>
[    1.374908] usbcore: registered new interface driver snd-usb-audio
[    1.386878] pktgen: Packet Generator for packet performance testing. Version: 2.75
[    1.387852] NET: Registered protocol family 26
[    1.388697] NET: Registered protocol family 10
[    1.389226] Segment Routing with IPv6
[    1.389303] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    1.389675] NET: Registered protocol family 17
[    1.389711] tsn generic netlink module v1 init...
[    1.389772] Key type dns_resolver registered
[    1.390185] registered taskstats version 1
[    1.390188] Loading compiled-in X.509 certificates
[    1.408533] GPIO line 61 (CTRL_SLEEP_MOCI#) hogged as output/high
[    1.412762] reg-fixed-voltage regulator-module-eth1phy: Failed to register regulator: -517
[    1.421939] +V3.3_SD: supplied by +V3.3_SW
[    1.422930] random: fast init done
[    1.423343] pca9450 0-0025: Device ID=0x31
[    1.423623] pca9450 0-0025: gpio_intr = 3
[    1.423632] pca9450 0-0025: chip_irq=67
[    1.441277] rtc-ds1307 0-0032: registered as rtc0
[    1.442217] at24 0-0050: 256 byte 24c02 EEPROM, writable, 16 bytes/write
[    1.442266] i2c i2c-0: IMX I2C adapter registered
[    1.443235] i2c i2c-1: IMX I2C adapter registered
[    1.447677] crng init done
[    2.393814] ddrc freq set to low bus mode
[    2.551472] ar0521 2-0042: Current Firmware Version - (1150CU96RKV1901110d381894XXXXXXX)
[    6.632127] streamdb[0]=0, mode=0
[    6.972861] AR0521 detected.
[    6.973620] i2c i2c-2: IMX I2C adapter registered
[    6.981382] at24 3-0050: 256 byte 24c02 EEPROM, writable, 16 bytes/write
[    6.982290] at24 3-0057: 256 byte 24c02 EEPROM, writable, 16 bytes/write
[    6.982762] i2c i2c-3: IMX I2C adapter registered

Although, it did not seem as if the camera would update its driver. Excerpt from the log:

[    2.551472] ar0521 2-0042: Current Firmware Version - (1150CU96RKV1901110d381894XXXXXXX)
[    6.632127] streamdb[0]=0, mode=0
[    6.972861] AR0521 detected.

When I tried (after at least 5 minutes) to reflash the device with Torizon OS 6 (yocto-built with AR0521 layer), the same old error log appeared like earlier.

Also, on TorizonCore 5, I tried to go one step further and run Weston container following documentation at First Steps with CSI Camera Set 5MP AR0521 Color (Torizon) | Toradex Developer Center.
However, it did not come up healthy. Docker log:

torizon@verdin-imx8mp-15207768:~$ docker run -e ACCEPT_FSL_EULA=1 --name=weston --net=host --cap-add CAP_SYS_TTY_CONFIG
-v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/              --device-cgroup-rule='c 4:* rmw' --device-cgroup-rule='c 13:* rmw'              --device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw'              torizon/weston-vivante:3.5 --developer weston-launch              --tty=/dev/tty7
Switching VT tty1 to text mode if currently in graphics mode
Switching to VT 7
SoC is: 'i.MX8MP'
SoC has GPU: false
SoC has DPU: false
g2d implementation: viv
Fallbacking to software renderer.
Removing previously created '.X*-lock' entries under /tmp before starting Weston. Pass 'IGNORE_X_LOCKS=1' environment variable to Weston container to disable this behavior.
dos2unix: converting file /etc/xdg/weston/weston.ini to Unix format...
dos2unix: converting file /etc/xdg/weston-dev/weston.ini to Unix format...
00:00:00.000 [INFO] [seatd/seat.c:39] Created VT-bound seat seat0
00:00:00.000 [INFO] [seatd/seatd.c:194] seatd started
Date: 2024-12-06 UTC
[11:15:41.976] weston 10.0.1
               https://wayland.freedesktop.org
               Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
               Build: lf-5.15.52-2.1.0-10-g9452feba
[11:15:41.976] Command line: weston -Bdrm-backend.so --current-mode -Swayland-0 --use-pixman weston-launch
[11:15:41.976] OS: Linux, 5.4.193-5.7.2+git.b60d3160fd04, #1-TorizonCore SMP PREEMPT Fri Dec 23 15:47:24 UTC 2022, aarch64
[11:15:41.976] Flight recorder: enabled
[11:15:41.977] Using config file '/etc/xdg/weston-dev/weston.ini'
[11:15:41.980] Output repaint window is 7 ms maximum.
[11:15:41.981] Loading module '/usr/lib/aarch64-linux-gnu/libweston-10/drm-backend.so'
[11:15:42.022] initializing drm backend
[11:15:42.022] Trying libseat launcher...
00:00:00.123 [INFO] [seatd/server.c:145] New client connected (pid: 27, uid: 1000, gid: 1000)
00:00:00.123 [INFO] [seatd/seat.c:170] Added client 7 to seat0
00:00:00.123 [INFO] [seatd/seat.c:480] Opened client 7 on seat0
[11:15:42.023] libseat: session control granted
[11:15:42.025] no drm device found
00:00:00.125 [INFO] [seatd/seat.c:418] No clients on seat0 to activate
00:00:00.126 [INFO] [seatd/seat.c:524] Closed client 7 on seat0
00:00:00.126 [INFO] [seatd/seat.c:192] Removed client 7 from seat0
[11:15:42.025] fatal: failed to create compositor backend
Internal warning: debug scope 'drm-backend' has not been destroyed.
00:00:00.127 [INFO] [seatd/client.c:471] Client disconnected
00:00:00.133 [INFO] [seatd/seatd.c:218] seatd stopped
Switching back to vt 1

Is there a specific “torizon/weston” version that was proved to work on this setup?
I also tried enabling device tree overlays for HDMI (“verdin-imx8mp_native-hdmi_overlay.dtbo”). Notably, the device tree overlays for DSI-HDMI are not pre-compiled on TorizonCore 5. Available device tree overlays at “/boot/ostree/torizon-83501eb34d8cb5d4c5ef828446b4be41595362f16727c17127644296f3e39db6/dtb/overlays”:

torizon@verdin-imx8mp-15207768:~$ ls -l /boot/ostree/torizon-83501eb34d8cb5d4c5ef828446b4be41595362f16727c17127644296f3e39db6/dtb/ov
erlays
total 76
-rw-r--r-- 1 root root  820 Jan  1  1970 display-dpi-lt170410_overlay.dtbo
-rw-r--r-- 1 root root  831 Jan  1  1970 display-edt5.7_overlay.dtbo
-rw-r--r-- 1 root root  831 Jan  1  1970 display-edt7_overlay.dtbo
-rw-r--r-- 1 root root  839 Jan  1  1970 display-fullhd_overlay.dtbo
-rw-r--r-- 1 root root  863 Jan  1  1970 display-lt161010_overlay.dtbo
-rw-r--r-- 1 root root  854 Jan  1  1970 display-lt170410_overlay.dtbo
-rw-r--r-- 1 root root  831 Jan  1  1970 display-vga_overlay.dtbo
-rw-r--r-- 1 root root  426 Jan  1  1970 touch-atmel-mxt_overlay.dtbo
-rw------- 1 root root 2877 Jan  1  1970 verdin-imx8mp_ar0521_overlay-1.dtbo
-rw-r--r-- 1 root root 1987 Jan  1  1970 verdin-imx8mp_lt8912_overlay.dtbo
-rw-r--r-- 1 root root 2101 Jan  1  1970 verdin-imx8mp_mezzanine-lvds-dual-channel_overlay.dtbo
-rw-r--r-- 1 root root 1552 Jan  1  1970 verdin-imx8mp_mezzanine-lvds-single-channel_overlay.dtbo
-rw-r--r-- 1 root root 2757 Jan  1  1970 verdin-imx8mp_mezzanine-ov5640-2_overlay.dtbo
-rw-r--r-- 1 root root 2943 Jan  1  1970 verdin-imx8mp_mezzanine-ov5640_overlay.dtbo
-rw-r--r-- 1 root root  416 Jan  1  1970 verdin-imx8mp_mezzanine-touch-atmel-mxt_overlay.dtbo
-rw-r--r-- 1 root root 1860 Jan  1  1970 verdin-imx8mp_native-hdmi_overlay.dtbo
-rw-r--r-- 1 root root 2983 Jan  1  1970 verdin-imx8mp_ov5640_overlay.dtbo
-rw-r--r-- 1 root root 1206 Jan  1  1970 verdin-imx8mp_sn65dsi84-lt170410_overlay.dtbo
-rw-r--r-- 1 root root 1866 Jan  1  1970 verdin-imx8mp_sn65dsi84_overlay.dtbo

From the results, I would assume that the camera works with the provided driver under TorizonCore 5. If with the current driver, it is not possible to upgrade to Torizon OS 6 or 7, I would appreciate support for making video capture possible with TorizonCore 5.
Thanks for your support!

Best regards,
Aljoscha Rydzyk

Hi @ajsnp!

Yes, Torizon OS was called TorizonCore in older versions.

Regarding the weston container, I noticed that you used torizon/weston-vivante:3.5, but in our article, it uses torizon/weston-vivante:$CT_TAG_WESTON_VIVANTE, and, if I’m not mistaken, for TorizonCore 5, the variable CT_TAG_WESTON_VIVANTE should be 2.

Could you try to run the container again, please? But using $CT_TAG_WESTON_VIVANTE instead of the version itself.

Best regards.
Lucas Azeituno

Hello @lucas_az.tx,

sorry I did not mention that I already the exact command like in the article.
With this command I get similar output.

However, I tried to re-enable the device tree overlays “verdin-imx8mp_lt8912_overlay.dtbo” and “verdin-imx8mp_native-hdmi_overlay.dtbo” which were enabled by default when launching TorizonCore 5 but got disabled when I added the device tree overlay “verdin-imx8mp_ar0521_overlay-1.dtbo”.

With this, I was able to start the weston container and also start a wayland-container, successfully capturing video data and display through HDMI on screen!
That is great so far. So on TorizonCore 5, it seems I can get the camera to work.

For Torizon OS 6, the problem still exists. Presumably, the tested driver at GitHub - toradex/meta-toradex-econ does not work with Torizon OS 6. Are there any efforts taken to make this setup compatible with Torizon OS 6 or even Torizon OS 7?

Thank you for your support so far!

Best regards,
Aljoscha Rydzyk

Hi @ajsnp!

I’ve tested it on Torizon 6, and it worked. Basically, I followed this article, but I had to do some changes that I’ll explain below.

I had to build the image using Yocto as explained here. Then I installed the image on the Verdin iMX8MP.

It is important to say that you should disable the verdin-imx8mp_dsi-to-hdmi_overlay.dtbo overlay to use the native HDMI, which means delete it from overlays.txt and leave the other overlays.

With the image installed, I followed the below steps:

First, I built the gstreamer container using the following Dockerfile and command.

  • Dockerfile:
ARG BASE_NAME=wayland-base-vivante
ARG IMAGE_ARCH=linux/arm64/v8
ARG IMAGE_TAG=3
ARG DOCKER_REGISTRY=torizon

FROM --platform=$IMAGE_ARCH $DOCKER_REGISTRY/$BASE_NAME:$IMAGE_TAG

RUN apt-get -y update && apt-get install -y --no-install-recommends \
        libgstreamer1.0-0 \
        gstreamer1.0-plugins-base \
        gstreamer1.0-plugins-good \
        gstreamer1.0-plugins-bad \
        gstreamer1.0-plugins-ugly \
        gstreamer1.0-libav \
        gstreamer1.0-tools \
        gstreamer1.0-x \
        gstreamer1.0-alsa \
        gstreamer1.0-gl \
        gstreamer1.0-gtk3 \
        gstreamer1.0-pulseaudio \
        v4l-utils \
        && if [ "${IMAGE_ARCH}" = "linux/arm64/v8" ]; then \
                apt-get install -y --no-install-recommends \
                gstreamer1.0-qt5; fi \
        && apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/*

ENTRYPOINT ["gst-launch-1.0"]

CMD ["videotestsrc", "!", "videoconvert", "!", "videoscale", "!", "waylandsink", "sync=false"]
  • Command:
docker build . -t gstreamer:test

After that, I ran the Weston container:

docker run -e ACCEPT_FSL_EULA=1 -d --rm --name=weston --net=host --cap-add CAP_SYS_TTY_CONFIG \
             -v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ \
             --device-cgroup-rule='c 4:* rmw' --device-cgroup-rule='c 13:* rmw' \
             --device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw' \
             torizon/weston-vivante:$CT_TAG_WESTON_VIVANTE --developer --tty=/dev/tty7

Then, I ran the gstreamer container:

docker run --rm -it -v /tmp:/tmp -v /var/run/dbus:/var/run/dbus -v /dev:/dev -v /sys:/sys \
    --device /dev/video0 --device /dev/video1 --device /dev/video2 \ 
    --device-cgroup-rule='c 226:* rmw' --device-cgroup-rule='c 199:* rmw' \
    --entrypoint=bash gstreamer:test

After these steps, you should be inside the container, and then you can run the pipeline with:

gst-launch-1.0 v4l2src device=/dev/video2 ! video/x-raw,width=1920,height=1080,framerate=65/1 ! fpsdisplaysink text-overlay=false video-sink=waylandsink sync=false -v

At this point, you should see the video captured by the camera on your display/monitor.

Feel free to ask if you have any doubts or issues.

Best regards.
Lucas Azeituno.

Hey @lucas_az.tx,

unfortunately, Torizon OS 6 still does not work (original post), even with removing the verdin-imx8mp_dsi-to-hdmi_overlay.dtbo overlay. The camera driver still throws the mentioned errors in dmesg.
On initial start, my overlays.txt looks like this:
fdt_overlays=verdin-imx8mp_hdmi_overlay.dtbo verdin-imx8mp_dsi-to-hdmi_overlay.dtbo verdin-imx8mp_spidev_overlay.dtbo verdin-imx8mp_ar0521_overlay.dtbo
Removing dsi-to-hdmi overlay does not change the result in dmesg (I surely rebooted after each device tree overlay change).

Nevertheless, I can build and start weston and wayland containers but (because the camera driver is not working I suppose), I get gstreamer error:

root@a7e9cd08bd02:/# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1920,height=1080,framerate=65/1 ! fpsdisplaysink t
ext-overlay=false video-sink=waylandsink sync=false -v
Setting pipeline to PAUSED ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not open device '/dev/video0' for reading and writing.
Additional debug info:
../sys/v4l2/v4l2_calls.c(622): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
system error: Device or resource busy
ERROR: pipeline doesn't want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
Freeing pipeline ...

Tried this for video0 and video1 device, there is no video2 device.

Maybe something is wrong with my yocto-built Torizon OS 6 image? I followed the article you posted and use docker. Basically, this command
docker run --rm -it --name=crops -v $PWD:/workdir --workdir=/workdir -e MACHINE=verdin-imx8mp -e IMAGE=torizon-core-docker torizon/crops:kirkstone-6.x.y startup-tdx.sh
only that I execute the scripts commands one by one to be able to introduce the bitbake layer.

I will share my build artifact with you by sending an email to toradex support.
Thank you!

Best regards,
Aljoscha Rydzyk

Hi @ajsnp!

I’ve tried your image, and it didn’t work. I’ll ask you to try again following this article.

First, create a folder and do all the steps within this folder, for example:

mkdir ~/yocto-torizon6
cd ~/yocto-torizon6

Second, prepare the environment for a Torizon 6 (I used 6.8.0) build as you would do it natively. For example, after you’ve configured your git, do the following:

repo init -u git://git.toradex.com/toradex-manifest.git -b refs/tags/6.8.0 -m torizoncore/default.xml

Then you can use repo sync.

After these steps, follow this article to add the meta-toradex-econ layer to your project.

Once you’ve added the econ layer to your project, run the following container:

docker run --rm -it -v /home/<user>/yocto-torizon6/:/workdir crops/poky:ubuntu-22.04 --workdir=/workdir

Now you should be inside the container. You can run:

MACHINE=verdin-imx8mp source setup setup-environment

And you’ll be ready to build the image and deploy it to the Verdin.

After you’ve deployed the Torizon 6, follow the previous steps to run the Weston container and the GStreamer container and pipeline.

I did this, and it worked for me. Please feel free to ask if you have any doubts or issues.

Best regards.
Lucas Azeituno.

Hey @lucas_az.tx,

with these steps, I was able to build an image with working camera driver!
Notably, I ran the “setup-environment” script before adding the bitbake layers because before there would be not bitbake utility.

This is great, thank you for your support.

I am currently figuring out what made the difference to my initial approach. As far as I can see, it is only using the tag 6.8.0 instead of branch kirkstone-6.x.y and/or using the crops/poky:ubuntu-22.04 image instead of torizon/crops:kirkstone-6.x.y. I am figuring that out.

Best regards,
Aljoscha Rydzyk

Hi @ajsnp!

I’m not sure what was wrong with your build, but I’m glad to know that it worked.

I’ll mark my answer as a solution and consider this topic closed, okay? If you face any other issues, please feel free to open another topic in our community.

Best regards.
Lucas Azeituno.