Skip to content

Commit

Permalink
Merge branch 'master' into fork/Maerdl/master
Browse files Browse the repository at this point in the history
  • Loading branch information
hathach committed Oct 2, 2024
2 parents 3fa7da9 + eda3cce commit db15f63
Show file tree
Hide file tree
Showing 43 changed files with 1,193 additions and 737 deletions.
2 changes: 1 addition & 1 deletion .circleci/config2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ commands:
name: Build
command: |
if [ << parameters.toolchain >> == esp-idf ]; then
docker run --rm -v $PWD:/project -w /project espressif/idf:v5.1.1 python tools/build.py << parameters.family >>
docker run --rm -v $PWD:/project -w /project espressif/idf:v5.3.1 python tools/build.py << parameters.family >>
else
# Toolchain option default is gcc
if [ << parameters.toolchain >> == arm-clang ]; then
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
- 'msp430-gcc'
- 'riscv-gcc'
- 'rx-gcc'
- 'esp-idf' # buid-system is ignored
- 'esp-idf' # build-system is ignored
with:
build-system: 'make'
toolchain: ${{ matrix.toolchain }}
Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/build_util.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
required: false
default: false
type: boolean
upload-artifacts:
required: false
default: false
type: boolean
os:
required: false
type: string
Expand All @@ -37,7 +41,7 @@ jobs:
uses: ./.github/actions/setup_toolchain
with:
toolchain: ${{ inputs.toolchain }}
toolchain_version: 'v5.1.1'
toolchain_version: 'v5.3.1'

- name: Get Dependencies
uses: ./.github/actions/get_deps
Expand All @@ -57,8 +61,22 @@ jobs:
- name: Build
run: |
if [ "${{ inputs.toolchain }}" == "esp-idf" ]; then
docker run --rm -v $PWD:/project -w /project espressif/idf:v5.1.1 python tools/build.py ${{ matrix.arg }}
docker run --rm -v $PWD:/project -w /project espressif/idf:v5.3.1 python tools/build.py ${{ matrix.arg }}
else
python tools/build.py -s ${{ inputs.build-system }} ${{ steps.setup-toolchain.outputs.build_option }} ${{ steps.set-one-per-family.outputs.build_option }} ${{ matrix.arg }}
fi
shell: bash

- name: Upload Artifacts for Hardware Testing
if: ${{ inputs.upload-artifacts }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.arg }}
path: |
cmake-build/cmake-build-*/*/*/*.elf
cmake-build/cmake-build-*/*/*/*.bin
cmake-build/cmake-build-*/*/*/*.bin
cmake-build/cmake-build-*/*/*/bootloader/bootloader.bin
cmake-build/cmake-build-*/*/*/partition_table/partition-table.bin
cmake-build/cmake-build-*/*/*/config.env
cmake-build/cmake-build-*/*/*/flash_args
1 change: 1 addition & 0 deletions .github/workflows/ci_set_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"xmc4000": ["arm-gcc"],
"-bespressif_kaluga_1": ["esp-idf"],
"-bespressif_s3_devkitm": ["esp-idf"],
"-bespressif_p4_function_ev": ["esp-idf"],
}


Expand Down
56 changes: 18 additions & 38 deletions .github/workflows/hil_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ concurrency:
cancel-in-progress: true

env:
HIL_JSON: test/hil/rpi.json
HIL_JSON: test/hil/tinyusb.json

