Skip to content

Commit 3c8e6fb

Browse files
authored
Merge branch 'hathach:master' into master
2 parents c1205c4 + 56ed51c commit 3c8e6fb

File tree

75 files changed

+1537
-1359
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1537
-1359
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ jobs:
2020
2121
BUILDSYSTEM_TOOLCHAIN=(
2222
"cmake arm-clang"
23+
"cmake esp-idf"
2324
"make aarch64-gcc"
2425
"make arm-gcc"
2526
"make msp430-gcc"
2627
"make riscv-gcc"
2728
"make rx-gcc"
28-
"cmake esp-idf"
2929
)
3030
3131
# only build IAR if not forked PR, since IAR token is not shared

.circleci/config2.yml

+1-12
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,7 @@ commands:
1010
- run:
1111
name: Set toolchain url and key
1212
command: |
13-
TOOLCHAIN_JSON='{
14-
"aarch64-gcc": "https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz",
15-
"arm-clang": "https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-19.1.1/LLVM-ET-Arm-19.1.1-Linux-x86_64.tar.xz",
16-
"arm-gcc": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v13.2.1-1.1/xpack-arm-none-eabi-gcc-13.2.1-1.1-linux-x64.tar.gz",
17-
"msp430-gcc": "http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2",
18-
"riscv-gcc": "https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v13.2.0-2/xpack-riscv-none-elf-gcc-13.2.0-2-linux-x64.tar.gz",
19-
"rx-gcc": "https://github.com/hathach/rx_device/releases/download/0.0.1/gcc-8.3.0.202411-GNURX-ELF.run",
20-
"arm-iar": "https://updates.iar.com/FileStore/STANDARD/001/003/322/cxarm-9.60.3.deb"
21-
}'
22-
toolchain_url=$(echo $TOOLCHAIN_JSON | jq -r '.["<< parameters.toolchain >>"]')
23-
13+
toolchain_url=$(jq -r '."<< parameters.toolchain >>"' .github/actions/setup_toolchain/toolchain.json)
2414
# only cache if not a github link
2515
if [[ $toolchain_url != "https://github.com"* ]]; then
2616
echo "<< parameters.toolchain >>-$toolchain_url" > toolchain_key
@@ -121,7 +111,6 @@ commands:
121111
TOOLCHAIN_OPTION="--toolchain clang"
122112
elif [ << parameters.toolchain >> == arm-iar ]; then
123113
TOOLCHAIN_OPTION="--toolchain iar"
124-
echo IAR_LMS_CLOUD_URL=$IAR_LMS_CLOUD_URL
125114
iccarm --version
126115
elif [ << parameters.toolchain >> == arm-gcc ]; then
127116
TOOLCHAIN_OPTION="--toolchain gcc"

.github/actions/setup_toolchain/action.yml

+1-10
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,17 @@ runs:
2828
- name: Get Toolchain URL
2929
if: >-
3030
inputs.toolchain != 'arm-gcc' &&
31-
inputs.toolchain != 'arm-iar' &&
3231
inputs.toolchain != 'esp-idf'
3332
id: set-toolchain-url
3433
run: |
35-
TOOLCHAIN_JSON='{
36-
"aarch64-gcc": "https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz",
37-
"arm-clang": "https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-19.1.1/LLVM-ET-Arm-19.1.1-Linux-x86_64.tar.xz",
38-
"msp430-gcc": "http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2",
39-
"riscv-gcc": "https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v13.2.0-2/xpack-riscv-none-elf-gcc-13.2.0-2-linux-x64.tar.gz",
40-
"rx-gcc": "https://github.com/hathach/rx_device/releases/download/0.0.1/gcc-8.3.0.202411-GNURX-ELF.run"
41-
}'
42-
TOOLCHAIN_URL=$(echo $TOOLCHAIN_JSON | jq -r '.["${{ inputs.toolchain }}"]')
34+
TOOLCHAIN_URL=$(jq -r '."${{ inputs.toolchain }}"' .github/actions/setup_toolchain/toolchain.json)
4335
echo "toolchain_url=$TOOLCHAIN_URL"
4436
echo "toolchain_url=$TOOLCHAIN_URL" >> $GITHUB_OUTPUT
4537
shell: bash
4638

4739
- name: Download Toolchain
4840
if: >-
4941
inputs.toolchain != 'arm-gcc' &&
50-
inputs.toolchain != 'arm-iar' &&
5142
inputs.toolchain != 'esp-idf'
5243
uses: ./.github/actions/setup_toolchain/download
5344
with:

.github/actions/setup_toolchain/download/action.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,25 @@ runs:
2323
if: steps.cache-toolchain-download.outputs.cache-hit != 'true'
2424
run: |
2525
mkdir -p ~/cache/${{ inputs.toolchain }}
26-
wget --progress=dot:giga ${{ inputs.toolchain_url }} -O toolchain.tar.gz
26+
2727
if [[ ${{ inputs.toolchain }} == rx-gcc ]]; then
28-
mv toolchain.tar.gz toolchain.run
28+
wget --progress=dot:giga ${{ inputs.toolchain_url }} -O toolchain.run
2929
chmod +x toolchain.run
3030
./toolchain.run -p ~/cache/${{ inputs.toolchain }}/gnurx -y
31+
elif [[ ${{ inputs.toolchain }} == arm-iar ]]; then
32+
wget --progress=dot:giga ${{ inputs.toolchain_url }} -O ~/cache/${{ inputs.toolchain }}/cxarm.deb
3133
else
34+
wget --progress=dot:giga ${{ inputs.toolchain_url }} -O toolchain.tar.gz
3235
tar -C ~/cache/${{ inputs.toolchain }} -xaf toolchain.tar.gz
3336
fi
3437
shell: bash
3538

36-
- name: Set Toolchain Path
39+
- name: Setup Toolchain
3740
run: |
38-
echo >> $GITHUB_PATH `echo ~/cache/${{ inputs.toolchain }}/*/bin`
41+
if [[ ${{ inputs.toolchain }} == arm-iar ]]; then
42+
sudo apt-get install -y ~/cache/${{ inputs.toolchain }}/cxarm.deb
43+
echo >> $GITHUB_PATH "/opt/iar/cxarm/arm/bin"
44+
else
45+
echo >> $GITHUB_PATH `echo ~/cache/${{ inputs.toolchain }}/*/bin`
46+
fi
3947
shell: bash
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"aarch64-gcc": "https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz",
3+
"arm-clang": "https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-19.1.1/LLVM-ET-Arm-19.1.1-Linux-x86_64.tar.xz",
4+
"arm-gcc": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v13.2.1-1.1/xpack-arm-none-eabi-gcc-13.2.1-1.1-linux-x64.tar.gz",
5+
"msp430-gcc": "http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2",
6+
"riscv-gcc": "https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v13.2.0-2/xpack-riscv-none-elf-gcc-13.2.0-2-linux-x64.tar.gz",
7+
"rx-gcc": "https://github.com/hathach/rx_device/releases/download/0.0.1/gcc-8.3.0.202411-GNURX-ELF.run",
8+
"arm-iar": "https://netstorage.iar.com/FileStore/STANDARD/001/003/583/cxarm-9.60.4.deb"
9+
}

.github/workflows/build.yml

+18-29
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
- 'msp430-gcc'
8686
- 'riscv-gcc'
8787
- 'rx-gcc'
88-
- 'esp-idf' # build-system is ignored
88+
- 'esp-idf'
8989
with:
9090
build-system: 'make'
9191
toolchain: ${{ matrix.toolchain }}
@@ -110,37 +110,26 @@ jobs:
110110
one-per-family: true
111111

112112
# ---------------------------------------
113-
# Build IAR on HFP self-hosted
114-
# Since IAR Token secret is not passed to forked PR, only build on PR from the same repo
113+
# Build IAR
114+
# Since IAR Token secret is not passed to forked PR, only build non-forked PR with make.
115+
# cmake is built by circle-ci. Due to IAR limit capacity, only build oe per family
115116
# ---------------------------------------
116117
arm-iar:
117-
if: github.repository_owner == 'hathach' && github.event_name == 'push'
118+
if: false # disable for now since we got reach capacity limit too often
119+
#if: github.event_name == 'push' && github.repository_owner == 'hathach'
118120
needs: set-matrix
119-
runs-on: [self-hosted, Linux, X64, hifiphile]
120-
env:
121-
BUILD_ARGS: ${{ join(fromJSON(needs.set-matrix.outputs.json)['arm-iar'], ' ') }}
122-
IAR_LMS_CLOUD_URL: ${{ vars.IAR_LMS_CLOUD_URL }}
123-
IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
124-
steps:
125-
- name: Clean workspace
126-
run: |
127-
echo "Cleaning up previous run"
128-
rm -rf "${{ github.workspace }}"
129-
mkdir -p "${{ github.workspace }}"
130-
131-
- name: Toolchain version
132-
run: |
133-
echo IAR_LMS_CLOUD_URL=$IAR_LMS_CLOUD_URL
134-
iccarm --version
135-
136-
- name: Checkout TinyUSB
137-
uses: actions/checkout@v4
138-
139-
- name: Get Dependencies
140-
run: python3 tools/get_deps.py $BUILD_ARGS
141-
142-
- name: Build
143-
run: python3 tools/build.py --one-per-family --toolchain iar $BUILD_ARGS
121+
uses: ./.github/workflows/build_util.yml
122+
secrets: inherit
123+
strategy:
124+
fail-fast: false
125+
matrix:
126+
build-system:
127+
- 'make'
128+
with:
129+
build-system: ${{ matrix.build-system }}
130+
toolchain: 'arm-iar'
131+
build-args: ${{ toJSON(fromJSON(needs.set-matrix.outputs.json)['arm-iar']) }}
132+
one-per-family: true
144133

145134
# ---------------------------------------
146135
# Zephyr

.github/workflows/build_util.yml

+2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ jobs:
5858
shell: bash
5959

6060
- name: Build
61+
env:
62+
IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
6163
run: |
6264
if [ "${{ inputs.toolchain }}" == "esp-idf" ]; then
6365
docker run --rm -v $PWD:/project -w /project espressif/idf:tinyusb python tools/build.py ${{ matrix.arg }}

.github/workflows/ci_set_matrix.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@
4444
"stm32l0 stm32l4": ["arm-gcc", "arm-clang", "arm-iar"],
4545
"stm32u5 stm32wb": ["arm-gcc", "arm-clang", "arm-iar"],
4646
"xmc4000": ["arm-gcc"],
47-
"-bespressif_kaluga_1": ["esp-idf"],
48-
"-bespressif_s3_devkitm": ["esp-idf"],
49-
"-bespressif_p4_function_ev": ["esp-idf"],
47+
"-bespressif_s2_devkitc": ["esp-idf"],
48+
# S3, P4 will be built by hil test
49+
# "-bespressif_s3_devkitm": ["esp-idf"],
50+
# "-bespressif_p4_function_ev": ["esp-idf"],
5051
}
5152

5253

.github/workflows/hil_test.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,12 @@ jobs:
9090
# ---------------------------------------
9191
# Hardware in the loop (HIL)
9292
# self-hosted by HFP, build with IAR toolchain, for attached hardware checkout test/hil/hfp.json
93-
# Since IAR Token secret is not passed to forked PR, only build on PR from the same repo
93+
# Since IAR Token secret is not passed to forked PR, only build non-forked PR
9494
# ---------------------------------------
9595
hil-hfp:
9696
if: github.repository_owner == 'hathach' && github.event.pull_request.head.repo.fork == false
9797
runs-on: [self-hosted, Linux, X64, hifiphile]
9898
env:
99-
IAR_LMS_CLOUD_URL: ${{ vars.IAR_LMS_CLOUD_URL }}
10099
IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
101100
steps:
102101
- name: Clean workspace
@@ -107,7 +106,6 @@ jobs:
107106
108107
- name: Toolchain version
109108
run: |
110-
echo IAR_LMS_CLOUD_URL=$IAR_LMS_CLOUD_URL
111109
iccarm --version
112110
113111
- name: Checkout TinyUSB

