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 SPI Support
  • 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 2 replies
  • Subscribers 329 subscribers
  • Views 285 views
  • Users 0 members are here
Related

SPI Support

cascade99
cascade99 over 9 years ago

Hi,
Our hardware design will need SPI driver connect AD7398 DAC, which is not supported by the kernel. Anyone knows how to add the driver to petalinux, and code example available?
I'm using Petalinux 2014.4.
Thanks

  • Sign in to reply
  • Cancel
  • Former Member
    0 Former Member over 9 years ago

    Hi Lynn,

      Nice timing, as I'm working on a reference design for this right now.  I haven't got it solved yet, but I can point you to some information that may be of assistance to move you forward.  Here is a post you may find useful for your DAC:

    http://forum.trenz-electronic.de/index.php?topic=382.0

    You don't mention if this is a Zynq or MicroBlaze design, or which board you are targeting.  

    Essentially, what you need to do is:

    1. Ensure the hardware design has the necessary connections for OS support.  You should test the hardware as well as you can using standalone code, and you will need to add a Shared Peripheral Interrupt (IRQ_F2P) that is required by the Linux driver.  You can find some good information on that here:

    http://www.xilinx.com/support/answers/58942.html

    2. You can use the SPI hardware in the PS or in the PL.  There have been enough reports of issues with PS SPI controllers in Zynq that I decided to go with the PL hardware.  I'm not saying PS won't work, but it seemed like PL may be an easier path. 

    3. The kernel must be configured to include the SPI drivers.  If you are using PL IP, this will happen automatically in the default PetaLinux configuration, when you create a project based off the HDF file exported from Vivado.  I'm not sure if the same is true for PS SPI or not - you may have to manually add it, but worth verifying.  Use menuconfig to search (/) for SPI and you will find the settings under Device Drivers.

    4. You must manually modify the device tree to include your SPI endpoint peripheral(s) and cause Linux to load the drivers at boot time.  This is a tricky part that I haven't gotten to work yet.   Although PetaLinux will generate the SPI bus entry, you must manually add the entries for the devices you are using.  There is some old but still useful information here that will give you some insight into the device tree parameters, and how they match up with the device driver entries as well:

    http://www.xilinx.com/support/answers/58942.html

    Let me know if you are successful.

    Ron

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • cascade99
    0 cascade99 over 9 years ago in reply to Former Member

    Thank you! Will let you know

    • 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