I’m working on getting the IMX296 Global Shutter Camera working on Raspberry Pi 5. I think there’s a few things I’ll need to do. Documenting here.
The plan: 1) update config.txt to NOT autodetect cameras and provide a custom overlay. 2) update fwup.conf to point to the new, modified config.txt.
Nerves seems to support editing the boot partition, where config.txt lives: Advanced Configuration — nerves v1.11.3
I’ve now:
- Copied the base config.txt to my config/ folder
cp deps/nerves_system_rpi5/config.txt config/
- Copied the fwup.conf to my config/ folder as well
cp deps/nerves_system_rpi5/fwup.conf config/
- Updated Config.exs to point to the new fwup.conf
# To use our own fwup.conf, which will pull in our modified /boot/firmware/config.txt
# instead of the default config.txt to support the global shutter camera
config :nerves, :firmware,
rootfs_overlay: "rootfs_overlay",
fwup_conf: "config/fwup.conf"
- In config/config.txt found and disabled camera_auto_detect and added dtoverlay=imx296
This Raspberry Pi camera documentation is where I learned that to use the GS camera IMX 296, I can’t have camera auto detection on and also need to add this new overlay.
# Automatically load overlays for detected cameras
# This is disabled for this project which uses an IMX296 Global Shutter Camera
camera_auto_detect=0
# It will default to checking camera connector 1.
dtoverlay=imx296
- In my config/fwup.conf, I found (line 12 or 13) and modified where it expects to find config.txt to point to my new config/config.txt:
It now reads:
file-resource config.txt { host-path = "${NERVES_APP}/config/config.txt" }
- I ensured I have the camera ribbon cables in correctly. The plastic stiffener faces the CPU on the Raspberry PI 5, a reversal from previous boards. I put the cable into the one marked “cam1” because “If your Raspberry Pi has two camera connectors (Raspberry Pi 5 or one of the Compute Modules, for example), then you can specify the use of camera connector 0 by adding
,cam0 to the dtoverlay that you used from the table above. If you do not add this, it will default to checking camera connector 1.” (Raspberry Pi Docs).
Unfortunately, when I ssh nerves.local to start an iex session on the device, it doesn’t seem to have helped:
cmd("libcamera-still --list")
No cameras available!
or
cmd("libcamera-still -n -v -o /data/test.jpeg")
...elided...
ERROR: *** no cameras available ***
I’ll post a followup if I succeed, but if anyone has any ideas they want to see me try, I’m all ears.