Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to study the USB stack #31

Open
fvsr opened this issue Mar 11, 2018 · 2 comments
Open

How to study the USB stack #31

fvsr opened this issue Mar 11, 2018 · 2 comments

Comments

@fvsr
Copy link

fvsr commented Mar 11, 2018

I would like to dig deeper in the Arcore code, so would you give me any sugestion from wich files should I begin my study? We have the following path: "arcore-master/hardware/avr/cores/arcore", where there are 40 files. All of them are sheets or parts of the Arcore code? And how about the folder "libraries"? Would there be an order to best study and understand all those files, in order to better understand USB over MIDI? Thanks.

@rkistner
Copy link
Owner

The USB code specific to MIDI (this project) is in these two new files:

https://github.com/rkistner/arcore/blob/master/hardware/avr/cores/arcore/MIDIUSB.cpp
https://github.com/rkistner/arcore/blob/master/hardware/avr/cores/arcore/MIDIUSB.h

As well as changes in these files:

https://github.com/rkistner/arcore/blob/master/hardware/avr/cores/arcore/USBAPI.h
https://github.com/rkistner/arcore/blob/master/hardware/avr/cores/arcore/USBDesc.h
https://github.com/rkistner/arcore/blob/master/hardware/avr/cores/arcore/USBCore.cpp
https://github.com/rkistner/arcore/blob/master/hardware/avr/cores/arcore/USBCore.h

Nothing is implemented as a library.

You can see all the changes here:
05fb792...master

This project is a fork of a very old version of the core Arduino firmware. Apparently newer versions allow "pluggable" USB libraries, that don't require modifying the core firmware like this. There may even be an existing USB-MIDI library for it.

In this project the USB implementation is based on the serial-over-USB implementation of the core firmware, since it functionally works in a very similar way. The most significant differences are that messages are 4 bytes each (instead of a stream of single bytes), and the USB descriptors are way more complicated. I also have to admit that my knowledge of USB development is very limited, so the code in this project may not be the best examples to learn from.

If you want to study the USB stack I also suggest that you familiarise yourself with all the tools available, and I strongly suggest using either Linux or OSX (not Windows):
https://github.com/rkistner/arcore/blob/master/USB-dev-notes.md

@fvsr
Copy link
Author

fvsr commented Mar 12, 2018

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants