ESPUSB – An USB Software Stack For ESP8266

ESPUSB – An USB Software Stack For ESP8266

ESP8266EX and even the new ESP32 SoC lack a USB hardware transceiver, so [CNLohr] decided to develop a USB software stack for ESP8266. After a quick search, I think it is the first try to do a USB software stack for esp8266. USB software stack is a firmware-only implementation of a USB. ESPUSB works in a similar way of V-USB for AVR MCUs.

This USB Stack uses D- on GPIO 4 and D+ on GPIO 5 and only operates with low-speed USB. To run ESPUSB on ESP8266 it will need about 317 byte of SRAM and 1422 byte from flash/IRAM.

USB Enumeration Using ESPUSB – Images courtesy of cnlohr
[CNLohr] said that he could flash ESP8266 using the ESPUSB.

Flashing ESP8266 Using ESPUSB - Images courtesy of cnlohr
Flashing ESP8266 Using ESPUSB – Images courtesy of cnlohr
[CNLohr] described in a video the code of ESPUSB and how he developed it.

A forum for discussion for ESPUSB was created in ESP8266 website.
You can reach the source code of ESPUSB project on the GitHub repository.

Via: cnx-software

UPDATE(2/8/2016): [CNLohr] published a tweet, containing a photo of a PCB module for ESPUSB, it’s a small stick that can be plugged into USB directly. It uses ESP8285 SoC, same as ESP8266EX one but with built-in flash memory.


He also uploaded a video on Youtube showing the new PCB plugged into his laptop which is detected as HID mouse device using the ESPUSB USB software stack. He controls the mouse pointer over WiFi using an application from his phone.



Please follow and like us:
Pin Share

Embedded Hardware Engineer interested in open hardware and was born in the same year as Linux. Yahya is the editor-in-chief of Atadiat and believes in the importance of sharing free, practical, spam-free and high quality written content with others. His experience with Embedded Systems includes developing firmware with bare-metal C and Arduino, designing PCB&schematic and content creation.

view all posts by yahya
Notify of

1 Comment
Inline Feedbacks
View all comments
max chong

I did the same thing 4 -5 years ago the same way under PIC processor, started from a mouse and use digital analyzer and Microsoft packet analyzer and wrote string bit 1,2,1,2 and loop through the bit flipper how they actually show in the X,Y possible is really fun. But i have to said you really impress me that you really go all the way decoding the whole thing in deeper manner than i do. But I do admit this method is really straightforward and more easy to understand than how they but the USB document are. plus not necessary to have big foot print of code on those functions that we don’t want. like we only want HID only and which the other emulation is not required.

Get new posts by email:
Get new posts by email:

Join 97,426 other subscribers