-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Compute Module IO Board camera configuration doc for Bookworm #3188
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of in-depth feedback, but that's because this is very deep technical info!
=== Updating your System | ||
|
||
The camera software is under constant development. Please ensure your system is up to date prior to using these instructions. | ||
Before configuring a camera, ensure your system runs the latest available software: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'runs' -> 'is running' ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You missed out this change?
. (CM4 only) Add jumpers to J6. | ||
. Power up and run `+sudo wget https://datasheets.raspberrypi.com/cmio/dt-blob-dualcam.bin -O /boot/firmware/dt-blob.bin+` | ||
. Reboot for the dt-blob.bin file to be read. | ||
. _(CM1, CM3, CM3+, and CM4S only)_: Add the following directive to `/boot/firmware/config.txt` to accommodate the swapped GPIO pin assignment on the I/O board: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be neater to combine this section with the next, rather than have the repeated _(CM1, CM3, CM3+, and CM4S only)_: Add the following directive to /boot/firmware/config.txt ...
?
* `2` to `CAM1_101` | ||
* `3` to `CAM1_100` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these are IO1
and IO0
rather then 101
and 100
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
|
||
By default, the GPIOs used for the camera on the Compute Module are set to input mode. To xref:configuration.adoc#changing-the-default-pin-configuration[override these default settings], create a custom xref:configuration.adoc#device-trees-overlays-and-parameters[Linux Device Tree]. To define a custom Device Tree, create a custom a Device Tree Source (`dts`) file. To load your custom Device Tree, xref:configuration.adoc#changing-the-default-pin-configuration[compile your Device Tree Source file into a `dt-blob.bin` file]and place it in the boot partition. Raspberry Pi OS will load this Device Tree into firmware when the system boots. | ||
|
||
The following Device Tree Source files enable single and dual cameras for CM1, CM3, and CM4: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these example Device Tree Source files?
(and another minor nitpick, but I think this is the first place where you don't explicitly mention CM3+ or CM4S 😉 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The omission is intentional -- these Device Tree Source files don't include CM3+ or CM4S because they predate those Compute Modules. Sadly I don't have the bandwidth (or the material access) to build those entire source trees in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CM3+ is identical to CM3 from the firmware's perspective.
These files were in the documentation repo until the major reorg.
It looks like I have updates for CM4S (and 02W) in my copy of the files. Not sure why they haven't been published.
|
||
The `pin_config` section in the `pins_cm { }` (Compute Module 1), `pins_cm3 { }` (Compute Module 3), or `pins_cm4 { }` (Compute Module 4) section of the source dts needs the camera's LED and power enable pins set to outputs: | ||
To use the HQ camera, pass its index (`0`) to the `--camera` option of any `libcamera` subcommand: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why demonstrate using camera index 1 before demonstrating camera index 0?
@@ -123,16 +336,23 @@ pin_define@CAMERA_0_SDA_PIN { type = "internal"; number = <0>; }; | |||
pin_define@CAMERA_0_SCL_PIN { type = "internal"; number = <1>; }; | |||
---- | |||
|
|||
Indentation and line breaks are not critical, so the example files expand these blocks out for readability. | |||
To add a second camera, set the *NUM_CAMERAS* parameter the `pin_defines` subsection of your device's pin configuration to `2`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'parameter the' -> 'parameter in the' ?
|
||
==== Configure camera pins with Device Tree | ||
|
||
By default, the GPIOs used for the camera on the Compute Module are set to input mode. To xref:configuration.adoc#changing-the-default-pin-configuration[override these default settings], create a custom xref:configuration.adoc#device-trees-overlays-and-parameters[Linux Device Tree]. To define a custom Device Tree, create a custom a Device Tree Source (`dts`) file. To load your custom Device Tree, xref:configuration.adoc#changing-the-default-pin-configuration[compile your Device Tree Source file into a `dt-blob.bin` file]and place it in the boot partition. Raspberry Pi OS will load this Device Tree into firmware when the system boots. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And a minor stylistic point, but this paragraph seems to have multiple consecutive "To do X, do Y." sentences.
* `pins_3bplus`: Raspberry Pi 3 Model B+ | ||
* `pins_3aplus`: Raspberry Pi 3 Model A+ | ||
* `pins_pi0`: Raspberry Pi Zero | ||
* `pins_pi0w`: Raspberry Pi Zero W |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does Raspberry Pi Zero 2 W need to be added too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but I couldn't track down that value. Technically this will need to be updated for the 5 soon anyway, that'll be a good reminder to add this as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all legacy firmware configuration. It does not apply to Pi5.
Other than configuring the legacy camera and DSI display on CMs, dt-blobs should not be needed or used. The main downside it that they totally replace the one built into the firmware, therefore it breaks if there is ever a change of syntax required.
The master copy is https://github.com/raspberrypi/firmware/blob/master/extra/dt-blob.dts
Pi02W is pins_pi02w
@aallan Updated to address Andrew's feedback. Ready to merge when you are. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is slightly hard to read in asciidoc format, but we appear to have a serious mismash of legacy and libcamera stuff here. The two are independent and should not be mixed.
|
||
If a custom board doesn't work with these overlays, create a new Device Tree that describes the entire board. | ||
|
||
==== Configure camera pins with Device Tree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're switching to configuring the legacy camera stack with this section, but nothing has said as much.
dt-blobs are irrelevant for libcamera, and whilst the dt-blob (ab)uses Device Tree syntax, this is not Device Tree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There shouldn't be anything about the legacy camera stack present in the documentation any more at all. All of that needs to just go. It should have been pulled out as part of the Bookworm milestone but it obviously got missed. 😐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll open a PR to remove this section. Unfortunately I wasn't able to test these instructions -- I just cleaned up the section that already existed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should have been pulled out as part of the Bookworm milestone but it obviously got missed.
Ahh, I wasn't aware that the dt-blob stuff was "legacy" and not applicable to libcamera.
@6by9 As we're not including legacy camera stuff in the documentation, does that mean that all of the Device Tree / DTS / dt-blob stuff mentioned in this PR ought to be ripped out (even the "custom boards" part) ? Or are they any parts that are still relevant in the "libcamera world"?
|
||
By default, the GPIOs used for the camera on the Compute Module are set to input mode. To xref:configuration.adoc#changing-the-default-pin-configuration[override these default settings], create a custom xref:configuration.adoc#device-trees-overlays-and-parameters[Linux Device Tree]. To define a custom Device Tree, create a custom a Device Tree Source (`dts`) file. To load your custom Device Tree, xref:configuration.adoc#changing-the-default-pin-configuration[compile your Device Tree Source file into a `dt-blob.bin` file]and place it in the boot partition. Raspberry Pi OS will load this Device Tree into firmware when the system boots. | ||
|
||
The following Device Tree Source files enable single and dual cameras for CM1, CM3, and CM4: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CM3+ is identical to CM3 from the firmware's perspective.
These files were in the documentation repo until the major reorg.
It looks like I have updates for CM4S (and 02W) in my copy of the files. Not sure why they haven't been published.
* `pins_3bplus`: Raspberry Pi 3 Model B+ | ||
* `pins_3aplus`: Raspberry Pi 3 Model A+ | ||
* `pins_pi0`: Raspberry Pi Zero | ||
* `pins_pi0w`: Raspberry Pi Zero W |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all legacy firmware configuration. It does not apply to Pi5.
Other than configuring the legacy camera and DSI display on CMs, dt-blobs should not be needed or used. The main downside it that they totally replace the one built into the firmware, therefore it breaks if there is ever a change of syntax required.
The master copy is https://github.com/raspberrypi/firmware/blob/master/extra/dt-blob.dts
Pi02W is pins_pi02w
|
||
==== Configure camera pins with Device Tree | ||
|
||
By default, the GPIOs used for the camera on the Compute Module are set to input mode. To xref:configuration.adoc#changing-the-default-pin-configuration[override these default settings], create a custom xref:configuration.adoc#device-trees-overlays-and-parameters[Linux Device Tree]. To define a custom Device Tree, create a custom a Device Tree Source (`dts`) file. To load your custom Device Tree, xref:configuration.adoc#changing-the-default-pin-configuration[compile your Device Tree Source file into a `dt-blob.bin` file]and place it in the boot partition. Raspberry Pi OS will load this Device Tree into firmware when the system boots. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is NOT Linux device tree.
They're hosted on datasheets.raspberrypi.com, or at least I think these are the files you're talking about @6by9 ?
I can push them to the datasheets site along with the rest, drop me an email? |
Okay, this looks like it needs another pass picking up the raised issues. Raised an issue #3192. |
Opened a follow-up PR to address comments: #3193 |
TODO: Add an image of the J6 jumper cable setup required on the CM4 I/O board. We have an Asana task brewing for that, should be done Oct 18. Will likely update the main section modified here with that image in a follow-up PR after merge once the photo is available.