-
Notifications
You must be signed in to change notification settings - Fork 38
Prepare release/v0.19 branch #60
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| #!/usr/bin/env python | ||
| # | ||
| # SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| import sys | ||
| import argparse | ||
| import yaml | ||
| from pathlib import Path | ||
| from glob import glob | ||
| from idf_component_tools.manager import ManifestManager | ||
|
|
||
|
|
||
| def override_with_local_component(component, local_path, app): | ||
| app_path = Path(app) | ||
|
|
||
| absolute_local_path = Path(local_path).absolute() | ||
| if not absolute_local_path.exists(): | ||
| print('[Error] {} path does not exist'.format(local_path)) | ||
| raise Exception | ||
| if not app_path.exists(): | ||
| print('[Error] {} path does not exist'.format(app_path)) | ||
| raise Exception | ||
|
|
||
| print('[Info] Processing app {}'.format(app)) | ||
| manager = ManifestManager(app_path / 'main', 'app') | ||
| if '/' not in component: | ||
| # Prepend with default namespace | ||
| component = 'espressif/' + component | ||
|
|
||
| try: | ||
| manifest_tree = yaml.safe_load(Path(manager.path).read_text()) | ||
| manifest_tree['dependencies'][component] = { | ||
| 'version': '*', | ||
| 'override_path': str(absolute_local_path) | ||
| } | ||
| with open(manager.path, 'w') as f: | ||
| yaml.dump(manifest_tree, f, allow_unicode=True, Dumper=yaml.SafeDumper) | ||
| except KeyError: | ||
| print('[Error] {} app does not depend on {}'.format(app, component)) | ||
| raise KeyError | ||
|
|
||
| def override_with_local_component_all(component, local_path, apps): | ||
| # Process wildcard, e.g. "app_prefix_*" | ||
| apps_with_glob = list() | ||
| for app in apps: | ||
| apps_with_glob += glob(app) | ||
|
|
||
| # Go through all collected apps | ||
| for app in apps_with_glob: | ||
| try: | ||
| override_with_local_component(component, local_path, app) | ||
| except: | ||
| print("[Error] Could not process app {}".format(app)) | ||
| return -1 | ||
| return 0 | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| parser = argparse.ArgumentParser() | ||
| parser.add_argument('component', help='Existing component that the app depends on') | ||
| parser.add_argument('local_path', help='Path to component that will be used instead of the managed version') | ||
| parser.add_argument('apps', nargs='*', help='List of apps to process') | ||
| args = parser.parse_args() | ||
| sys.exit(override_with_local_component_all(args.component, args.local_path, args.apps)) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| name: ESP-USB Test Apps | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, reopened, synchronize] | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build | ||
| strategy: | ||
| matrix: | ||
| idf_ver: ["release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4", "release-v5.5", "latest"] | ||
| runs-on: ubuntu-latest | ||
| container: espressif/idf:${{ matrix.idf_ver }} | ||
| env: | ||
| ESP_USB_MANIFEST: ./esp-usb/.build-test-rules.yml | ||
| ESP_TINYUSB_TEST_APPS: ./esp-usb/device/esp_tinyusb/test_apps | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: 'true' | ||
| - name: Clone esp-usb repository | ||
| run: | | ||
| git clone https://github.com/espressif/esp-usb.git | ||
| - name: Build | ||
| shell: bash | ||
| run: | | ||
| . ${IDF_PATH}/export.sh | ||
| pip install --no-cache-dir idf-component-manager>=2.1.2 idf-build-apps pyyaml --upgrade | ||
| export PEDANTIC_FLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function" | ||
| export EXTRA_CFLAGS="${PEDANTIC_FLAGS} -Wstrict-prototypes" | ||
| export EXTRA_CXXFLAGS="${PEDANTIC_FLAGS}" | ||
| python .github/ci/override_managed_component.py tinyusb . ${{ env.ESP_TINYUSB_TEST_APPS }}/*/ | ||
| idf-build-apps find --path ${{ env.ESP_TINYUSB_TEST_APPS }}/ --recursive --target esp32s2 --manifest-file ${{ env.ESP_USB_MANIFEST }} | ||
| idf-build-apps build --path ${{ env.ESP_TINYUSB_TEST_APPS }}/ --recursive --target esp32s2 --manifest-file ${{ env.ESP_USB_MANIFEST }} | ||
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: usb_test_app_bin_${{ matrix.idf_ver }} | ||
| path: | | ||
| ${{env.ESP_TINYUSB_TEST_APPS}}/**/build/bootloader/bootloader.bin | ||
| ${{env.ESP_TINYUSB_TEST_APPS}}/**/build/partition_table/partition-table.bin | ||
| ${{env.ESP_TINYUSB_TEST_APPS}}/**/build/test_app_*.bin | ||
| ${{env.ESP_TINYUSB_TEST_APPS}}/**/build/test_app_*.elf | ||
| ${{env.ESP_TINYUSB_TEST_APPS}}/**/build/flasher_args.json | ||
| ${{env.ESP_TINYUSB_TEST_APPS}}/**/build/config/sdkconfig.json | ||
| if-no-files-found: error | ||
|
|
||
| run-target: | ||
| name: Run | ||
| if: ${{ github.repository_owner == 'espressif' }} | ||
| needs: build | ||
| strategy: | ||
| matrix: | ||
| idf_ver: ["release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4", "release-v5.5", "latest"] | ||
| idf_target: ["esp32s2"] | ||
| runner_tag: ["usb_device"] | ||
| runs-on: [self-hosted, linux, docker, "${{ matrix.idf_target }}", "${{ matrix.runner_tag }}"] | ||
| container: | ||
| image: python:3.11-bookworm | ||
| options: --privileged --device-cgroup-rule="c 188:* rmw" --device-cgroup-rule="c 166:* rmw" | ||
| env: | ||
| ESP_TINYUSB_TEST_APPS: ./esp-usb/device/esp_tinyusb/test_apps | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Clone esp-usb repository | ||
| run: | | ||
| git clone https://github.com/espressif/esp-usb.git | ||
| - name: ⚙️ Install System tools | ||
| run: | | ||
| apt update | ||
| apt install -y usbutils | ||
| - name: Install Python packages | ||
| env: | ||
| PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/" | ||
| run: pip install --only-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-idf pyserial pyusb | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: usb_test_app_bin_${{ matrix.idf_ver }} | ||
| path: ${{env.ESP_TINYUSB_TEST_APPS}} | ||
| - name: Run USB Test App on target | ||
| run: pytest ${{env.ESP_TINYUSB_TEST_APPS}} --embedded-services esp,idf --target=${{ matrix.idf_target }} -m ${{ matrix.runner_tag }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| name: ESP-IDF USB Device examples | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, reopened, synchronize] | ||
|
|
||
| jobs: | ||
| build: | ||
| strategy: | ||
| matrix: | ||
| idf_ver: ["release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4", "release-v5.5", "latest"] | ||
| fail-fast: false | ||
tore-espressif marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| runs-on: ubuntu-latest | ||
| container: espressif/idf:${{ matrix.idf_ver }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install Python dependencies | ||
| shell: bash | ||
| run: | | ||
| . ${IDF_PATH}/export.sh | ||
| pip install --no-cache-dir idf-component-manager>=2.1.2 idf-build-apps pyyaml --upgrade | ||
| - name: Build Network USB related examples | ||
| shell: bash | ||
| run: | | ||
| . ${IDF_PATH}/export.sh | ||
| export EXAMPLES_PATH="${IDF_PATH}/examples/network/sta2eth" | ||
| export MANIFEST_FILE="${IDF_PATH}/examples/network/.build-test-rules.yml" | ||
roma-jam marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| idf-build-apps find --path ${EXAMPLES_PATH}/ --target esp32s2 --manifest-file ${MANIFEST_FILE} | ||
| idf-build-apps build --path ${EXAMPLES_PATH}/ --target esp32s2 --manifest-file ${MANIFEST_FILE} | ||
| - name: Build USB Device examples | ||
| shell: bash | ||
| run: | | ||
| . ${IDF_PATH}/export.sh | ||
| export EXAMPLES_PATH="${IDF_PATH}/examples/peripherals/usb/device" | ||
| export MANIFEST_FILE="${IDF_PATH}/examples/peripherals/.build-test-rules.yml" | ||
| python .github/ci/override_managed_component.py tinyusb . ${EXAMPLES_PATH}/tusb_* | ||
| idf-build-apps find --path ${EXAMPLES_PATH}/ --recursive --target esp32s2 --manifest-file ${MANIFEST_FILE} | ||
| idf-build-apps build --path ${EXAMPLES_PATH}/ --recursive --target esp32s2 --manifest-file ${MANIFEST_FILE} | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| # We upload only the USB Device example binaries to run them on the target | ||
| name: usb_device_tusb_apps_bin_${{ matrix.idf_ver }} | ||
| path: | | ||
| /opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/bootloader/bootloader.bin | ||
| /opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/partition_table/partition-table.bin | ||
| /opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/tusb_*.bin | ||
| /opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/tusb_*.elf | ||
| /opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/flasher_args.json | ||
| /opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/config/sdkconfig.json | ||
| if-no-files-found: error | ||
| run-target: | ||
| name: Run USB Device examples | ||
| if: ${{ github.repository_owner == 'espressif' }} | ||
| needs: build | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| idf_ver: ["release-v5.3", "release-v5.4", "release-v5.5" , "latest"] | ||
| idf_target: ["esp32s2"] | ||
| runner_tag: ["usb_device"] | ||
| runs-on: [self-hosted, linux, docker, "${{ matrix.idf_target }}", "${{ matrix.runner_tag }}"] | ||
| container: | ||
| image: espressif/idf:${{ matrix.idf_ver }} | ||
| options: --privileged --device-cgroup-rule="c 188:* rmw" --device-cgroup-rule="c 166:* rmw" | ||
| steps: | ||
| - name: ⚙️ Install System tools | ||
| run: | | ||
| apt update | ||
| apt install net-tools | ||
| - name: ⚙️ Install Python packages | ||
| env: | ||
| PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/" | ||
| run: | | ||
| cd ${IDF_PATH} | ||
| . ./export.sh | ||
| pip install --no-cache-dir --only-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-jtag pytest-embedded-idf pyserial pyusb python-gitlab minio idf-build-apps idf_ci pytest_ignore_test_results pytest-timeout netifaces | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: usb_device_tusb_apps_bin_${{ matrix.idf_ver }} | ||
| path: /opt/esp/idf/examples/peripherals/usb/device | ||
| - name: Run USB Test App on target | ||
| run: | | ||
| cd ${IDF_PATH} | ||
| . ./export.sh | ||
| export EXAMPLES_PATH="${IDF_PATH}/examples/peripherals/usb/device" | ||
| pytest ${EXAMPLES_PATH} --target ${{ matrix.idf_target }} -m ${{ matrix.runner_tag }} --ignore-result-cases=*ncm_example | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: ESP IoT Solution - USB Device Examples | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, reopened, synchronize] | ||
|
|
||
| jobs: | ||
| build: | ||
| strategy: | ||
| matrix: | ||
| idf_ver: ["release-v5.3", "release-v5.4", "release-v5.5", "latest"] | ||
| name: ["usb_uart_bridge"] | ||
| runs-on: ubuntu-latest | ||
| container: espressif/idf:${{ matrix.idf_ver }} | ||
| env: | ||
| ESP_IOT_PATH: esp-iot-solution | ||
| MANIFEST_PATH: esp-iot-solution/examples/.build-rules.yml | ||
| EXAMPLE_PATH: esp-iot-solution/examples/usb/device/${{ matrix.name }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: 'true' | ||
| - name: Clone esp-iot-solution repository | ||
| run: | | ||
| git clone https://github.com/espressif/esp-iot-solution.git | ||
| - name: Build | ||
| shell: bash | ||
| run: | | ||
| . ${IDF_PATH}/export.sh | ||
| pip install --no-cache-dir idf-component-manager>=2.1.2 idf-build-apps pyyaml --upgrade | ||
| python .github/ci/override_managed_component.py tinyusb . ${{ env.EXAMPLE_PATH }}/ | ||
| idf-build-apps find --paths ${{ env.EXAMPLE_PATH }} --target all --manifest-file ${{ env.MANIFEST_PATH }} --manifest-rootpath ${{ env.ESP_IOT_PATH }} | ||
| idf-build-apps build --paths ${{ env.EXAMPLE_PATH }} --target all --manifest-file ${{ env.MANIFEST_PATH }} --manifest-rootpath ${{ env.ESP_IOT_PATH }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| name: Push TinyUSB to Espressif Component Service | ||
|
|
||
| # If the commit is tagged, it will be uploaded. Other scenario silently fail. | ||
| on: | ||
| push: | ||
| tags: | ||
| - v* | ||
|
|
||
| jobs: | ||
| upload_components: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Upload components to component service | ||
| uses: espressif/upload-components-ci-action@v2 | ||
| with: | ||
| components: "tinyusb: ." | ||
| version: ${{ github.ref_name }} | ||
| namespace: "espressif" | ||
| api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| idf_build_get_property(target IDF_TARGET) | ||
|
|
||
| if(${target} STREQUAL "esp32s3") | ||
| set(tusb_mcu "OPT_MCU_ESP32S3") | ||
| set(tusb_family "esp32sx") | ||
| elseif(${target} STREQUAL "esp32s2") | ||
| set(tusb_mcu "OPT_MCU_ESP32S2") | ||
| set(tusb_family "esp32sx") | ||
| elseif(${target} STREQUAL "esp32p4") | ||
| set(tusb_mcu "OPT_MCU_ESP32P4") | ||
| set(tusb_family "esp32px") | ||
| elseif(${target} STREQUAL "esp32h4") | ||
| set(tusb_mcu "OPT_MCU_ESP32H4") | ||
| set(tusb_family "esp32sx") | ||
| endif() | ||
|
|
||
| set(compile_options | ||
| "-DCFG_TUSB_MCU=${tusb_mcu}" | ||
| ) | ||
|
|
||
| idf_component_get_property(freertos_include freertos ORIG_INCLUDE_PATH) | ||
|
|
||
| set(includes_private | ||
| "src/" | ||
| "src/device" | ||
| "lib/networking" # For RNDIS definitions | ||
| ) | ||
|
|
||
| set(includes_public | ||
| "src/" | ||
| # The FreeRTOS API include convention in tinyusb is different from esp-idf | ||
| "${freertos_include}" | ||
| ) | ||
|
|
||
| set(srcs | ||
| "src/class/cdc/cdc_device.c" | ||
| "src/class/hid/hid_device.c" | ||
| "src/class/midi/midi_device.c" | ||
| "src/class/msc/msc_device.c" | ||
| "src/class/vendor/vendor_device.c" | ||
| "src/class/audio/audio_device.c" | ||
| "src/class/video/video_device.c" | ||
| "src/class/bth/bth_device.c" | ||
| "src/class/usbtmc/usbtmc_device.c" | ||
| # NET class | ||
| "src/class/net/ecm_rndis_device.c" | ||
| "lib/networking/rndis_reports.c" | ||
| "src/class/net/ncm_device.c" | ||
| # DFU | ||
| "src/class/dfu/dfu_device.c" | ||
| "src/class/dfu/dfu_rt_device.c" | ||
| # Common, device-mode related | ||
| "src/portable/synopsys/dwc2/dcd_dwc2.c" | ||
| "src/portable/synopsys/dwc2/dwc2_common.c" | ||
| "src/common/tusb_fifo.c" | ||
| "src/device/usbd_control.c" | ||
| "src/device/usbd.c" | ||
| "src/tusb.c" | ||
| ) | ||
|
|
||
| set(requirements_private | ||
| esp_netif # required by rndis_reports.c: #include "netif/ethernet.h" | ||
| ) | ||
|
|
||
| if(${target} STREQUAL "esp32p4") | ||
| list(APPEND requirements_private | ||
| esp_mm # required by dcd_dwc2.c: #include "esp_cache.h" | ||
| ) | ||
| endif() | ||
|
|
||
| idf_component_register(SRCS ${srcs} | ||
| INCLUDE_DIRS ${includes_public} | ||
| PRIV_INCLUDE_DIRS ${includes_private} | ||
| PRIV_REQUIRES ${requirements_private} | ||
| ) | ||
|
|
||
| target_compile_options(${COMPONENT_LIB} PUBLIC ${compile_options}) | ||
|
|
||
| # when no builtin class driver is enabled, an uint8_t data compared with `BUILTIN_DRIVER_COUNT` will always be false | ||
| set_source_files_properties("src/device/usbd.c" PROPERTIES COMPILE_FLAGS "-Wno-type-limits") |
Uh oh!
There was an error while loading. Please reload this page.