bduke
Posts: 10
Joined: Wed Nov 22, 2017 7:21 pm

Configuring i2c device before camera detection

Fri Dec 08, 2017 4:05 am

Hello,

I am working on a CM3 project using the IMX9 camera sensor. The sensor is connected to the CM3 i2c0 via something similar to an i2c extender. I can boot the system, set up the registers on the extender from userspace and see the camera on the i2c0 bus at 0x10.

The software driver, however, does not detect the camera. I know from viewtopic.php?f=98&t=174347, that detection apparently occurs once at boot. So, how can I write to some i2c registers before the camera detection occurs so that the camera is visible when the driver loads?

Has anyone had a similar problem or can anyone suggest an approach?

  • My current thought is to setup U-Boot and try to drive the i2c from there, but I'm not sure if U-Boot has access to a compatible i2c driver (or maybe just bitbang as GPIOs?). I have mainline U-Boot booting on the board and loading the kernel but I'm just starting to dive into the i2c part.
  • Is there any way to force the camera driver to "re-detect" any connected cameras?
  • Any suggestions on when the camera detection occurs that would give me a chance to run some code in the kernel (to write to an i2c address) beforehand?

Thank you for your help.

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

Re: Configuring i2c device before camera detection

Fri Dec 08, 2017 7:10 am

Camera detection happens on first need of the camera information, ie either calling raspivid/still etc, or vcgencmd get_camera.
As long as you set up your extender before either of those occur then all should be fine.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

bduke
Posts: 10
Joined: Wed Nov 22, 2017 7:21 pm

Re: Configuring i2c device before camera detection

Sat Dec 09, 2017 3:15 am

6by9 wrote: Camera detection happens on first need of the camera information, ie either calling raspivid/still etc, or vcgencmd get_camera.
Thank you for the explanation. That clarification saved me some time. I was able to get the driver to report "detected=1," so it can at least see the camera via i2c.

Return to “Camera board”

Who is online

Users browsing this forum: No registered users and 5 guests