Giter Site home page Giter Site logo

esp32de / espusb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cnlohr/espusb

2.0 2.0 0.0 284 KB

Software-only ESP8266 USB Device

License: Other

Makefile 0.28% C 23.96% KiCad Layout 55.57% Perl 0.77% Assembly 5.17% Objective-C 0.41% HTML 1.61% JavaScript 12.22%

espusb's Introduction

#ESP8266 USB Software Driver

WARNING: THIS PROJECT IS A WORK IN PROGRESS. DO NOT EXPECT IT TO WORK WELL.

Forum for discussion of development: http://www.esp8266.com/espusb

I wanted to have USB on the ESP8266, and a while ago I saw on the ESP32 flier, it read: "Rich Peripherals" ... "Sorry, no USB!" I thought to myself, that is ridiculous. Of course there's USB.

So, it was born. This is a software USB stack running on the ESP8266/ESP8285. It requires only one external resistor, between D- and 3.3V.

Currently, the chip expects D- on GPIO 4 and D+ on GPIO 5 - but any GPIO pair may be used. It is important to note that both D- and D+ MUST be adjacent.

Additionally, this only operates with low-speed USB (1.5 MBit/s), ideal for making peripherals, not for fake networkand devices usb-serial bridges. That said - you can still write "control" messages that communicate with the ESP8266. Control messages are a great way to encapsulate your data since they handle all the framing and describing what function you wish to pass data for.

More info hopefully coming soon.

Hardware

Schematic

NOTE: GPIO12/14 do not need to be connected to ground. GPIO15 may be connected via a pull-down resistor. For stability, a pull-up on GPIO2 is recommended.

Also, checkout the hardware/ folder. It has kicad designs for my tiny board. Though they are for the ESP8285, the same pin configuration may be used to run on the ESP8266.

Memory Usage

This is typical memory usage for a two-endpoint (in addition to EP0) device.

In summary:

Total SRAM: 232 bytes + Descriptors (~317 bytes)

Total Flash/IRAM (Only iram, tables and usb_init can be stuck in slow flash): 1422 bytes

More details:

SRAM:

0000007c D usb_ramtable
0000006c B usb_internal_state

IRAM:

You must write: usb_handle_custom_control - the demos here hook it up to the command engine which allows self flashing on 1MB+ parts.

C functions:

0000002a T usb_pid_handle_ack
0000014f T usb_pid_handle_data
00000022 T usb_pid_handle_out
000000e9 T usb_pid_handle_in
00000002 T usb_pid_handle_sof
00000039 T usb_pid_handle_setup

From/To (in ASM):

40100f20 t usb_asm_start
401011ef t usb_asm_end
Total length of ASM: 2cf

espusb's People

Contributors

cnlohr avatar mateon1 avatar

Stargazers

Floatyboy avatar  avatar

Watchers

James Cloos avatar rudi ;-) avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.