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
    About the element14 Community
  • 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
ZedBoard Hardware Design How to activate SPI in zedboard
  • 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 3 replies
  • Subscribers 354 subscribers
  • Views 413 views
  • Users 0 members are here
Related

How to activate SPI in zedboard

ashahsana
ashahsana over 10 years ago

Hello
I am using 7z020 board and I want to receive data from SPI
but the problem is in the /dev folder there is no SPIDEV file .
I did the following steps
In the XPS I design all the hardware , In this particular project I took a simplest case  in which I only add SPI and connected it with EMIO.

This is my constraint file

NET "processing_system7_0_SPI0_MOSI_O_pin" LOC = R19;
NET "processing_system7_0_SPI0_SCLK_I_pin" LOC = D18;
NET "processing_system7_0_SPI0_SS_O_pin" LOC = L21;

NET "processing_system7_0_SPI0_MOSI_O_pin" IOSTANDARD = LVCMOS25;
NET "processing_system7_0_SPI0_SCLK_I_pin" IOSTANDARD = LVCMOS25;
NET "processing_system7_0_SPI0_SS_O_pin" IOSTANDARD = LVCMOS25;

After this step I generate the .bit file and then I made boot file.

after booting the board  problem starts when I didn't find SPIDEV file  in the /dev folder . for this purpose I made devicetree for this particular project using SDK.
and add the following lines
spidev@0{
tcompatible="spidev";
treg =<0>; //chipselect 0
tspi-max-frequency= <50000000>;
t};


and then convert it into .dtb file because it was in .dts.

then rebuild the kernal

when i am using these files the done LED is on but on serial terminal is blank. Blue LEd means my FPGA is programmed and I can see clock means hardware connection is done.

Now where  i am doing mistake can anyone guide me please
May be i am doing mistake here

1. When I rebuild the kernal I put devicetree.dts in the ./ar,/arch/boot/dts folder and .dtb in the ./arch/arm/boot . is it ok???
2.I didn't make my u-boot for this particular program

Can you give me ANY Suggestions
thanks
Sana

  • Sign in to reply
  • Cancel
Parents
  • zedhed
    0 zedhed over 10 years ago

    Hi Sana,

    Is this for a 7z020 ZedBoard or is it for 7z020 MicroZed, a 7z020 PicoZed target?

    If your serial terminal is blank after creating an entirely new devicetree, I would recommend starting with a known good devicetree and adding the SPI entries to that.

    There is some information for adding SPI support on this wiki page:

    http://www.wiki.xilinx.com/SPI+Zynq+driver

    Make sure you have the top level device entry for the SPI controller added to the devicetree.  If you are using SPI0 you would add the "spi: spi@e0006000" entry.

    Also take a look at this forum entry to make sure that the driver is being built into the kernel correctly.

    https://forums.xilinx.com/t5/Embedded-Linux/Spidev-issue-Spi-transfer-timeout/td-p/548153/page/2

    Regards,

    -Kevin

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • ashahsana
    0 ashahsana over 10 years ago in reply to zedhed

    Thanks Kevin for reply

    I am using 7z020 zedboard and
    As you suggested some links I already visited that and I am agree that the easiest way to enable SPIDEV is by editing the xilinx_zynq_defconfig file.

    I already enabled SPIDEV in xilinix_zynq_defconfig (and not use menuconfig command)

    CONFIG_SPI=y
    CONFIG_SPI_DEBUG=y
    CONFIG_SPI_MASTER=y
    CONFIG_SPI_SPIDEV=y

    then as you suggested i took the devicetree.dtb which is working and convert back to .dts . Then add the following commands in the devicetree.dts

    spi:spi@e0007000 {
    tttcompatible = "xlnx,ps7-spi-1.00.a";
    tttreg = <0xe0007000 0x1000>;
    tttxlnx,has-ss0 = <0x1>;
    tttxlnx,has-ss1 = <0x0>;
    tttxlnx,has-ss2 = <0x0>;
    ttt#address-cells = <1>;
    ttt#size-cells = <0>;
    tttdevice@0{
    ttttcompatible = "spidev";
    tttt#address-cells = <1>;
                 ttt#size-cells = <0>;
    ttttreg = <0x0>;
    ttttspi-max-frequency = <500000>;
    ttt};

    after that convert back to .dtb and then recompile the kernal.

    when I am using this kernal and this .dtb then the result is same means blank screen on serial terminal.

    so I used only this devicetree but not zImage then it works and boot properly although i cannot see /dev/spidev.
    this means some problem is in my kernal.

    For kernal, the git repository is
    git://git.xilinx.com/linux-xlnx.git

    but when I run this repository 

    Initialized empty Git repository in /home/training/linux-xlnx/linux-xlnx/.git/
    git.xilinx.com[0: 206.17.92.81]: errno=Connection refused
    fatal: unable to connect a socket (Connection refused)

    So I download this repository from the following link
    git://github.com/Xilinx/linux-xlnx

    Is it the problem?? and why I cannot download from  git://git.xilinx.com/linux-xlnx.git link
    thanks
    Sana



    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • ashahsana
    0 ashahsana over 10 years ago in reply to zedhed

    Thanks Kevin for reply

    I am using 7z020 zedboard and
    As you suggested some links I already visited that and I am agree that the easiest way to enable SPIDEV is by editing the xilinx_zynq_defconfig file.

    I already enabled SPIDEV in xilinix_zynq_defconfig (and not use menuconfig command)

    CONFIG_SPI=y
    CONFIG_SPI_DEBUG=y
    CONFIG_SPI_MASTER=y
    CONFIG_SPI_SPIDEV=y

    then as you suggested i took the devicetree.dtb which is working and convert back to .dts . Then add the following commands in the devicetree.dts

    spi:spi@e0007000 {
    tttcompatible = "xlnx,ps7-spi-1.00.a";
    tttreg = <0xe0007000 0x1000>;
    tttxlnx,has-ss0 = <0x1>;
    tttxlnx,has-ss1 = <0x0>;
    tttxlnx,has-ss2 = <0x0>;
    ttt#address-cells = <1>;
    ttt#size-cells = <0>;
    tttdevice@0{
    ttttcompatible = "spidev";
    tttt#address-cells = <1>;
                 ttt#size-cells = <0>;
    ttttreg = <0x0>;
    ttttspi-max-frequency = <500000>;
    ttt};

    after that convert back to .dtb and then recompile the kernal.

    when I am using this kernal and this .dtb then the result is same means blank screen on serial terminal.

    so I used only this devicetree but not zImage then it works and boot properly although i cannot see /dev/spidev.
    this means some problem is in my kernal.

    For kernal, the git repository is
    git://git.xilinx.com/linux-xlnx.git

    but when I run this repository 

    Initialized empty Git repository in /home/training/linux-xlnx/linux-xlnx/.git/
    git.xilinx.com[0: 206.17.92.81]: errno=Connection refused
    fatal: unable to connect a socket (Connection refused)

    So I download this repository from the following link
    git://github.com/Xilinx/linux-xlnx

    Is it the problem?? and why I cannot download from  git://git.xilinx.com/linux-xlnx.git link
    thanks
    Sana



    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
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 © 2026 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