Activating I2C1 in BBB Rev C

1,049 views
Skip to first unread message

sajeevan k

unread,
Oct 12, 2017, 8:07:06 AM10/12/17
to BeagleBoard
Hi all,

I would like to use both I2C1 and I2C2 which are available in Beaglebone Black P9 connector. I could make I2C2 working. But so far I couldn't make I2C1 working.

In /boot/uEnv.txt, I have not commented the line
cmdline=coherent_pool=1M net.ifnames=0 quiet cape_universal=enable

That means Universal cap is active.

So I cannot use the command

echo BB-I2C1 > /sys/devices/platform/bone_capemgr/slots


for enabling I2C1.


I would like to make Universal Cape enabled, other wise I will not be able to make the P9_14 and P9_16 as PWMs.



So my question is, is there anyway to enable I2C1, while Universal Cap is enabled?


I am using the latest debian image - bone-debian-8.7-lxqt-4gb-armhf-2017-03-19-4gb.img and BBB Rev C.



I have examined the am335x-boneblack.dts file (got from coverting /boot/dtbs/4.4.54-ti-r93/am335x-boneblack.dtb).


In this .dts file i2c1 portion is as shown below.



i2c@4802a000 {
                        compatible = "ti,omap4-i2c";
                        #address-cells = <0x1>;
                        #size-cells = <0x0>;
                        ti,hwmods = "i2c2";
                        reg = <0x4802a000 0x1000>;
                        interrupts = <0x47>;
                        status = "disabled";
                        linux,phandle = <0xa0>;
                        phandle = <0xa0>;
                };


pinmux_i2c2_pins {
                                                pinctrl-single,pins = <0x178 0x33 0x17c 0x33>;
                                                linux,phandle = <0x35>;
                                                phandle = <0x35>;
                                        };


I modified it as below.




i2c@4802a000 {
                        compatible = "ti,omap4-i2c";
                        #address-cells = <0x1>;
                        #size-cells = <0x0>;
                        ti,hwmods = "i2c2";
                        reg = <0x4802a000 0x1000>;
                        interrupts = <0x47>;
                        status = "okay";
                        pinctrl-names = "default";
                        pinctrl-0 = <0x35>;
                        clock-frequency = <0x61a80>;
                        linux,phandle = <0xa0>;
                        phandle = <0xa0>;
                };


pinmux_i2c2_pins {
                                                pinctrl-single,pins = <0x178 0x33 0x17c 0x33>;
                                                linux,phandle = <0x35>;
                                                phandle = <0x35>;
                                        };


But still I2C1 is not working. Is my procedure right? Am I missing something?




Expecting Your fast reply.

Thanks in advance for the help.



Thanks & Regards,
Sajeevan.K

Jose Valenzuela San Juan

unread,
Oct 12, 2017, 9:30:59 AM10/12/17
to BeagleBoard
What I do is enable them using config-pin like so (pins p9-17 & p9-18 in the example):
sudo config-pin p9-17 i2c
sudo config
-pin p9-18 i2c
by default those are configured as gpio. This settings are lost when you restart, but you can autoexecute those commands every boot.

You can see how are configured (or check if the previos command worked) with the -q option:
config-pin -q p9-17


list available modes with -l:
config-pin -l p9-17


or get detailed info with -i:
config-pin -i p9-17


That's what i am using for the moment, but I like to also know for a more correct/goodpractice/efficient/permanent/lowlevel/before-boot/devicetree/uboot way of setting those parameters.

Other thing: the latest images were updated check https://beagleboard.org/latest-images.
Also there are monthly and weekly releases: https://rcn-ee.net
You most probably need to update u-boot to go from bone-debian-8.7-lxqt-4gb-armhf-2017-03-19-4gb.img to the latest.

Regards,

evilwulfie

unread,
Oct 12, 2017, 9:58:47 AM10/12/17
to beagl...@googlegroups.com
overlays are the best permanent solution
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/d6db1d3e-9b68-4f8c-b88d-ba805e94ab2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sajeevan k

unread,
Oct 13, 2017, 4:09:21 AM10/13/17
to BeagleBoard

Hi Jose Valenzuela San Juan,

Thank You very much.
Your suggestion solved my issue.

Earlier I tried something like this as per the following video for pwm enabling - https://www.youtube.com/watch?v=MT3wjlzQhNQ.

I tried

config-pin P9.17 i2c

config-pin P9.18 i2c



But that was not successful.


Now I got the correct solution


config-pin p9-17 i2c

config-pin p9-18 i2c

from You. Thank You.
If You provide some documents which describes this, that would be more appreciated.

Thanks & Regards,
Sajeevan.K

Jose Valenzuela San Juan

unread,
Oct 13, 2017, 1:23:04 PM10/13/17
to BeagleBoard
Good to know that the info was helpful.

That's weird, the script is made so that its friendly with how you input the pin name: 917, p917, 9.17, 9-17, p9.17, P9-17 and so on, all work fine..

The documentation is in the github page of the universal device tree overlay and supporting scripts:

regards,

Jose Valenzuela San Juan

unread,
Oct 13, 2017, 1:36:09 PM10/13/17
to BeagleBoard
I forgot to mention
I had the image version that you are using and after an apt-upgrade (from debian image - bone-debian-8.7-lxqt-4gb-armhf-2017-03-19-4gb.img and BBB Rev C. in july) config-pin stopped working.


Flashing the latest images solved the problem.

One more thing. If you update to newer images, the way the overlays are loaded changed, so that video is now outdated.

 
Regards,

Jose Valenzuela San Juan

unread,
Oct 13, 2017, 1:39:01 PM10/13/17
to BeagleBoard
Config-pin works fine though

sajeevan k

unread,
Oct 14, 2017, 7:01:11 AM10/14/17
to BeagleBoard
Hi Jose Valenzuela San Juan,

Thank You very much for the information.

Based on Your mail, I tested again with


config-pin P9.17 i2c

config-pin P9.18 i2c


Now it is working. 


I might not have tested it properly.



or I might have tested it, before doing modification in .dts file.



Thank You very much for giving me plenty of information.


Thanks & Regards,
Sajeevan.K


Thank

Mala Dies

unread,
Oct 17, 2017, 7:45:05 PM10/17/17
to BeagleBoard
Hello,


Enjoy,

Seth

P.S. This helped me keep my configuration after boot, i.e. after reboot or starting the machine. 
Reply all
Reply to author
Forward
0 new messages