element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet & Tria Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
MicroZed Hardware Design I2C problem
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 1 reply
  • Subscribers 341 subscribers
  • Views 496 views
  • Users 0 members are here
Related

I2C problem

starbright
starbright over 10 years ago

I read some threads here about I2C but couldn't found solution. The main issue is, I can't see anything toggling at the clock and data pin

1)
I Linux kernel I enabled the Cadence I2C (this addresses the two fixed built-in interfaces, right?). To be sure I also enabled Xilinx I2C Controller - does this disturbes something?

2)
In devicetree for some reason I found
ttps7_i2c_0: ps7-i2c@e0004000 { compatible = "invalid"; };
ttps7_i2c_1: ps7-i2c@e0005000 { compatible = "invalid"; };
Seems that this has to be commented out, as it otherwise will not work, right?

3) This I left unchanged, mainly because I didn't get the meaning:
ttps7_i2c_0: ps7-i2c@e0004000 {
tttbus-id = <0>;
tttclocks = <&clkc 38>;
tttcompatible = "cdns,i2c-r1p10", "xlnx,ps7-i2c-1.00.a";
tttinterrupt-parent = <&ps7_scugic_0>;
tttinterrupts = <0 25 4>;
tttreg = <0xe0004000 0x1000>;
ttti2c-clk = <400000>;
ttt#address-cells = <1>;
ttt#size-cells = <0>;
ttt};

Do I have to add a device here?


4)
In Vivado I customized I2C-0 to EMIO, make it external

5)
Connected in Package Pin to Bank 35, I2C clock to J14 (JH2 at carrier card), Data to G15. (SPI at same bank works fine).

6)
Booting that gives me:
root@uzed:~# i2cdetect -l
i2c-0   i2c             Cadence I2C at e0004000                 I2C adapter
i2c-1   i2c             Cadence I2C at e0005000                 I2C adapter

But I can't see anything at the Pins.

i2cdetect -r 0 just gives timeouts.
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0 using read byte commands.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          [ 2460.945542] cdns-i2c e0004000.ps7-i2c: timeout waiting on completion
-- [ 2461.945541] cdns-i2c e0004000.ps7-i2c: timeout waiting on completion
-- [ 2462.945546] cdns-i2c e0004000.ps7-i2c: timeout waiting on completion


What might go wrong here?

  • Sign in to reply
  • Cancel
  • starbright
    0 starbright over 10 years ago

    Some more observations:
    Uncommenting in devictree was correct: If I uncomment just this line
    ps7_i2c_0: ps7-i2c@e0004000 { compatible = "invalid"; };
    gives me with i2detect -l indeed just i2c-0, not i2c-1 anymore.

    Nevertheless, the devicenode /dev/i2c-1 will created, but I cannot access it, although it exist.
    #i2cdetect -r 1
    Error: Could not open file `/dev/i2c-1': No such device


    I compiled all the i2cdebug options, so
    dmesg | grep i2c gives me a lot:

    [    0.198116] i2c-core: driver [dummy] registered
    [    0.838186] i2c-core: driver [at24] registered
    [    1.044412] i2c-core: driver [rtc-pcf8563] registered
    [    1.044424] i2c /dev entries driver
    [    1.048538] i2c-dev: adapter [Cadence I2C at e0004000] registered as minor 0
    [    1.048683] i2c i2c-0: adapter [Cadence I2C at e0004000] registered
    [    1.048713] i2c i2c-0: of_i2c: walking child nodes
    [    1.048726] i2c i2c-0: of_i2c: register /amba@0/ps7-i2c@e0004000/eeprom@50
    [    1.049003] i2c 0-0050: uevent
    [    1.049247] i2c 0-0051: uevent
    [    1.049407] i2c i2c-0: client [dummy] registered with bus id 0-0051
    [    1.049507] i2c 0-0052: uevent
    [    1.049664] i2c i2c-0: client [dummy] registered with bus id 0-0052
    [    1.049764] i2c 0-0053: uevent
    [    1.049920] i2c i2c-0: client [dummy] registered with bus id 0-0053
    [    1.056603] i2c i2c-0: client [24c08] registered with bus id 0-0050
    [    1.056624] cdns-i2c e0004000.ps7-i2c: 100 kHz mmio e0004000 irq 57
    [    1.063355] i2c-core: driver [pca954x] registered
    [    1.063780] i2c-core: driver [pmbus] registered
    [    1.063938] i2c-core: driver [ucd9000] registered
    [    1.064102] i2c-core: driver [ucd9200] registered
    [    1.153603] i2c-core: driver [si570] registered
    [  175.305038] i2c i2c-0: ioctl, cmd=0x705, arg=0xbecc5888
    [  229.821749] i2c i2c-0: ioctl, cmd=0x705, arg=0xbe96fc50

    Does the registered device drivers (?) somehow disturb the /dev/i2c-0?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube