Page 1 of 1

CM3 and i2c0

Posted: Tue Aug 07, 2018 2:56 pm
by picandies
Hello:

Using a compute module (cm3l) & stretch. My board has devices on both I2c busses. got bus 1 working easy, no problem, but having trouble with bus 0 (sda0 & scl0)...seems like its just giving error (as though not enabled/configured).

What is the latest to get it up & running?

Re: CM3 and i2c0

Posted: Tue Aug 07, 2018 3:09 pm
by aBUGSworstnightmare
There's a dedicated Compute Module section here in the Forum where your CM3 related questions might be better suited.
viewforum.php?f=98

Is your I2C configured correctly - i.e. via custom device tree blob?

Look i.e. here for some examples/hints: https://www.raspberrypi.org/documentati ... display.md

More Details might be found in the device tree section of the forum

Re: CM3 and i2c0

Posted: Tue Aug 07, 2018 3:57 pm
by picandies
Display? This has nothing to do with a display...

My board has chips hooked to sda0 & scl0 and sda1 & scl1

Re: CM3 and i2c0

Posted: Tue Aug 07, 2018 4:37 pm
by aBUGSworstnightmare
picandies wrote: Display? This has nothing to do with a display...

My board has chips hooked to sda0 & scl0 and sda1 & scl1
... And what I've linked is exactly it: i2c slaves (camera and touch controller) on both busses.
It's not about these devices; linked page shows you examples how to configure/initialize I2C busses

Re: CM3 and i2c0

Posted: Tue Aug 07, 2018 6:34 pm
by picandies
WHERE IS THE INFORMATION ON SETTING UP BOTH I2C BUSSES?...your link mentions nothing to do so...WHICH STEPS ARE CONFIUGURING THE [email protected] BUSSES?

Re: CM3 and i2c0

Posted: Tue Aug 07, 2018 7:02 pm
by aBUGSworstnightmare
Sorry, but I'm unable to provide answers to all-caps letter questions.
Good luck!

Re: CM3 and i2c0

Posted: Tue Aug 07, 2018 7:24 pm
by picandies
Again, where is the information on setting up sda0 & scl0? I see no mention of doing so, please list those exact steps. This information should be readily stated in the CM3 user manual !!


by the way I did try :
sudo wget https://goo.gl/htHv7m -O /boot/dt-blob.bin


however sudo i2cdetect -y 0 still shows an error (nosuch file or directory)

sudo i2cdetect -y 1 shows dashes & anything connected to i2c bus 1

Re: CM3 and i2c0

Posted: Tue Aug 07, 2018 7:43 pm
by aBUGSworstnightmare
Maybe you should try to understand what you're doing and not expect to get spoon-feed

Have you ever looked INTO the sources of a dt-blob file (available from the useless page linked by me)?

Re: CM3 and i2c0

Posted: Tue Aug 07, 2018 11:08 pm
by picandies
I came here asking how to set up BOTH i2c ports...can you say how to do it or not?

If you don't really know how to explain it, let someone who has the knowledge do it. A hal-ass answer is not helpful.

Re: CM3 and i2c0

Posted: Tue Aug 07, 2018 11:11 pm
by Brandon92
picandies wrote:
Tue Aug 07, 2018 11:08 pm
I came here asking how to set up BOTH i2c ports...can you say how to do it or not?

If you don't really know how to explain it, let someone who has the knowledge do it. A hal-ass answer is not helpful.
Well, do you pay him to answer you? The other way is to find it out by yourself, or use google ;) And if you replay like this, you would probably don't get a answer..

EDIT:
Or find it here :)

Re: CM3 and i2c0

Posted: Wed Aug 08, 2018 5:27 am
by aBUGSworstnightmare
picandies wrote:
Tue Aug 07, 2018 11:08 pm
I came here asking how to set up BOTH i2c ports...can you say how to do it or not?

If you don't really know how to explain it, let someone who has the knowledge do it. A hal-ass answer is not helpful.
Man ... Before you start shouting on others and insult them you shoukd better take your time to think about what they've told you.

Here's an excerpt of the device tree blob source file I've linked in my first replay.

Code: Select all

