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
FPGA
  • Technologies
  • More
FPGA
Forum Setting up CAN interface for Xilinx ZCU102
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join FPGA to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 9 replies
  • Subscribers 549 subscribers
  • Views 1219 views
  • Users 0 members are here
  • xilinx
  • can
Related

Setting up CAN interface for Xilinx ZCU102

bugtech
bugtech 8 months ago

I am working on zcu102 ultrascale board. I want to use CAN interface to send and receive data, Is there any guide or tutorial to setup this connection?

Are there any drivers needed to be installed separately? (CAN4Linux or SocketCAN)

On loopback mode i am able to see the data that i send, cansend can0 123#1234 (from here i imagine that CAN drivers are working)

But in normal mode, i dont receive anything.

Also i dont receive anything on oscilloscope.

Any leads?

  • Sign in to reply
  • Cancel
  • michaelkellett
    0 michaelkellett 8 months ago

    CAN won't transmit anything if there isn't anything to receive the messages.

    Can you post a sketch of your test setup.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • bugtech
    0 bugtech 8 months ago in reply to michaelkellett

    So,

    1: a HOST pc (ubuntu)

    2: Waveshare USB CAN to PC adapter (Tested, Working)

    3: Xilinx ZCU102 ultrascale board

    USB CAN is connected to the Host PC, Other side PINs (CAN_L CAN_H and GND) are connected to zcu102 board on J98.

    Also, Petalinux 2022.2 built with CAN enabled.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • bugtech
    0 bugtech 8 months ago in reply to michaelkellett

    Hi michaelkellett Do you have any leads on this?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • michaelkellett
    0 michaelkellett 8 months ago in reply to bugtech

    You need to provide more info,

    Tell us how the Waveshare is set up. If it has its own software then use that rather than your own Python script. I've not used a Waveshare but CAN adapters often come with some basic software that allows you to set things up, tx/rx basic messages and gives diagnostics.

    connect a scope channel to each of CAN_H, CAN_L and show us what you see.

    CAN uses several different hardware standards and buses need to be terminated and biased correctly.

    If you have access to a working CAN device that will talk to the Waveshare that will prove that you are driving it correctly.

    MK

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • bugtech
    0 bugtech 8 months ago in reply to michaelkellett

    I have tested both, software of waveshare as well as SocketCAN script using. I can see transmitted data on the oscilloscope.
    The problem is, when i do the same from the board. I dont see anything on the oscilloscope.

    e.g. I send data using (cansend can0 123#1234) from the board. I dont receive on the host using (candump can0). Also when i send from host, i dont receive anything on the board.

    While in the loopback operation (on both) i receive data. Which assures me that drivers are fine.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • michaelkellett
    0 michaelkellett 8 months ago in reply to bugtech

    Usually you need to set up CAN to receive and acknowledge messages. If you don't then the bus will stall very quickly.

    Loopbacks are deceiving in that they don't test the hardware connection.

    MK

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • bugtech
    0 bugtech 8 months ago in reply to michaelkellett

    Actually thats what i was looking for at the beginning, any guide or tutorial in which it describes how to set up CAN for this specific board. Documentation provided by Xilinx do not contain any information on how to set up CAN.

    I am new to CAN interface. Lacking even the basic knowledge here. Just wanted to perform a small test to check if i am possible to maintain data through CAN.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • michaelkellett
    0 michaelkellett 8 months ago in reply to bugtech

    You have my sympathy.

    I've never done CAN with an FPGA but always with microprocessors.

    Your best bet with X is to find an example.

    I found this which was promising:

    https://adaptivesupport.amd.com/s/question/0D54U00006ao0dESAQ/what-is-the-proper-way-to-calculate-the-can-bus-bittiming-values-for-the-zcu102?language=en_US

    Until I saw that AMD never answered !

    But the question may help you a little.

    But if your CAN tool never sends to the board at all that looks like a hardware set up thing.

    You can see from the question above that the PCAN tools help with some diagnostics  - I've spent quite  a bit of time looking at the BUS-HEAVY message !

    In order to learn enough about CAN you may need to play with some kind of micro based CAN boards.

    Your board does have jumpers for CAN termination - it would be worth checking for documentation on them.

    MK

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • bugtech
    0 bugtech 8 months ago in reply to michaelkellett

    Thank you michaelkellett 

    I will follow this and will see if i get something.

    • 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