jobs:
set-matrix:
Expand All @@ -32,7 +32,10 @@ jobs:
- name: Generate matrix json
id: set-matrix-json
run: |
MATRIX_JSON=$(jq -c '{ "arm-gcc": [.boards[] | select(.flasher != "esptool" and .flasher != "openocd_wch") | .name] }' ${{ env.HIL_JSON }})
MATRIX_ARMGCC=$(jq -c '{ "arm-gcc": { "family": [.boards[] | select(.flasher != "esptool" and .flasher != "openocd_wch") | "-b \(.name)"] } }' "${{ env.HIL_JSON }}")
MATRIX_ESP=$(jq -c '{ "esp-idf": { "family": [.boards[] | select(.flasher == "esptool") | "-b \(.name)"] } }' "${{ env.HIL_JSON }}")
MATRIX_RISCV=$(jq -c '{ "riscv-gcc": { "family": [.boards[] | select(.flasher == "openocd_wch") | "-b \(.name)"] } }' "${{ env.HIL_JSON }}")
MATRIX_JSON=$(jq -nc --argjson arm "$MATRIX_ARMGCC" --argjson esp "$MATRIX_ESP" --argjson riscv "$MATRIX_RISCV" '$arm + $esp + $riscv')
echo "matrix=$MATRIX_JSON"
echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT
Expand All @@ -42,58 +45,35 @@ jobs:
build:
if: github.repository_owner == 'hathach'
needs: set-matrix
runs-on: ubuntu-latest
uses: ./.github/workflows/build_util.yml
strategy:
fail-fast: false
matrix:
board: ${{ fromJSON(needs.set-matrix.outputs.json)['arm-gcc'] }}
steps:
- name: Checkout TinyUSB
uses: actions/checkout@v4

- name: Setup arm-gcc toolchain
uses: ./.github/actions/setup_toolchain
with:
toolchain: 'arm-gcc'

- name: Get Dependencies
uses: ./.github/actions/get_deps
with:
arg: -b${{ matrix.board }}

- name: Build
run: python tools/build.py -b${{ matrix.board }}

- name: Upload Artifacts for Hardware Testing
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.board }}
path: |
cmake-build/cmake-build-*/*/*/*.elf
cmake-build/cmake-build-*/*/*/*.bin
toolchain:
- 'arm-gcc'
- 'esp-idf'
with:
build-system: 'cmake'
toolchain: ${{ matrix.toolchain }}
build-args: ${{ toJSON(fromJSON(needs.set-matrix.outputs.json)[matrix.toolchain].family) }}
one-per-family: true
upload-artifacts: true

# ---------------------------------------
# Hardware in the loop (HIL)
# self-hosted running on an RPI. For attached hardware checkout test/hil/rpi.json
# self-hosted running on an VM. For attached hardware checkout test/hil/tinyusb.json
# ---------------------------------------
hil-rpi:
hil-tinyusb:
if: github.repository_owner == 'hathach'
needs: build
runs-on: [self-hosted, ARM64, rpi, hardware-in-the-loop]
runs-on: [self-hosted, X64, hathach, hardware-in-the-loop]
steps:
- name: Clean workspace
run: |
echo "Cleaning up previous run"
rm -rf "${{ github.workspace }}"
mkdir -p "${{ github.workspace }}"
# USB bus on rpi is not stable, reset it before testing
# - name: Reset USB bus
# run: |
# echo "1-2" | sudo tee /sys/bus/usb/drivers/usb/unbind
# sleep 5
# echo "1-2" | sudo tee /sys/bus/usb/drivers/usb/bind

- name: Checkout TinyUSB
uses: actions/checkout@v4
with:
Expand Down
7 changes: 7 additions & 0 deletions .idea/cmake.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/device/audio_4_channel_mic_freertos/skip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ mcu:CH32V307
mcu:CXD56
mcu:F1C100S
mcu:GD32VF103
mcu:MCXA15
mcu:MKL25ZXX
mcu:MSP430x5xx
mcu:RP2040
Expand Down
1 change: 1 addition & 0 deletions examples/device/audio_test_freertos/skip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ mcu:CH32V307
mcu:CXD56
mcu:F1C100S
mcu:GD32VF103
mcu:MCXA15
mcu:MKL25ZXX
mcu:MSP430x5xx
mcu:RP2040
Expand Down
1 change: 1 addition & 0 deletions examples/device/cdc_msc_freertos/skip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ mcu:CH32V307
mcu:CXD56
mcu:F1C100S
mcu:GD32VF103
mcu:MCXA15
mcu:MKL25ZXX
mcu:MSP430x5xx
mcu:RP2040
Expand Down
1 change: 1 addition & 0 deletions examples/device/hid_composite_freertos/skip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ mcu:CH32V307
mcu:CXD56
mcu:F1C100S
mcu:GD32VF103
mcu:MCXA15
mcu:MKL25ZXX
mcu:MSP430x5xx
mcu:RP2040
Expand Down
1 change: 1 addition & 0 deletions examples/device/net_lwip_webserver/skip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ mcu:CH32V20X
mcu:LPC11UXX
mcu:LPC13XX
mcu:LPC15XX
mcu:MCXA15
mcu:MSP430x5xx
mcu:NUC121
mcu:SAMD11
Expand Down
1 change: 1 addition & 0 deletions examples/device/video_capture/skip.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mcu:CH32V103
mcu:CH32V20X
mcu:MCXA15
mcu:MSP430x5xx
mcu:NUC121
mcu:SAMD11
1 change: 1 addition & 0 deletions examples/device/video_capture_2ch/skip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ mcu:CH32V103
mcu:CH32V20X
mcu:CH32V307
mcu:STM32L0
mcu:MCXA15
family:espressif
board:curiosity_nano
board:kuiic
Expand Down
4 changes: 1 addition & 3 deletions hw/bsp/espressif/boards/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@ set(hw_dir "${CMAKE_CURRENT_LIST_DIR}/../../../")

