Need help getting Arducam OV7251 camera working on Raspberry Pi 4B

Hey, I can’t get my Arducam OV7251 working on a Raspberry Pi 4B at all. It just never comes up and the demo tool fails right away. I’ve attached a screenshot of what I’m seeing. Any idea what’s going on?

Screen Shot 2022-05-27 at 3.24.21 PM.png

Thanks for the report and the screenshot. We can see the error you’re hitting, but to pin down the exact cause we need more info about your setup. Could you please provide the following?

System related information:

uname -a
cat /etc/os-release
cat /proc/meminfo
cat /boot/config.txt

System log:

dmesg

With the output from those we should be able to tell whether this is a driver/overlay issue or something with the I2C/GPIO setup.

For reference, here’s the failure screenshot again:
Screen Shot 2022-05-27 at 3.24.21 PM.png

OK, here’s everything I could gather. I ran it two ways — once with the dtoverlay set in the boot config and once with it commented out — and both fail.

System info:

Linux raspberrypiz 5.10.103-v7l+ #1529 SMP Tue Mar 8 12:24:00 GMT 2022 armv7l GNU/Linux

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
VERSION_ID="10"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian

MemTotal:        3878088 kB

From dmesg, the machine model:

OF: fdt: Machine model: Raspberry Pi 4 Model B Rev 1.5

Firmware:

raspberrypi-firmware soc:firmware: Attached to firmware from 2021-12-01T15:02:46, variant start_x
Firmware hash 71bd3109023a0c8575585ba87cbb374d2eeb038f

Relevant bits of /boot/config.txt:

dtparam=audio=on

[pi4]
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d
dtoverlay=ov7251
start_x=1
gpu_mem=128
dtparam=i2c_vc=on

Run 1 — dtoverlay ON. Key dmesg lines:

[    4.478990] i2c i2c-22: Added multiplexed i2c bus 0
[    4.480487] i2c i2c-22: Added multiplexed i2c bus 10
[    5.722769] ov7251 10-0060: cannot get enable gpio
[    5.723781] ov7251: probe of 10-0060 failed with error -2
[   31.836028] ov7251_dvdd: disabling
[   31.836049] ov7251_dovdd: disabling
[   31.836074] ov7251_avdd: disabling
CmaTotal:         327680 kB
CmaFree:          317280 kB
Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1  smsc95xx.macaddr=E4:5F:01:A3:AC:48 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  console=ttyS0,115200 console=tty1 root=PARTUUID=68e1c353-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles

Run 2 — dtoverlay OFF (commented out). No ov7251 probe / enable gpio errors like above, but I do get this over and over:

[    9.475969] broken atomic modeset userspace detected, disabling atomic
CmaTotal:         327680 kB
CmaFree:          315608 kB

And in both runs, running the demo tool the same way:

cd MIPI_Camera/
cd RPI/
./list_format
init camera status = 4099

So ./list_format returns init camera status = 4099 whether the overlay is set or not. What should I try next?

Great, this is really helpful. Let’s break down what your logs are telling us.

First, the two I2C lines are actually expected:

i2c i2c-22: Added multiplexed i2c bus 0
i2c i2c-22: Added multiplexed i2c bus 10

That’s just the multiplexer setting up, so the camera is at least being routed onto bus 10 (which matches the 10-0060 address in the errors).

The important one is this:

ov7251 10-0060: cannot get enable gpio
ov7251: probe of 10-0060 failed with error -2

error -2 is ENOENT — the driver couldn’t find the GPIO it’s told to use for the sensor enable line, so the probe bails out and the sensor never initializes. That also explains why you then see the regulators getting torn down:

ov7251_dvdd: disabling
ov7251_dovdd: disabling
ov7251_avdd: disabling

Those are just the consequence of the failed probe, not a separate problem.

With the overlay OFF, the sensor never probes at all, so there’s no ov7251 line in dmesg — that’s expected. The broken atomic modeset userspace detected line is unrelated to the camera, it’s just the FKMS display stack.

Your init camera status = 4099 in both runs is consistent with the sensor never coming up.

A couple of things worth checking:

  1. The overlay must match your exact kernel/firmware. You’re on 5.10.103 and firmware from 2021-12-01, so make sure the ov7251 overlay you’re loading is built for that kernel branch.
  2. Confirm the overlay is actually being applied — after a reboot with dtoverlay=ov7251 enabled, check:
dtoverlay -l

and we should see ov7251 listed. If it isn’t there, the overlay isn’t being parsed/applied.
3. Double-check the camera is fully seated on the connector and that i2c_vc is enabled, since the enable GPIO mapping comes from the overlay.

Can you run dtoverlay -l with the overlay enabled and share the output, plus a fresh full dmesg from that boot? That will tell us whether it’s an overlay-loading problem or a GPIO numbering mismatch. This one isn’t solved yet, but the enable GPIO error is the thing we need to chase down next.