Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5471

Interfacing (DSI, CSI, I2C, etc.) • Re: Use MIPI image sensor with RPI CM4

$
0
0
While talking with melexis tech support, he told me this
Definitely you should ensure the proper GPIO control to have a power-up sequence and DC/DC working, as well the RESET pin should be deasserted, otherwise the sensor will not ACK on I2C.
Is there a power up sequence for the CAM1 pins on the CM4? If I remember correctly the main camera pins are CAM1 and the secondary are the CAM0 ones.
It's down to your driver.

For almost all drivers in our tree, they link to cam1_reg or cam0_reg via device tree. On CM4 these happen to be the same regulator node, and will control the GPIO on the camera connectors. Sensors can then use that to power up their regulators and clocks (ordering is down to the integrator), and control any reset GPIO.
You can add additional GPIOs if you wish, and again it is up to the driver to control them (eg ov5647 has both regulator and GPIO controls available).
i2cdetect -l output this:

Code:

alessandro@unlook:~ $ i2cdetect -li2c-0   i2c             i2c-22-mux (chan_id 0)                  I2C adapteri2c-1   i2c             bcm2835 (i2c@7e804000)                  I2C adapteri2c-10  i2c             i2c-22-mux (chan_id 1)                  I2C adapteri2c-20  i2c             fef04500.i2c                            I2C adapteri2c-21  i2c             fef09500.i2c                            I2C adapteri2c-22  i2c             bcm2835 (i2c@7e205000)                  I2C adapter
Then if i run i2cdetect -f and the bus number (-f is for all the function the i2c bus has)

Code:

alessandro@unlook:~ $ i2cdetect -F 0Functionalities implemented by /dev/i2c-0:I2C                              yesSMBus Quick Command              yesSMBus Send Byte                  yesSMBus Receive Byte               yesSMBus Write Byte                 yesSMBus Read Byte                  yesSMBus Write Word                 yesSMBus Read Word                  yesSMBus Process Call               yesSMBus Block Write                yesSMBus Block Read                 noSMBus Block Process Call         noSMBus PEC                        yesI2C Block Write                  yesI2C Block Read                   yesalessandro@unlook:~ $ i2cdetect -F 1Functionalities implemented by /dev/i2c-1:I2C                              yesSMBus Quick Command              yesSMBus Send Byte                  yesSMBus Receive Byte               yesSMBus Write Byte                 yesSMBus Read Byte                  yesSMBus Write Word                 yesSMBus Read Word                  yesSMBus Process Call               yesSMBus Block Write                yesSMBus Block Read                 noSMBus Block Process Call         noSMBus PEC                        yesI2C Block Write                  yesI2C Block Read                   yesalessandro@unlook:~ $ i2cdetect -F 10Functionalities implemented by /dev/i2c-10:I2C                              yesSMBus Quick Command              yesSMBus Send Byte                  yesSMBus Receive Byte               yesSMBus Write Byte                 yesSMBus Read Byte                  yesSMBus Write Word                 yesSMBus Read Word                  yesSMBus Process Call               yesSMBus Block Write                yesSMBus Block Read                 noSMBus Block Process Call         noSMBus PEC                        yesI2C Block Write                  yesI2C Block Read                   yesalessandro@unlook:~ $ i2cdetect -F 20Functionalities implemented by /dev/i2c-20:I2C                              yesSMBus Quick Command              yesSMBus Send Byte                  yesSMBus Receive Byte               yesSMBus Write Byte                 yesSMBus Read Byte                  yesSMBus Write Word                 yesSMBus Read Word                  yesSMBus Process Call               yesSMBus Block Write                yesSMBus Block Read                 noSMBus Block Process Call         noSMBus PEC                        yesI2C Block Write                  yesI2C Block Read                   yesalessandro@unlook:~ $ i2cdetect -F 21Functionalities implemented by /dev/i2c-21:I2C                              yesSMBus Quick Command              yesSMBus Send Byte                  yesSMBus Receive Byte               yesSMBus Write Byte                 yesSMBus Read Byte                  yesSMBus Write Word                 yesSMBus Read Word                  yesSMBus Process Call               yesSMBus Block Write                yesSMBus Block Read                 noSMBus Block Process Call         noSMBus PEC                        yesI2C Block Write                  yesI2C Block Read                   yesalessandro@unlook:~ $ i2cdetect -F 22Functionalities implemented by /dev/i2c-22:I2C                              yesSMBus Quick Command              yesSMBus Send Byte                  yesSMBus Receive Byte               yesSMBus Write Byte                 yesSMBus Read Byte                  yesSMBus Write Word                 yesSMBus Read Word                  yesSMBus Process Call               yesSMBus Block Write                yesSMBus Block Read                 noSMBus Block Process Call         noSMBus PEC                        yesI2C Block Write                  yesI2C Block Read                   yesalessandro@unlook:~ $
But than if I run i2cdetect -y number of bus I get results only on bus 20 and 21

Code:

alessandro@unlook:~ $ i2cdetect -y 20     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f00:                         08 09 0a 0b 0c 0d 0e 0f10: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f30: -- -- -- -- -- -- -- -- 38 39 3a 3b 3c 3d 3e 3f40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --60: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f70: 70 71 72 73 74 75 76 77alessandro@unlook:~ $ i2cdetect -y 21     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f00:                         08 09 0a 0b 0c 0d 0e 0f10: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f30: -- -- -- -- -- -- -- -- 38 39 3a 3b 3c 3d 3e 3f40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --60: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f70: 70 71 72 73 74 75 76 77
If I try to send any command to all the busses ex.

Code:

 i2cget -y -f -a 22 0x09
I get
Error: Read failed
i2c-20 & i2c-21 are the DDC channel to the 2 HDMI monitors. The driver has a quirk that it doesn't like SMBus quick writes, and i2cdetect uses different type of comand for different addresses to try and avoid causing issues (see https://git.kernel.org/pub/scm/utils/i2 ... tect.c#n68 or "man i2cdetect").
Use "i2cdetect -r " if you want to actually see what is on those buses.

By default, i2c-10 is the I2C interface to CAM1 (and DISP1), and i2c-0 is for CAM0 (and DISP0, and pins 27&28 of the 40 way header).

Statistics: Posted by 6by9 — Wed Mar 06, 2024 5:06 pm



Viewing all articles
Browse latest Browse all 5471

Trending Articles