0.0.1
# CherryUSB Component and Examples for ESP [![Component Registry](https://components.espressif.com/components/udoudou/esp_cherryusb/badge.svg)](https://components.espressif.com/components/udoudou/esp_cherryusb) [![Build Status](https://github.com/udoudou/esp_cherryusb/actions/workflows/build_examples.yml/badge.svg)](https://github.com/udoudou/esp_cherryusb/actions/workflows/build_examples.yml) This is the component and examples repository for the [CherryUSB](https://github.com/cherry-embedded/CherryUSB), which is a tiny and portable USB Stack (device & host) for embedded system with USB IP. This repository is wrapped as an ESP-IDF component and finally published to [Component Registry](https://components.espressif.com/). You can build the examples in this repository with **ESP-IDF v4.4.1 or later** directly. Or using the ESP-IDF component manager. ## How to add this component from esp-registry to your project Just add ``idf_component.yml`` to your main component with the following content:: ```yaml ## IDF Component Manager Manifest File dependencies: udoudou/esp_cherryusb: "*" ``` Or simply run: ``` idf.py add-dependency "udoudou/esp_cherryusb" ``` During the build process, the ESP-IDF build system will automatically download and install this component. ## How to download examples from esp-registry Please use the component manager command `create-project-from-example` to create the project from example template ``` idf.py create-project-from-example "udoudou/esp_cherryusb=*:cherryusb_device_cdc" ``` ## How to build the examples Please refer to the [examples/README.md](./examples/README.md) ## API Documentation 1. Library introduction can be found on [README](https://github.com/cherry-embedded/CherryUSB/blob/master/README.md) from the upstream CherryUSB. 2. Full API code documentations and step by step guides can be found in [CherryUSB Docs Website](https://cherryusb.readthedocs.io/).
# ChangeLog ## v0.0.1 - 2024-01-05 * Initial release based on cherryusb_esp32 * Update CherryUSB
# CherryUSB Device CDC Example Starts a CDC Device, and sends back any received data from the host. (See the [README.md](../../README.md) file in the upper level 'examples' directory for more information about examples.) ## How to use example Follow detailed instructions provided specifically for this example. Select the instructions depending on Espressif chip installed on your development board: - [ESP32-S2 Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/get-started/index.html) - [ESP32-S3 Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/get-started/index.html) Building an example is the same as building any other project: - Run `idf.py set-target TARGET` to select the correct chip target to build before opening the project configuration menu. By default the target is `esp32`. For all options see `idf.py set-target --help` - Run `idf.py menuconfig` to open the project configuration menu. Most examples have a project-specific "Example Configuration" section here (for example, to set the WiFi SSID & password to use). - `idf.py build` to build the example. - Follow the printed instructions to flash, or run `idf.py -p PORT flash`. ## Example output When running, the example will print the following output: ``` I (0) cpu_start: Starting scheduler on APP CPU. [I/USB] ========== dwc2 udc params ========== [I/USB] CID:00000000 [I/USB] GSNPSID:4f54400a [I/USB] GHWCFG1:00000000 [I/USB] GHWCFG2:224dd930 [I/USB] GHWCFG3:00c804b5 [I/USB] GHWCFG4:d3f0a030 [I/USB] dwc2 fsphy type:1, hsphy type:0, dma support:2 [I/USB] dwc2 has 7 endpoints, default config: 4 endpoints [I/USB] ================================= I (387) device_cdc_main: usb cdc acm init done [W/USB] Ignore DQD in fs [I/USB] Open ep:0x83 type:3 mps:8 [I/USB] Open ep:0x02 type:2 mps:64 [I/USB] Open ep:0x81 type:2 mps:64 [I/USB] intf:0, dtr:0 [I/USB] intf:0, rts:0 [I/USB] intf:0, dtr:0 [I/USB] intf:0, rts:0 [I/USB] intf:0, dtr:0 [I/USB] intf:0, rts:0 [I/USB] intf:0, dtr:0 [I/USB] intf:0, rts:0 actual out len:6 actual in len:6 actual out len:6 actual in len:6 ``` ## Technical support and feedback Please use the following feedback channels: * For technical queries, go to the [esp32.com](https://esp32.com/) forum * For a feature request or bug report, create a [GitHub issue](https://github.com/espressif/esp-idf/issues) We will get back to you as soon as possible.
idf.py add-dependency "udoudou/esp_cherryusb^0.0.1"
To create a project from this example, run:
idf.py create-project-from-example "udoudou/esp_cherryusb^0.0.1:device/cherryusb_device_cdc"