User avatar
Boeeerb
Posts: 43
Joined: Thu Sep 27, 2012 2:40 am
Contact: Website

Problem with i2c 0 bus

Wed Aug 06, 2014 8:02 pm

I'm hoping I am missing something really simple, but after spending 2 days, and restarting from the beginning with a fresh SD, I cannot detect anything on the ID_SC ID_SD line. I have plugged the eeprom on to the GPIO 2+3 i2c and can detect it without any problem showing on 0x50.

I have i2c-dev in modules and commented out the blacklist, run update, upgrade, rpi-update and dist-upgrade and still nothing works.

As a last resort to see if it is the cable, plugged LEDs on the pulled up resistors between 3v3 and the pin to get a flash if anything is being transmitted (and they both flash upon i2cdetect) but eepflash cannot see anything still.

So any clues? (Tried 2 different eeprom chips also)
Find me on Twitter - @Boeeerb
Website - http://www.boeeerb.co.uk

User avatar
joan
Posts: 14097
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Problem with i2c 0 bus

Wed Aug 06, 2014 8:17 pm

What gpios is the bus meant to be using? I thought 0/1. However the current B+ firmware seems to associate bus 0 with gpios 28/29 and bus 1 with gpios 2/3.

usul27
Posts: 23
Joined: Mon Nov 26, 2012 9:54 am

Re: Problem with i2c 0 bus

Wed Aug 06, 2014 8:39 pm

This might be the same problem discussed here:
http://www.raspberrypi.org/forums/viewt ... 00&t=82772

User avatar
joan
Posts: 14097
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Problem with i2c 0 bus

Wed Aug 06, 2014 8:48 pm

usul27 wrote:This might be the same problem discussed here:
http://www.raspberrypi.org/forums/viewt ... 00&t=82772
Probably. If you switch 28/29 to inputs and switch 0/1 to ALT0 the bus reappears on 0/1.

User avatar
Boeeerb
Posts: 43
Joined: Thu Sep 27, 2012 2:40 am
Contact: Website

Re: Problem with i2c 0 bus

Wed Aug 06, 2014 9:10 pm

Thanks usul27, running them 4 lines worked this time, it did refuse to set the direction first time though, kept telling me the file is busy... Odd...

Hopefully see this fixed before the first launch of HATs arrive.

Now to work on how the Pi will auto install drivers when that is ready
Find me on Twitter - @Boeeerb
Website - http://www.boeeerb.co.uk

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2035
Joined: Thu Jul 11, 2013 2:37 pm

Re: Problem with i2c 0 bus

Wed Aug 06, 2014 9:27 pm

Boeeerb wrote:Thanks usul27, running them 4 lines worked this time, it did refuse to set the direction first time though, kept telling me the file is busy... Odd...

Hopefully see this fixed before the first launch of HATs arrive.

Now to work on how the Pi will auto install drivers when that is ready
I2C0 is used by Videocore and by default is enabled on GPIO28/29. It will be the VC bootloader that temporarily swaps the alt settings around and probes the GPIO0/GPIO1 I2C0 bus for the EEPROM prior to booting the ARM. There should be no need to probe the EEPROM from Linux in a fully functioning system, but for development or test purposes the hack in the linked thread can let you talk to the EEPROM in Linux.
Rockets are loud.
https://astro-pi.org

User avatar
Boeeerb
Posts: 43
Joined: Thu Sep 27, 2012 2:40 am
Contact: Website

Re: Problem with i2c 0 bus

Wed Aug 06, 2014 10:28 pm

Now that makes more sense, it didn't seem to occur to me as I've been trying to get it to work to program the eeprom before being able to play with it.

Can't wait for the documentation about driver loading and such when it is ready
Find me on Twitter - @Boeeerb
Website - http://www.boeeerb.co.uk

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: Problem with i2c 0 bus

Wed Aug 06, 2014 11:56 pm

jdb wrote:There should be no need to probe the EEPROM from Linux in a fully functioning system, but for development or test purposes the hack in the linked thread can let you talk to the EEPROM in Linux.
Interesting... does that mean that there's no method to read "manufacturer custom data" https://github.com/raspberrypi/hats/blo ... atom-types and it's merely there as some kind of placeholder?

User avatar
Boeeerb
Posts: 43
Joined: Thu Sep 27, 2012 2:40 am
Contact: Website

Re: Problem with i2c 0 bus

Thu Aug 07, 2014 8:21 am

You can read off the eeprom in to an eep file after writing, and then use eepdump to convert the file so it is readable - All quick and painless. It wouldn't work of other eeproms from different systems though I doubt
Find me on Twitter - @Boeeerb
Website - http://www.boeeerb.co.uk

James Adams
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 117
Joined: Wed Mar 19, 2014 2:58 pm
Location: Cambridge

Re: Problem with i2c 0 bus

Sun Aug 10, 2014 6:56 pm

