Skip to content
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

Upstream synchronization #43

Merged
merged 46 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
61eee53
feat(uvc): support format frame based
lijunru-hub May 22, 2024
3d3dcb1
service_traffic: Don't call pbuf_free when ethernet_input is Ok
Slion Oct 5, 2024
ad362c8
Add MSOS 2.0 descriptor to auto load NCM driver on Windows.
HiFiPhile Oct 5, 2024
047ba0a
Add comment to BOS descriptor.
HiFiPhile Oct 15, 2024
1b17bc0
RP2040 New ISO API
pschatzmann Oct 15, 2024
970a03e
Merge branch 'hathach:master' into rp2040-iso
pschatzmann Oct 16, 2024
ebcd706
Recover host enumeration from zero length descriptors
GuavTek Oct 18, 2024
833eb7d
change dcd_dcache_*() API return type from void to bool
hathach Nov 25, 2024
62f0e87
Merge pull request #2887 from hathach/change-dcd_dcache_return-to-bool
hathach Nov 25, 2024
be25aa3
hcd dwc2 add dcache support, usbh correctly use cache line size with …
hathach Nov 26, 2024
a5f9947
msc host work ok with p4 dma
hathach Nov 26, 2024
d9f3e7d
add TUH_EPBUF_DEF for hid host
hathach Nov 26, 2024
e9a3f88
add buffer note for host msc api
hathach Nov 26, 2024
f7efcf3
msc host, use usbh_get_enum_buf() for set_config() process
hathach Nov 26, 2024
67e92e6
add TUH_EPBUF_DEF for cdc host
hathach Nov 26, 2024
123f1af
update device_info example to work with p4 dcache
hathach Nov 26, 2024
6377108
enable dwc2 dma for hil test for esp32s3/p4 and stm32
hathach Nov 26, 2024
453d695
fix multiple flag on compiling
hathach Nov 27, 2024
9e4b855
minor clean up
hathach Nov 27, 2024
d9ef3cd
default CFG_TUH_DWC2_DMA_ENABLE to 0
hathach Nov 27, 2024
ae7cdcd
fix typo
hathach Nov 27, 2024
2732aff
Merge pull request #2888 from hathach/esp32p4-host-dma
hathach Nov 27, 2024
dbc2c8d
Fix missing protoype warning, change TUD_EPBUF_TYPE_DEF order (#2889)
hathach Nov 27, 2024
568c785
Add support for the STM32C0 and the NUCLEO-C071RB.
DavidEGrayson Oct 8, 2024
f090b64
enable ci for stm32c0, fix build issue with video example and clang
hathach Nov 27, 2024
5bb90ef
Merge pull request #2848 from DavidEGrayson/pr_stm32c0
hathach Nov 27, 2024
4212db1
Move desc_len sanity checks to start of loops
GuavTek Nov 27, 2024
3cacb01
Merge branch 'refs/heads/master' into fork/GuavTek/recover_zero_lengt…
hathach Nov 28, 2024
c514a8c
Merge branch 'master' into fork/pschatzmann/rp2040-iso
hathach Nov 28, 2024
3142927
Merge pull request #2852 from GuavTek/recover_zero_length_desc
hathach Nov 28, 2024
7f61a5a
made change per reviews, remove dcd_edpt_close(), rename and move thi…
hathach Nov 28, 2024
79373af
Merge branch 'master' into fork/HiFiPhile/lwip_fix
hathach Nov 28, 2024
c6dccff
Merge pull request #2847 from pschatzmann/rp2040-iso
hathach Nov 28, 2024
6b36df3
Merge pull request #2829 from HiFiPhile/lwip_fix
hathach Nov 28, 2024
741fdaa
fix(dcd_dwc2): Reset allocated_epin_count on bus reset and close all ep
roma-jam Nov 28, 2024
239443c
fix(dcd_dwc2): Correct usage of dwc2_controller
roma-jam Nov 28, 2024
ecc65a8
refactor(usbd_control): Updated the buffer name for deeper debug
roma-jam Nov 28, 2024
444277f
Merge pull request #2892 from roma-jam/fix/usbd_control_debug_buffer_…
hathach Nov 29, 2024
2179fb1
Merge pull request #2891 from roma-jam/fix/dcd_dwc2_counters
hathach Nov 29, 2024
3653c23
Disable DWC HCD interrupt with MAX3421 enabled
tannewt Dec 2, 2024
eabf68b
Merge pull request #2895 from tannewt/p4_fixes
hathach Dec 3, 2024
310b865
try to run arm-iar with circleci with new token (#2890)
hathach Dec 5, 2024
6cc2c98
correct clock setting for h563 nucleo
hathach Dec 6, 2024
ed4b1a9
Merge pull request #2656 from lijunru-hub/feat/uvc_support_frame_based
hathach Dec 6, 2024
cb22301
Merge pull request #2898 from hathach/update-h5-bsp
hathach Dec 6, 2024
1b0e6d0
Merge branch 'master' into sync/upstream
roma-jam Dec 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 28 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:

BUILDSYSTEM_TOOLCHAIN=(
"cmake arm-clang"
"cmake arm-iar"
"make aarch64-gcc"
"make arm-gcc"
"make msp430-gcc"
Expand All @@ -28,7 +29,27 @@ jobs:
"cmake esp-idf"
)

RESOURCE_LARGE='["nrf", "imxrt"]'
RESOURCE_LARGE='["nrf", "imxrt", "stm32f4", "stm32h7"]'

gen_build_entry() {
local build_system="$1"
local toolchain="$2"
local family="$3"
local resource_class="$4"

if [[ "$toolchain" == "esp-idf" ]]; then
echo " - build-vm:" >> .circleci/config2.yml
else
echo " - build:" >> .circleci/config2.yml
fi

echo " matrix:" >> .circleci/config2.yml
echo " parameters:" >> .circleci/config2.yml
echo " build-system: ['$build_system']" >> .circleci/config2.yml
echo " toolchain: ['$toolchain']" >> .circleci/config2.yml
echo " family: $family" >> .circleci/config2.yml
echo " resource_class: ['$resource_class']" >> .circleci/config2.yml
}

for e in "${BUILDSYSTEM_TOOLCHAIN[@]}"; do
e_arr=($e)
Expand All @@ -43,26 +64,14 @@ jobs:
FAMILY=$(jq -n --argjson family "$FAMILY" --argjson resource "$RESOURCE_LARGE" '$family | map(select(IN($resource[]) | not))')

if [[ $toolchain == esp-idf ]]; then
echo " - build-vm:" >> .circleci/config2.yml
gen_build_entry "$build_system" "$toolchain" "$FAMILY" "large"
else
echo " - build:" >> .circleci/config2.yml
fi
echo " matrix:" >> .circleci/config2.yml
echo " parameters:" >> .circleci/config2.yml
echo " build-system: ['$build_system']" >> .circleci/config2.yml
echo " toolchain: ['$toolchain']" >> .circleci/config2.yml
echo " family: $FAMILY" >> .circleci/config2.yml
#echo " resource_class: ['medium+']" >> .circleci/config2.yml
gen_build_entry "$build_system" "$toolchain" "$FAMILY" "medium+"

# add large resources
if [ "$(echo $FAMILY_LARGE | jq 'length')" -gt 0 ]; then
echo " - build:" >> .circleci/config2.yml
echo " matrix:" >> .circleci/config2.yml
echo " parameters:" >> .circleci/config2.yml
echo " build-system: ['$build_system']" >> .circleci/config2.yml
echo " toolchain: ['$toolchain']" >> .circleci/config2.yml
echo " family: $FAMILY_LARGE" >> .circleci/config2.yml
echo " resource_class: ['large']" >> .circleci/config2.yml
# add large resources if available
if [ "$(echo $FAMILY_LARGE | jq 'length')" -gt 0 ]; then
gen_build_entry "$build_system" "$toolchain" "$FAMILY_LARGE" "large"
fi
fi
done

Expand Down
20 changes: 16 additions & 4 deletions .circleci/config2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ commands:
"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",
"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",
"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",
"rx-gcc": "https://llvm-gcc-renesas.com/downloads/get.php?f=rx/8.3.0.202004-gnurx/gcc-8.3.0.202004-GNURX-ELF.run"
"rx-gcc": "https://llvm-gcc-renesas.com/downloads/get.php?f=rx/8.3.0.202004-gnurx/gcc-8.3.0.202004-GNURX-ELF.run",
"arm-iar": "https://updates.iar.com/FileStore/STANDARD/001/003/322/cxarm-9.60.3.deb"
}'
toolchain_url=$(echo $TOOLCHAIN_JSON | jq -r '.["<< parameters.toolchain >>"]')

Expand All @@ -38,18 +39,26 @@ commands:
# download if folder does not exist (not cached)
if [ ! -d ~/cache/<< parameters.toolchain >> ]; then
mkdir -p ~/cache/<< parameters.toolchain >>
wget --progress=dot:giga $toolchain_url -O toolchain.tar.gz
if [[ << parameters.toolchain >> == rx-gcc ]]; then
mv toolchain.tar.gz toolchain.run
wget --progress=dot:giga $toolchain_url -O toolchain.run
chmod +x toolchain.run
./toolchain.run -p ~/cache/<< parameters.toolchain >>/gnurx -y
elif [[ << parameters.toolchain >> == arm-iar ]]; then
wget --progress=dot:giga $toolchain_url -O ~/cache/<< parameters.toolchain >>/toolchain.deb
else
wget --progress=dot:giga $toolchain_url -O toolchain.tar.gz
tar -C ~/cache/<< parameters.toolchain >> -xaf toolchain.tar.gz
fi
fi

# Add toolchain to PATH
echo "export PATH=$PATH:`echo ~/cache/<< parameters.toolchain >>/*/bin`" >> $BASH_ENV
if [[ << parameters.toolchain >> == arm-iar ]]; then
# Install IAR since we only cache deb file
sudo dpkg --ignore-depends=libusb-1.0-0 -i ~/cache/<< parameters.toolchain >>/toolchain.deb
echo "export PATH=$PATH:/opt/iar/cxarm/arm/bin" >> $BASH_ENV
else
echo "export PATH=$PATH:`echo ~/cache/<< parameters.toolchain >>/*/bin`" >> $BASH_ENV
fi

- save_cache:
name: Save Toolchain Cache
Expand Down Expand Up @@ -110,6 +119,9 @@ commands:
# Toolchain option default is gcc
if [ << parameters.toolchain >> == arm-clang ]; then
TOOLCHAIN_OPTION="--toolchain clang"
elif [ << parameters.toolchain >> == arm-iar ]; then
TOOLCHAIN_OPTION="--toolchain iar"
iccarm --version
elif [ << parameters.toolchain >> == arm-gcc ]; then
TOOLCHAIN_OPTION="--toolchain gcc"
fi
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,22 @@ jobs:
# Build IAR on HFP self-hosted
# ---------------------------------------
arm-iar:
if: github.repository_owner == 'hathach'
if: github.repository_owner == 'hathach' && github.event_name == 'push'
needs: set-matrix
runs-on: [self-hosted, Linux, X64, hifiphile]
env:
BUILD_ARGS: ${{ join(fromJSON(needs.set-matrix.outputs.json)['arm-iar'], ' ') }}
# IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
steps:
- name: Clean workspace
run: |
echo "Cleaning up previous run"
rm -rf "${{ github.workspace }}"
mkdir -p "${{ github.workspace }}"

- name: Toolchain version
run: iccarm --version

- name: Checkout TinyUSB
uses: actions/checkout@v4

Expand All @@ -133,8 +137,3 @@ jobs:

- name: Build
run: python3 tools/build.py --one-per-family --toolchain iar $BUILD_ARGS

- name: Test on actual hardware (hardware in the loop)
if: github.event_name == 'pull_request'
run: |
python3 test/hil/hil_test.py hfp.json
10 changes: 1 addition & 9 deletions .github/workflows/ci_set_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"samd11 saml2x": ["arm-gcc", "arm-clang"],
"samd21": ["arm-gcc", "arm-clang"],
"samd5x_e5x samg": ["arm-gcc", "arm-clang"],
"stm32f0 stm32f1 stm32f2 stm32f3": ["arm-gcc", "arm-clang", "arm-iar"],
"stm32c0 stm32f0 stm32f1 stm32f2 stm32f3": ["arm-gcc", "arm-clang", "arm-iar"],
"stm32f4": ["arm-gcc", "arm-clang", "arm-iar"],
"stm32f7": ["arm-gcc", "arm-clang", "arm-iar"],
"stm32g0 stm32g4 stm32h5": ["arm-gcc", "arm-clang", "arm-iar"],
Expand All @@ -55,14 +55,6 @@ def set_matrix_json():
for toolchain in toolchain_list:
filtered_families = [family for family, supported_toolchain in family_list.items() if
toolchain in supported_toolchain]

# always add board in hfp.json for arm-iar
if toolchain == 'arm-iar':
with open('test/hil/hfp.json') as f:
hfp_data = json.load(f)
hfp_boards = [f"-b{board['name']}" for board in hfp_data['boards']]
filtered_families = filtered_families + hfp_boards

matrix[toolchain] = filtered_families

print(json.dumps(matrix))
Expand Down
40 changes: 39 additions & 1 deletion .github/workflows/hil_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:

# ---------------------------------------
# Hardware in the loop (HIL)
# self-hosted running on an VM. For attached hardware checkout HIL_JSON
# self-hosted on local VM, for attached hardware checkout HIL_JSON
# ---------------------------------------
hil-tinyusb:
if: github.repository_owner == 'hathach'
Expand Down Expand Up @@ -86,3 +86,41 @@ jobs:
run: |
ls cmake-build/
python3 test/hil/hil_test.py ${{ env.HIL_JSON }}

# ---------------------------------------
# Hardware in the loop (HIL)
# self-hosted by HFP, build with IAR toolchain, for attached hardware checkout test/hil/hfp.json
# ---------------------------------------
hil-hfp:
if: github.repository_owner == 'hathach'
runs-on: [self-hosted, Linux, X64, hifiphile]
#env:
# IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
steps:
- name: Clean workspace
run: |
echo "Cleaning up previous run"
rm -rf "${{ github.workspace }}"
mkdir -p "${{ github.workspace }}"

- name: Toolchain version
run: iccarm --version

- name: Checkout TinyUSB
uses: actions/checkout@v4

- name: Get build boards
run: |
MATRIX_JSON=$(python test/hil/hil_ci_set_matrix.py test/hil/hfp.json)
BUILD_ARGS=$(echo $MATRIX_JSON | jq -r '.["arm-gcc"] | join(" ")')
echo "BUILD_ARGS=$BUILD_ARGS"
echo "BUILD_ARGS=$BUILD_ARGS" >> $GITHUB_ENV

- name: Get Dependencies
run: python3 tools/get_deps.py $BUILD_ARGS

- name: Build
run: python3 tools/build.py --toolchain iar $BUILD_ARGS

- name: Test on actual hardware (hardware in the loop)
run: python3 test/hil/hil_test.py hfp.json
6 changes: 3 additions & 3 deletions .idea/cmake.xml

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

4 changes: 2 additions & 2 deletions .idea/runConfigurations/stlink.xml

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

2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Following CPUs are supported, check out `Supported Devices`_ for comprehensive l
+--------------+------------------------------------------------------------+
| Sony | CXD56 |
+--------------+------------------------------------------------------------+
| ST STM32 | F0, F1, F2, F3, F4, F7, G0, G4, H5, H7, |
| ST STM32 | C0, F0, F1, F2, F3, F4, F7, G0, G4, H5, H7, |
| | |
| | L0, L1, L4, L4+, L5, U5, WB |
+--------------+------------------------------------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/supported.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Supported MCUs
| +-----------------------------+--------+------+-----------+------------------------+-------------------+
| | F3 | ✔ | ✖ | ✖ | stm32_fsdev | |
| +-----------------------------+--------+------+-----------+------------------------+-------------------+
| | G0, H5 | ✔ | | ✖ | stm32_fsdev | |
| | C0, G0, H5 | ✔ | | ✖ | stm32_fsdev | |
| +-----------------------------+--------+------+-----------+------------------------+-------------------+
| | G4 | ✔ | ✖ | ✖ | stm32_fsdev | |
| +-----------------------------+--------+------+-----------+------------------------+-------------------+
Expand Down
1 change: 1 addition & 0 deletions examples/build_system/make/toolchain/gcc_common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ CFLAGS += \
-Wreturn-type \
-Wredundant-decls \

# -Wmissing-prototypes \
# conversion is too strict for most mcu driver, may be disable sign/int/arith-conversion
# -Wconversion

Expand Down
9 changes: 7 additions & 2 deletions examples/device/net_lwip_webserver/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,13 @@ uint16_t tud_network_xmit_cb(uint8_t *dst, void *ref, uint16_t arg) {
static void service_traffic(void) {
/* handle any packet received by tud_network_recv_cb() */
if (received_frame) {
ethernet_input(received_frame, &netif_data);
pbuf_free(received_frame);
// Surrender ownership of our pbuf unless there was an error
// Only call pbuf_free if not Ok else it will panic with "pbuf_free: p->ref > 0"
// or steal it from whatever took ownership of it with undefined consequences.
// See: https://savannah.nongnu.org/patch/index.php?10121
if (ethernet_input(received_frame, &netif_data)!=ERR_OK) {
pbuf_free(received_frame);
}
received_frame = NULL;
tud_network_recv_renew();
}
Expand Down
Loading
Loading