leeebo/cherryusb_esp32

0.0.2

uploaded 7 months ago
CherryUSB Port and Examples for ESP SoC with USB-OTG (S2/S3/C5/P4)

readme

# CherryUSB Component and Examples for ESP

[![Component Registry](https://components.espressif.com/components/leeebo/cherryusb_esp32/badge.svg)](https://components.espressif.com/components/leeebo/cherryusb_esp32) [![Build Status](https://github.com/leeebo/cherryusb_esp32/actions/workflows/build_examples.yml/badge.svg)](https://github.com/leeebo/cherryusb_esp32/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:
  leeebo/cherryusb_esp32: "*"
```

Or simply run:

```
idf.py add-dependency "leeebo/cherryusb_esp32"
```

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 "leeebo/cherryusb_esp32=*: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

# ChangeLog

## v0.0.3 - 2023-09-06

* Rename component name to `cherryusb_esp32` to keep consistency with upstream

## v0.0.2 - 2023-09-05

* Fix github build action

## v0.0.1 - 2023-09-04

* Initial release based on CherryUSB v0.10.1
* Examples:
    * Add `device/cherryusb_device_cdc` example

readme of device/cherryusb_device_cdc example

                                        
                                        # 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.

                                    

Links

License: Apache-2.0

To add this component to your project, run:

idf.py add-dependency "leeebo/cherryusb_esp32^0.0.2"

or download archive

Dependencies

  • espressif/cmake_utilities 0.*
  • ESP-IDF >=4.4.1
  • leeebo/cherryusb ~=0.10.1
  • Examples:

    device/cherryusb_device_cdc

    more details

    To create a project from this example, run:

    idf.py create-project-from-example "leeebo/cherryusb_esp32^0.0.2:device/cherryusb_device_cdc"

    or download archive

    Stats

    • Downloaded in total
      Downloaded in total 35 times
    • Downloaded this version
      This version: 35 times

    Badge

    leeebo/cherryusb_esp32 version: 0.0.2
    |