Plan is for the Pi to read the EEPROM data once at boot and cache it, then provide the cached data via a sysfs interface (or similar). Obviously software doesn't do this yet but we're working on it.
James Adams
Raspberry Pi - COO & Hardware Lead

dis
Posts: 1
Joined: Thu Oct 15, 2015 2:37 am

Re: Problem with i2c 0 bus

Thu Oct 15, 2015 2:42 am

Was there any more info on this? I've found /sys/firmware/devicetree/base/hat for the general stuff, but I can't seem to find a way to the 'manufacturer custom data' atom types. I'd like to use it to store hat-to-hat specific details.

qjyao
Posts: 1
Joined: Sat Oct 31, 2015 8:22 am
Location: Nanjing, China
Contact: Website

Re: Problem with i2c 0 bus

Sat Oct 31, 2015 8:29 am

Remember to enable i2c0 before digging up.
Please append "dtparam=ic2_vc" in /boot/config.txt

User avatar
brekee12
Posts: 335
Joined: Wed Feb 03, 2016 3:36 pm
Location: HU

Re: Problem with i2c 0 bus

Thu Feb 11, 2016 10:47 am

James Adams wrote:Plan is for the Pi to read the EEPROM data once at boot and cache it, then provide the cached data via a sysfs interface (or similar). Obviously software doesn't do this yet but we're working on it.
Hello,

I have a littlebit different problem with i2c0. I would like to use parallel transfer gpios and it would be great to use gpio0 and 1 as normal io or a kernel loadable i2c bus. If it changes input state at startup may cause problem with hardware. Is it possible to write your EEPROM bootloader to use different gpios at startup or is it hardwired? Is not possible to disable this I2C0 in some booting program to change it to loadable module?
Regards,
Brekee12
on a Raspberry B+ with whezzy, two Zero with Jessie Light

User avatar
joan
Posts: 14097
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Problem with i2c 0 bus

Thu Feb 11, 2016 11:10 am

It needs to be those GPIO because HATS will be fixed to use pins 27/28 (GPIO 0/1).

It might be convenient to have the GPIO in sequence, but why not, for instance, 5, 6, 7, 8, 9, 10, 11, 12?

It's only a single shift before and after transmission.

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

Re: Problem with i2c 0 bus

Thu Feb 11, 2016 11:29 am

If you really don't want to probe for a HAT EEPROM at all, you should be able to either add

Code: Select all

force_eeprom_read=0
to config.txt, or create a custom dt-blob.bin which does NOT define ID_SDA.

You might be able to create a dt-blob.bin that redefined ID_SDA and ID_SCL to other pins that can support i2c-0, but then they won't be connected to the right pins on the GPIO header to find a standard HAT.
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.

User avatar
brekee12
Posts: 335
Joined: Wed Feb 03, 2016 3:36 pm
Location: HU

Re: Problem with i2c 0 bus

Thu Feb 11, 2016 11:37 am

I am still thinking on the 12 bit ad and da project. PCB is on the way with gpio0/1.
But in case of DA not a problem I have to CS the data, so it does not hurt too much on the beginning.

But definitly it would be more comfortable in interfacing parallel things to have in sequence as much i/o as possible even if they are not on sequenced pin.

I does not need HAT at all in time of internet. And it is possible to configure i2c on other pins in case I want to use on the board. Is that rigth? These would make RPi greatness configurability.
Brekee12
on a Raspberry B+ with whezzy, two Zero with Jessie Light

User avatar
joan
Posts: 14097
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Problem with i2c 0 bus

Thu Feb 11, 2016 11:51 am

The hardware I2C bus is only available on GPIO 0, 1, 2, and 3 (unless you have the compute module).

Of course you can bit bang I2C on any GPIO you choose (and I think there may be a kernel I2C bit bang module).

User avatar
brekee12
Posts: 335
Joined: Wed Feb 03, 2016 3:36 pm
Location: HU

Re: Problem with i2c 0 bus

Thu Feb 11, 2016 12:04 pm

I put into config.txt the next two line:
dtparam=i2c_arm=off
dtparam=i2s_arm=off
Is it enough to disable the I2C ports?
Brekee12
on a Raspberry B+ with whezzy, two Zero with Jessie Light

User avatar
joan
Posts: 14097
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Problem with i2c 0 bus

Thu Feb 11, 2016 12:07 pm

I'm not sure i2s is relevant.

6by9 says to add force_eeprom_read=0.

In addition perhaps dtparam=i2c_vc=off

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

Re: Problem with i2c 0 bus

Thu Feb 11, 2016 12:12 pm

joan wrote:I'm not sure i2s is relevant.

6by9 says to add force_eeprom_read=0.

In addition perhaps dtparam=i2c_vc=off
dtparam=i2c_vc=off is the default anyway. I thought the same was true for i2c_arm.
Both only affect the Linux kernel anyway, not the GPU.
If it is the boot time HAT probe you're worried about, then "force_eeprom_read=0" should be what you want.
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 “HATs and other add-ons”