picandies
Posts: 97
Joined: Wed Nov 26, 2014 5:13 pm

CM3 and i2c0

Tue Aug 07, 2018 2:56 pm

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?

aBUGSworstnightmare
Posts: 768
Joined: Tue Jun 30, 2015 1:35 pm

Re: CM3 and i2c0

Tue Aug 07, 2018 3:09 pm

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

picandies
Posts: 97
Joined: Wed Nov 26, 2014 5:13 pm

Re: CM3 and i2c0

Tue Aug 07, 2018 3:57 pm

Display? This has nothing to do with a display...

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

aBUGSworstnightmare
Posts: 768
Joined: Tue Jun 30, 2015 1:35 pm

Re: CM3 and i2c0

Tue Aug 07, 2018 4:37 pm

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

picandies
Posts: 97
Joined: Wed Nov 26, 2014 5:13 pm

Re: CM3 and i2c0

Tue Aug 07, 2018 6:34 pm

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?

aBUGSworstnightmare
Posts: 768
Joined: Tue Jun 30, 2015 1:35 pm

Re: CM3 and i2c0

Tue Aug 07, 2018 7:02 pm

Sorry, but I'm unable to provide answers to all-caps letter questions.
Good luck!

picandies
Posts: 97
Joined: Wed Nov 26, 2014 5:13 pm

Re: CM3 and i2c0

Tue Aug 07, 2018 7:24 pm

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

aBUGSworstnightmare
Posts: 768
Joined: Tue Jun 30, 2015 1:35 pm

Re: CM3 and i2c0

Tue Aug 07, 2018 7:43 pm

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)?

picandies
Posts: 97
Joined: Wed Nov 26, 2014 5:13 pm

Re: CM3 and i2c0

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.

Brandon92
Posts: 160
Joined: Wed Jul 25, 2018 9:29 pm
Location: Netherlands

Re: CM3 and i2c0

Tue Aug 07, 2018 11:11 pm

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 :)

aBUGSworstnightmare
Posts: 768
Joined: Tue Jun 30, 2015 1:35 pm

Re: CM3 and i2c0

Wed Aug 08, 2018 5:27 am

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

texy
Forum Moderator
Forum Moderator
Posts: 5131
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: CM3 and i2c0

Wed Aug 08, 2018 6:24 am

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
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

Return to “Compute Module”

Who is online

Users browsing this forum: No registered users and 0 guests