pins_cm {
         pin_config {
            [email protected] {
               polarity = "active_high";
               termination = "pull_down";
               startup_state = "inactive";
               function = "input";
            }; // pin
            [email protected]  { function = "input";  termination = "pull_up";    }; // CAMERA 0 I2C0 SDA
            [email protected]  { function = "input";  termination = "pull_up";    }; // CAMERA 0 I2C0 SCL
            [email protected]  { function = "output";  termination = "no_pulling"; }; // CAMERA 0 LED
            [email protected]  { function = "output";  termination = "no_pulling"; }; // CAMERA 0 SHUTDOWN
            [email protected] { function = "uart0";  termination = "no_pulling"; }; // TX uart0
            [email protected] { function = "uart0";  termination = "pull_up"; }; // RX uart0
            [email protected] { function = "input";  termination = "pull_up";    }; // CAMERA 1 I2C0 SDA
            [email protected] { function = "input";  termination = "pull_up";    }; // CAMERA 1 I2C0 SCL
            [email protected]  { function = "output";  termination = "no_pulling"; }; // CAMERA 1 LED
            [email protected]  { function = "output";  termination = "no_pulling"; }; // CAMERA 1 SHUTDOWN
            [email protected] { function = "output"; termination = "no_pulling"; polarity = "active_low"; }; // EMMC_ENABLE_N
            [email protected] { function = "sdcard"; termination = "pull_up";    drive_strength_mA = < 8 >; }; // SD CLK
            [email protected] { function = "sdcard"; termination = "pull_up";    drive_strength_mA = < 8 >; }; // SD CMD
            [email protected] { function = "sdcard"; termination = "pull_up";    drive_strength_mA = < 8 >; }; // SD D0
            [email protected] { function = "sdcard"; termination = "pull_up";    drive_strength_mA = < 8 >; }; // SD D1
            [email protected] { function = "sdcard"; termination = "pull_up";    drive_strength_mA = < 8 >; }; // SD D2
            [email protected] { function = "sdcard"; termination = "pull_up";    drive_strength_mA = < 8 >; }; // SD D3
         }; // pin_config

         pin_defines {
            [email protected]_ENABLE {
               type = "internal";
               number = <47>;
            };
            [email protected]_SDA {
               type = "internal";
               number = <0>;
            };
            [email protected]_SCL {
               type = "internal";
               number = <1>;
            };
            [email protected]_I2C_PORT {
               type="internal";
               number=<0>;
             };

            [email protected]_CAMERAS {
               type = "internal";
               number = <2>;
            };
            [email protected]_0_LED {
               type = "internal";
               number = <4>;
            };
            [email protected]_0_SHUTDOWN {
               type = "internal";
               number = <5>;
            };
            [email protected]_0_UNICAM_PORT {
               type = "internal";
               number = <1>;
            };
            [email protected]_0_I2C_PORT {
               type = "internal";
               number = <0>;
            };
            [email protected]_0_SDA_PIN {
               type = "internal";
               number = <0>;
            };
            [email protected]_0_SCL_PIN {
               type = "internal";
               number = <1>;
            };

            [email protected]_1_LED {
               type = "internal";
               number = <30>;
            };
            [email protected]_1_SHUTDOWN {
               type = "internal";
               number = <31>;
            };
            [email protected]_1_UNICAM_PORT {
               type = "internal";
               number = <0>;
            };
            [email protected]_1_I2C_PORT {
               type = "internal";
               number = <0>;
            };
            [email protected]_1_SDA_PIN {
               type = "internal";
               number = <28>;
            };
            [email protected]_1_SCL_PIN {
               type = "internal";
               number = <29>;
            };
         }; // pin_defines
      }; // pins_cm
If you'ld have taken your time to look at it you would have noted that both I2C busses get initialized.
As you're working with Compute Module I need to assume you're aware of the fact you can either achieve this by writing your custom device tree blob - starting from the minimal blob https://www.raspberrypi.org/documentati ... t-blob.dts - or by using overlays.
Another good reading is here https://www.raspberrypi.org/documentati ... w-guide.md

Re: CM3 and i2c0

Posted: Wed Aug 08, 2018 6:24 am
by texy
Guy's if you can't speak in a civil manner then moderator intervention will be taking place. Please play nicely...............

Actually locking as duplicated here :
viewtopic.php?f=98&p=1350172#p1350172

Texy