iocapa
Posts: 12
Joined: Fri Jan 22, 2021 12:53 pm

Repurposing "Camera_GPIO" pin

Tue May 11, 2021 3:53 pm

Hello. I'm using the CM4 in an application that requires setting the GPIO_VREF to 1.8V.
However, I need one extra 3.3V referenced GPIO (other than 44/45), without adding any extra voltage dividers.
For this i was looking at 97 (Camera_GPIO), since I do not use the camera, and use it as an input to signal some interrupt coming from an external device.

However, I couldn't find any documentation on how to reassign this pin, or even if it's possible.

The datasheet says:
"Reassigning this pin to another function isn’t recommended."

This sounds like not recommended, but possible ;)

Any thoughts on that?

Regards

dp11
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 520
Joined: Thu Dec 29, 2011 5:46 pm

Re: Repurposing "Camera_GPIO" pin

Wed May 12, 2021 8:18 am

You will need to read and understand the device tree structure which describes the CAM_GPIO pin.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11216
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Repurposing "Camera_GPIO" pin

Wed May 12, 2021 10:05 am

You can do it, but do NOT configure a dt-blob.bin such that the firmware knows about the camera, otherwise the firmware will start changing the state on you.

It is via an I2C GPIO expander controlled by the firmware, so goes via raspberrypi-exp-gpio driver.
As defined in DT for the camera regulator, it's GPIO 5 on that expander.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

iocapa
Posts: 12
Joined: Fri Jan 22, 2021 12:53 pm

Re: Repurposing "Camera_GPIO" pin

Wed May 12, 2021 1:51 pm

Ok. Thanks everyone.
I was not aware that it's via an expander.

Guess I'll go with a simple voltage divider and route it to a standard 1V8 GPIO.

I don't want to risk the extra overhead since the details of the subsystem using
that line are not yet fully defined (will signal an interrupt after which a custom driver will read/write something through I2C GPIO44/45).

Regards

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11216
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Repurposing "Camera_GPIO" pin

Wed May 12, 2021 2:12 pm

FWIW raspberrypi-exp-gpio doesn't support interrupts.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Compute Module”