cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jksandek
Visitor
Visitor
570 Views
Registered: ‎05-13-2019

Zedboard - I'm not eble to set i2c on PS

Hi, this is my first post, sorry for my English.
I'm trying to address i2c on Zedboard PS without luck, using Vivado, SDK and Yocto Project.

My current situation is:

With Vivado:

1) Create Project -> RTL Project

2) Create block design -> Add IP -> ZYNQ7 Processing System

3) Run Block Automation

4) In "MIO Configuration" i enabled i2c0 on "MIO 10 11" and i2c1 on "MIO 12 13", i clicked on "Create HDL Wrapper..." and then i generated the bitstream

5) File -> Export -> Export Hardware -> Include bitstream -> Launch SDK

- then i converted the bitstream .bit in .bin (fpga.bin)

6) In SDK i generate new board support package

- File -> New -> Board Support Package -> device tree (for this i downloaded a plugin to generate DTS)
- Then i choose kernel 2018.3.
- This generated these files: pcw.dtsi, skeleton.dtsi, system.dts, system-top.dts, zynq-7000.dtsi

With yocto:

1)I've cloned yocto project (poky 2.6.2 thud)

2)I've cloned layer meta-openembedded and meta-xilinx.

I've modified then file bblayers.conf adding in it:
/home/jksandek/poky/meta-openembedded/meta-oe \
/home/jksandek/poky/meta-xilinx/meta-xilinx-bsp \

3) I've added the file local.conf

MACHINE ??= "zedboard-zynq7"
...
IMAGE_INSTALL_append = " rsync"
IMAGE_INSTALL_append = " busybox"
IMAGE_INSTALL_append = " openssh"
IMAGE_INSTALL_append = " nano"
IMAGE_INSTALL_append = " i2c-tools"
ENABLE_I2C = "1"
INHERIT += "rm_work"

4) Then i have created a new layer "meta-dts" with the following folder tree:

meta-dts
├── conf
│    └── layer.conf
├── COPYING.MIT
└── recipes-kernel
      └── linux
            ├── linux-xlnx
            │    ├── myconfig.cfg
            │    └── zedboard-zynq7
            │    ├── pcw.dtsi
            │    ├── skeleton.dtsi
            │    ├── system.dts
            │    ├── system-top.dts
            │    └── zynq-7000.dtsi
            └── linux-xlnx_%.bbappend


5) Then i added this layer in bblayers.conf

6) Start bitbake with:

- bitbake core-image-minimal

7) At the end of the bitbake i've added the following files in the SD BOOT partition

- boot.bin
- fpga.bin
- system-top.dts
- u-boot.img
- uImage
- uEnv.txt

8) In the rootfs partition i've added and unzipped the following file:

- core-image-minimal-zedboard-zynq7.tar.gz

9) At the end i started the zedboard and once i logged in i've typed:

- i2cdetect -r -y 0


but this return something like:

root@zynq:~# i2cdetect -y -r 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: cdns-i2c e0004000.ps7-i2c: timeout waiting on completion
-- cdns-i2c e0004000.ps7-i2c: timeout waiting on completion
...

What's wrong?

Thank you

0 Kudos
2 Replies
stephenm
Xilinx Employee
Xilinx Employee
535 Views
Registered: ‎09-12-2007

You will need to update the devicetree to include the i2c bus and devices. The yocto will just use the HDF to create the devicetree. This just contain the device nodes that are internal to the BD (Block Design)

0 Kudos
jksandek
Visitor
Visitor
498 Views
Registered: ‎05-13-2019

Hi, thanks for your answer.

How can i add i2c bus and devices?

This is the configuration in the zynq-7000.dtsi:

i2c1: i2c@e0005000 {

compatible = "cdns,i2c-r1p10";

status = "disabled";

clocks = <&clkc 39>;

interrupt-parent = <&intc>;

interrupts = <0 48 4>;

reg = <0xe0005000 0x1000>;

#address-cells = <1>;

#size-cells = <0>;

};

So i tried adding in pcw.dtsi my PMOD-cdc1 like this:

&i2c1 {

clock-frequency = <400000>;

status = "okay";

ad7156@48 {

compatible = "adi,ad7156";

reg = <0x48>;

};

};

The error does't change at all.

Thank you.

 

0 Kudos