idf_component_register(SRCS family.c
INCLUDE_DIRS "." ${BOARD} ${hw_dir}
PRIV_REQUIRES "driver"
PRIV_REQUIRES driver usb
REQUIRES led_strip src tinyusb_src)

target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-error=format)
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Apply board specific content here
set(IDF_TARGET "esp32")
set(MAX3421_HOST 1)
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Apply board specific content here
set(IDF_TARGET "esp32s2")
set(MAX3421_HOST 1)
3 changes: 3 additions & 0 deletions hw/bsp/espressif/boards/adafruit_feather_esp32s3/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Apply board specific content here
set(IDF_TARGET "esp32s3")
set(MAX3421_HOST 1)
53 changes: 53 additions & 0 deletions hw/bsp/espressif/boards/adafruit_feather_esp32s3/board.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2020, Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* This file is part of the TinyUSB stack.
*/

#ifndef BOARD_H_
#define BOARD_H_

#ifdef __cplusplus
extern "C" {
#endif

#define NEOPIXEL_PIN 33
#define NEOPIXEL_POWER_PIN 21
#define NEOPIXEL_POWER_STATE 1

#define BUTTON_PIN 0
#define BUTTON_STATE_ACTIVE 0

// SPI for USB host shield
#define MAX3421_SPI_HOST SPI2_HOST
#define MAX3421_SCK_PIN 36
#define MAX3421_MOSI_PIN 35
#define MAX3421_MISO_PIN 37
#define MAX3421_CS_PIN 10
#define MAX3421_INTR_PIN 9

#ifdef __cplusplus
}
#endif

#endif /* BOARD_H_ */
1 change: 1 addition & 0 deletions hw/bsp/espressif/boards/adafruit_metro_esp32s2/board.cmake
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Apply board specific content here
set(IDF_TARGET "esp32s2")
set(MAX3421_HOST 1)
1 change: 1 addition & 0 deletions hw/bsp/espressif/boards/espressif_c3_devkitc/board.cmake
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Apply board specific content here
set(IDF_TARGET "esp32c3")
set(MAX3421_HOST 1)
1 change: 1 addition & 0 deletions hw/bsp/espressif/boards/espressif_c6_devkitc/board.cmake
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Apply board specific content here
set(IDF_TARGET "esp32c6")
set(MAX3421_HOST 1)
2 changes: 2 additions & 0 deletions hw/bsp/espressif/boards/espressif_p4_function_ev/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Apply board specific content here
set(IDF_TARGET "esp32p4")
43 changes: 43 additions & 0 deletions hw/bsp/espressif/boards/espressif_p4_function_ev/board.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2020, Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* This file is part of the TinyUSB stack.
*/

#ifndef BOARD_H_
#define BOARD_H_

#ifdef __cplusplus
extern "C" {
#endif

// #define NEOPIXEL_PIN 48

#define BUTTON_PIN 0
#define BUTTON_STATE_ACTIVE 0

#ifdef __cplusplus
}
#endif

#endif /* BOARD_H_ */
Loading

0 comments on commit db15f63

Please sign in to comment.