-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Idea: Integrate ESP8266 USB Software Driver #2375
Comments
I intend to keep most of my posts in the espusb copy of the ticket -- but -- that said, I am very interested in facilitating this, but I don't have any expertise with Arduino, and I'm not really tooled to get into it... so I want to help any way I can, but someone else is going to have to run point on the Arduino side. I can then take requests on my side. |
I would like to take on integrating it. I have experience with usb |
What would be the general architecture you would propose? |
I still think control messages would probably be the way to go. When I say architecture - I mean would you put USB code somewhere that never gets overwritten? So, when it boots it immediately enumerates as USB, after a brief time, without any requests to re-flash, it continues booting the main code? Otherwise, it stays in the USB portion? P.S. I still intend to greatly simplify my low-speed implementation and shrink it, as well as further detaching it form the Espressif SDK so it could run stand-alone. |
You can enumerate different devices at about any time. Just pull D+ I think it was to GND and the host will reenumerate the device, so you can have one device in the bootloader which will wait some time for upload and then reenumerate as another device once it boots. One question: I saw a discussion about pin interrupts on the forum and wanted to ask how you are using the interrupt? Are you detecting just the first pulse that initiates communication or are you detecting every other pulse as well? |
I will likely be adding another layer to my code in the next few days. Currently, the code to handle descriptors, custom endpoints and control messages is in the same file as the mid-level USB stack (What handles the DATAx toggling, IN/OUT, etc.) Other than that, it shouldn't change too much. I've already reorganized the way endpoints works to be much cleaner than I first did. Only the first pulse. There's too much state to maintain between pulses and, interrupts on the ESP are SOOO SLOWW You don't even get into the handler till like the third bit! Once in the interrupt handler from the start of a message, I use "ccount" to track progress and advance 53 (or 54) cycles along for every bit. The discussion about interrupts stemmed from me wanting to make my devices enumerate as full-speed. I hope to start on this in earnest this weekend. Though after working through the numbers more, I am afraid full-speed will add too much IRAM/DRAM overhead to be practical. |
@me-no-dev Is there any progress on this? |
@cnlohr I took a look at your espusb repo, and your high speed adc in colorchord, and I think they are awesome. I expect to take a look at the high speed adc at some point, with a view of getting it to work with this repo. |
Yes, very possible, but until someone churns through it.... OOORRRRR espressif grants access to GPIO via the system registers on future silicon revisions, it'll be stuck in low speed :-/ |
https://github.com/cnlohr/espusb is a software USB stack running on the ESP8266/ESP8285. It requires only one external resistor. As is shown on http://www.esp8266.com/viewtopic.php?f=6&t=11188#p52430 it can already be used to flash the ESP8266.
I hope it can be nicely integrated nicely into esp8266/Arduino (e.g., to do the uploading and "serial" monitor using just the ESP and no serial adapter).
I also cross-posted this at cnlohr/espusb#1
The text was updated successfully, but these errors were encountered: