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
  • 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
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum libusb and OpenOCD?
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 9 replies
  • Answers 1 answer
  • Subscribers 674 subscribers
  • Views 2022 views
  • Users 0 members are here
  • raspberry_pi
Related

libusb and OpenOCD?

johnbeetem
johnbeetem over 12 years ago

I have a some questions about libusb and OpenOCD.  There might be a better group to ask about these, but a number of people who comment in this group know about these sorts of things.  Besides, I will want to run this stuff on RasPi so it applies.

 

Basically, I'm interested in learning to do low-level USB programming for talking to external USB devices.  I don't want to write a device driver -- I want to do everything from Userland.  From what I've read, libusb appears to be the right software for this, but it's confusing.  Before I get started, I'd like to learn from others' experience.  Here are some specific questions:

 

1.  There are several versions of libusb out there, and it appears to have an interesting FLOSS history.  There's libusb-0.1 which is old, but stable.  There's libusb-1.0 which has a different API, but it's actively being developed.  Then there's libusbx which is a fork of libusb-1.0, but it may have rejoined since libusb.org today lists libusbx-1.0.16 (2013-07-11) as the latest version.  Has anyone here developed with any of version of libusb and has some tips to share?  Also, does anyone here know about libusb history?

 

2.  Is there any better libusb documentation that what's available at libusb.org?  Google found me this this tutorial from Jan 2010, which seems to be a good start.  I'd appreciate any pointers.  There's no point doing "program by experiment" if someone has already done it and written it up.

 

I'm also interested in OpenOCD.  Has anyone here used it at the API level?  I took a quick look at the user guide and the developer documentation, and from a first impression it seems overly complex.  I need to decide if it's worth delving into OpenOCD or whether I'm better off building on my own JTAG code already written.

 

Thank you for any comments you may have.

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

    John Beetem wrote:

     

    I have a some questions about libusb and OpenOCD.  There might be a better group to ask about these, but a number of people who comment in this group know about these sorts of things.  Besides, I will want to run this stuff on RasPi so it applies.

    I can see no reason why libusb won't work on the Pi, but haven't specifically tried myself. Not sure if the combination of OOCD on a low powered Pi with known usb problems would fill me with confidence though.

    I don't want to write a device driver -- I want to do everything from Userland.

    You mean you want to write a userspace device driver image

    1.  There are several versions of libusb out there, and it appears to have an interesting FLOSS history.  There's libusb-0.1 which is old, but stable.  There's libusb-1.0 which has a different API, but it's actively being developed.  Then there's libusbx which is a fork of libusb-1.0, but it may have rejoined since libusb.org today lists libusbx-1.0.16 (2013-07-11) as the latest version.  Has anyone here developed with any of version of libusb and has some tips to share?  Also, does anyone here know about libusb history?

    currently I'd chose libusbx-1.0, there's a compatability layer as a separate package for anything that needs libusb-0.1.

     

    for various obvious reasons, you can't have both libusb and libusbx installed in parallel, libusbx is trying to be a drop-in replacement and as such uses exactly the same soname, so you have to make a choice.

    As usual with forks, the background is political, so some research on the history is probably a good idea before making a choice.

    libusbx.org is at 1.0.17, so I'm not sure what libusb.org having 1.0.16 shows.

    Looking at the source repo on libusb.org shows the last change here http://libusb.org/changeset/7634714aa696175b08016b6f2185a75a2f55a113/libusb/ which was a year ago and their repo has a last tag of 1.0.9 - I think this 'no progress' was a large part of the reason for the libusbx fork.

     

    A little mailing list search reveals this:

    http://marc.info/?l=libusb-devel&m=137088260618024&w=2

    so reading between the lines, the original libusb is dead and libusbx is the new libusb. In my mind, this is a good thing, especially as the github direction they seem to want to take is far better than the existing Trac (no, I'm not a great fan of github either, but it mostly works and git trees are easy to clone from there).

    2.  Is there any better libusb documentation that what's available at libusb.org?  Google found me this this tutorial from Jan 2010, which seems to be a good start.  I'd appreciate any pointers.  There's no point doing "program by experiment" if someone has already done it and written it up.

     

    I'd probably try http://libusbx.sourceforge.net/api-1.0/index.html not sure how good it is, but it has to be better than the older stuff.

    Most of what I've done has been with libftdi, so a lot of what little I've learned has been from looking at how libftdi uses libusb, nothing like a working example image.  I've also found it fairly easy to move this sort of code between linux and windows.

     

    I'm also interested in OpenOCD.  Has anyone here used it at the API level?

    Not yet, I've still not finished my OOCDLink-h based design as I haven't really found a need so far.

     

    Certainly have a read at the discussion in the blog post shabaz linked to as well

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • Former Member
    0 Former Member over 12 years ago

    John Beetem wrote:

     

    I have a some questions about libusb and OpenOCD.  There might be a better group to ask about these, but a number of people who comment in this group know about these sorts of things.  Besides, I will want to run this stuff on RasPi so it applies.

    I can see no reason why libusb won't work on the Pi, but haven't specifically tried myself. Not sure if the combination of OOCD on a low powered Pi with known usb problems would fill me with confidence though.

    I don't want to write a device driver -- I want to do everything from Userland.

    You mean you want to write a userspace device driver image

    1.  There are several versions of libusb out there, and it appears to have an interesting FLOSS history.  There's libusb-0.1 which is old, but stable.  There's libusb-1.0 which has a different API, but it's actively being developed.  Then there's libusbx which is a fork of libusb-1.0, but it may have rejoined since libusb.org today lists libusbx-1.0.16 (2013-07-11) as the latest version.  Has anyone here developed with any of version of libusb and has some tips to share?  Also, does anyone here know about libusb history?

    currently I'd chose libusbx-1.0, there's a compatability layer as a separate package for anything that needs libusb-0.1.

     

    for various obvious reasons, you can't have both libusb and libusbx installed in parallel, libusbx is trying to be a drop-in replacement and as such uses exactly the same soname, so you have to make a choice.

    As usual with forks, the background is political, so some research on the history is probably a good idea before making a choice.

    libusbx.org is at 1.0.17, so I'm not sure what libusb.org having 1.0.16 shows.

    Looking at the source repo on libusb.org shows the last change here http://libusb.org/changeset/7634714aa696175b08016b6f2185a75a2f55a113/libusb/ which was a year ago and their repo has a last tag of 1.0.9 - I think this 'no progress' was a large part of the reason for the libusbx fork.

     

    A little mailing list search reveals this:

    http://marc.info/?l=libusb-devel&m=137088260618024&w=2

    so reading between the lines, the original libusb is dead and libusbx is the new libusb. In my mind, this is a good thing, especially as the github direction they seem to want to take is far better than the existing Trac (no, I'm not a great fan of github either, but it mostly works and git trees are easy to clone from there).

    2.  Is there any better libusb documentation that what's available at libusb.org?  Google found me this this tutorial from Jan 2010, which seems to be a good start.  I'd appreciate any pointers.  There's no point doing "program by experiment" if someone has already done it and written it up.

     

    I'd probably try http://libusbx.sourceforge.net/api-1.0/index.html not sure how good it is, but it has to be better than the older stuff.

    Most of what I've done has been with libftdi, so a lot of what little I've learned has been from looking at how libftdi uses libusb, nothing like a working example image.  I've also found it fairly easy to move this sort of code between linux and windows.

     

    I'm also interested in OpenOCD.  Has anyone here used it at the API level?

    Not yet, I've still not finished my OOCDLink-h based design as I haven't really found a need so far.

     

    Certainly have a read at the discussion in the blog post shabaz linked to as well

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject 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