README.rst

+5-8
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ TinyUSB Project
1515
.. figure:: docs/assets/logo.svg
1616
:alt: TinyUSB
1717

18-
TinyUSB is an open-source cross-platform USB Host/Device stack for
19-
embedded system, designed to be memory-safe with no dynamic allocation
20-
and thread-safe with all interrupt events are deferred then handled in
21-
the non-ISR task function. Check out the online `documentation <https://docs.tinyusb.org/>`__ for more details.
18+
TinyUSB is an open-source cross-platform USB Host/Device stack for embedded system, designed to be memory-safe with no dynamic allocation and thread-safe with all interrupt events are deferred then handled in the non-ISR task function. Check out the online `documentation <https://docs.tinyusb.org/>`__ for more details.
2219

2320
.. figure:: docs/assets/stack.svg
2421
:width: 500px
@@ -32,7 +29,7 @@ the non-ISR task function. Check out the online `documentation <https://docs.tin
3229
├── hw
3330
│ ├── bsp # Supported boards source files
3431
│ └── mcu # Low level mcu core & peripheral drivers
35-
├── lib # Sources from 3rd party such as freeRTOS, fatfs ...
32+
├── lib # Sources from 3rd party such as FreeRTOS, FatFs ...
3633
├── src # All sources files for TinyUSB stack itself.
3734
├── test # Tests: unit test, fuzzing, hardware test
3835
└── tools # Files used internally
@@ -43,7 +40,7 @@ Getting started
4340

4441
See the `online documentation <https://docs.tinyusb.org>`_ for information about using TinyUSB and how it is implemented.
4542

46-
Check out `Getting Started`_ guide for adding TinyUSB to your project or building the examples. If you are new to TinyUSB, we recommend starting with the `cdc_msc` example. There is a handful of `Supported Boards`_ that should work out of the box.
43+
Check out `Getting Started`_ guide for adding TinyUSB to your project or building the examples. If you are new to TinyUSB, we recommend starting with the ``cdc_msc`` example. There is a handful of `Supported Boards`_ that should work out of the box.
4744

4845
We use `GitHub Discussions <https://github.com/hathach/tinyusb/discussions>`_ as our forum. It is a great place to ask questions and advice from the community or to discuss your TinyUSB-based projects.
4946

@@ -69,7 +66,7 @@ Supports multiple device configurations by dynamically changing USB descriptors,
6966
- Vendor-specific class support with generic In & Out endpoints. Can be used with MS OS 2.0 compatible descriptor to load winUSB driver without INF file.
7067
- `WebUSB <https://github.com/WICG/webusb>`__ with vendor-specific class
7168

72-
If you have a special requirement, `usbd_app_driver_get_cb()` can be used to write your own class driver without modifying the stack. Here is how the RPi team added their reset interface `raspberrypi/pico-sdk#197 <https://github.com/raspberrypi/pico-sdk/pull/197>`_
69+
If you have a special requirement, ``usbd_app_driver_get_cb()`` can be used to write your own class driver without modifying the stack. Here is how the RPi team added their reset interface `raspberrypi/pico-sdk#197 <https://github.com/raspberrypi/pico-sdk/pull/197>`_
7370

7471
Host Stack
7572
==========
@@ -80,7 +77,7 @@ Host Stack
8077
- Vendor serial over USB: FTDI, CP210x, CH34x
8178
- Hub with multiple-level support
8279

83-
Similar to the Device Stack, if you have a special requirement, `usbh_app_driver_get_cb()` can be used to write your own class driver without modifying the stack.
80+
Similar to the Device Stack, if you have a special requirement, ``usbh_app_driver_get_cb()`` can be used to write your own class driver without modifying the stack.
8481

8582
Power Delivery Stack
8683
====================

docs/contributing/code_of_conduct.rst

-1
This file was deleted.

docs/contributing/code_of_conduct.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. include:: ../../CODE_OF_CONDUCT.rst

0 commit comments

Comments
 (0)