www.8devices.com
|
|
Author |
Message |
hutorny
Joined: 11 Jun 2013, 11:34 Posts: 39
|
|
13 Oct 2013, 19:35 |
|
|
tty
Joined: 18 Mar 2012, 19:06 Posts: 52
|
|
14 Oct 2013, 08:13 |
|
|
hutorny
Joined: 11 Jun 2013, 11:34 Posts: 39
|
|
14 Oct 2013, 10:51 |
|
|
shawnup
Joined: 20 Nov 2013, 03:13 Posts: 2
|
I'm having trouble getting i2c working on a Carambola2. My image is compiled straight from the 8devices carambola2 github repository.
I get the following messages when the kernel boots:
root@carambola2:/# dmesg | grep i2c [ 0.550000] i2c-gpio i2c-gpio.0: using pins 18 (SDA) and 19 (SCL) [ 2.930000] i2c /dev entries driver
I've been trying to generate i2c traffic with no devices connected, by using i2cdetect and i2cdump from the i2c-tools package. For example I use the command "i2cdetect 0" which successfully starts running.
However with a scope I see that both gpio18 and gpio19 are always low while i2cdetect runs.
Also, using a tool to read the device registers I see that 0x1804000 (GPIO_OE) never changes the values for 18/19, nor does 0x1804004 (GPIO_IN) or 0x18040008 (GPIO_OUT). I can use the same tool to set bits on gpio18/19, which do get reflected on my scope.
I've also tried using the Openwrt i2c-gpio-custom driver to setup i2c on other gpios, to no avail.
So what am I doing wrong? Thanks in advance.
|
20 Nov 2013, 03:21 |
|
|
shawnup
Joined: 20 Nov 2013, 03:13 Posts: 2
|
And of course I figured this out just after I posted.
I had assumed I would see gpio action without actually pulling scl and sda high, but I was wrong.
I put a resistors from 3.3v to sda and scl, now I see traffic.
|
20 Nov 2013, 03:36 |
|
|
Mike123
Joined: 15 Aug 2013, 05:48 Posts: 11
|
I cannot compile i2c-tools (dl/i2c-tools-3.1.0.tar.bz2), many compile errors regarding i2c.h .
Kernel ist from carambola2 github (ca. 3 months ago), updated and upgraded.
make menuconfig <*> kmod-i2c-core <*> kmod-i2c-gpio <*> i2c-tools <*> python-smbus
Found:
target/linux/ar71xx/config-3.7 with CONFIG_I2C_CHARDEV=y target/linux/ar71xx/config-3.8 without "
and have to hand edit second file to get I2C character device (SDA GPIO 18, SCL GPIO 19) with 8devices carambola patch.
There are some OpenWrt mails with the same issue some months ago, but I do not read a solution.
Any hints? Fresh carambola2 github download since shawnup was able to compile i2c-tools some days ago?
|
28 Nov 2013, 11:16 |
|
|
FPeter
Joined: 21 Aug 2013, 21:21 Posts: 101
|
|
29 Nov 2013, 13:26 |
|
|
Mike123
Joined: 15 Aug 2013, 05:48 Posts: 11
|
Thank you for the hint. The tools and Python smbus and I2C are working now.
But the compilation issue for newer versions remains. Not really a problem since with files dir I am able to prepare a firmware image with some older binary only tools.
|
03 Dec 2013, 04:53 |
|
|
valent
Joined: 18 Nov 2013, 18:44 Posts: 54
|
I tried using SPI pins (GPIO 3 and 4) but couldn't get them to work as I2C pins. For explanation which pins are which, and how they map to GPIO pins check out attached image. Check out my blog for detailed instructions: http://kernelreloaded.blog385.com/index ... g-openwrt/Strange thing is that while booting up Carambola 2 there is a lot of chatter on SPI pins when they are connected to osciloscope... so is it possible that SPI pins (gpio 3 and 4) need to be somehow disabled before they can be used as I2C pins?
Attachments:
Selection_004.png [ 161.9 KiB | Viewed 4361 times ]
|
13 Feb 2014, 20:16 |
|
|
FPeter
Joined: 21 Aug 2013, 21:21 Posts: 101
|
|
13 Feb 2014, 20:54 |
|
|
Who is online |
Users browsing this forum: No registered users |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|