element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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 Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Software Application Development Petalinux SPI driver running but not connecting
  • 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 6 replies
  • Subscribers 332 subscribers
  • Views 2868 views
  • Users 0 members are here
Related

Petalinux SPI driver running but not connecting

cuevas1208
cuevas1208 over 8 years ago

I am having issues with my Petalinux SPI driver.

I have successfully tested on Xilinx SDK by using one of their spi templates and it worked just fine, but when I tried to set it up on Petalinux the programs runs but it can not connect.  It looks like Petalinux can not connect to the FPGA, what can I do to get it working?

This what I get after running the code:

root@pz-7020-2016-2:/bin# ./spidev_test -D /dev/spidev32766.0 --speed 10000000
spi mode: 0x0
bits per word: 8
max speed: 10000000 Hz (10000 KHz)
spidev spi32766.0: SPI transfer timed out
can't send spi message: Connection timed out
Aborted

I using PetalinuxTools16.2, and Vivado 16.2. 

Click here to see my dts files, and my spidev_test.c.

Block diagram:

 

Fullscreen contentimage_80103.html Download
<html><head><title>Jive SBS</title></head>
<body><font face="arial,helvetica,sans-serif">
<b>Error</b><br><font size="-1">
An general error occurred while processing your request.
</font></font></body></html>

Here are the steps I have done to set the SPI driver:

  1.  

    I created a project:

     
        
    1.    

      petalinux-create --type project --template zynq --name petalinux_pz_7020 --source pz_7020_2016_2.bsp

        
    2.  
  2.  

    I import my hardware:

     
        
    1.    

      petalinux-config --get-hw-description vivado_Project/vivado_pz_7020.sdk --project petalinux_pz_7020

        
    2.  
  3.  

    Created an app

     
        
    1.    

      petalinux-create -t apps --name spidev --template c

        
    2.  
  4.  

    I replace the content of the app spidev.c for the spidev_test.c attached to this email.

  5.  

    Enable SPI support for your kernel:

     
        
    1.    

      Navigate to Device Drivers->SPI support and make sure that Cadence SPI controller, Xilinx SPI controller command module, Xilinx Zynq QSPI controller, and User mode SPI device driver support are all enabled.

        
    2.  
  6.  

    Enabled the new app

     
        
    1.    

      $ petalinux-config -c rootfs  

        
    2.   
    3.    

      Apps->spidev (Press Y to select the application)

        
    4.  
  7.  

    Build petalinux image

     
        
    1.    

      petalinux-build

        
    2.  
  8.  

    Package the distribution

     
        
    1.    

      petalinux-package  --boot --fsbl images/linux/zynq_fsbl.elf --fpga ../vivado_Project/impl_1/blockDesign_wrapper.bit --uboot --kernel --force

        
    2.  
  9.  

    Update Firmware

     
        
    1.    

      run netboot  

        
    2.  

Note:

In my petalinux project under /dev ia can see spidev32766.0, and under /bin I can see spidev

  • Sign in to reply
  • Cancel
Parents
  • jafoste4
    0 jafoste4 over 7 years ago

    Hello,

    Please ask this question over at Xilinx as it appears to be an issue related to Petalinux.

    Thanks,

    Josh

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • jafoste4
    0 jafoste4 over 7 years ago

    Hello,

    Please ask this question over at Xilinx as it appears to be an issue related to Petalinux.

    Thanks,

    Josh

    • 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 © 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