mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
Merge branch 'master' into codeql
This commit is contained in:
commit
1c1c2dc3b9
@ -2,8 +2,8 @@
|
||||
[codespell]
|
||||
# In the event of a false positive, add the problematic word, in all lowercase, to 'ignore-words.txt' (one word per line).
|
||||
# Or copy & paste the whole problematic line to 'exclude-file.txt'
|
||||
ignore-words = .codespell/ignore-words.txt
|
||||
exclude-file = .codespell/exclude-file.txt
|
||||
ignore-words = tools/codespell/ignore-words.txt
|
||||
exclude-file = tools/codespell/exclude-file.txt
|
||||
check-filenames =
|
||||
check-hidden =
|
||||
count =
|
||||
|
2
.github/workflows/build_aarch64.yml
vendored
2
.github/workflows/build_aarch64.yml
vendored
@ -73,7 +73,7 @@ jobs:
|
||||
run: python3 tools/get_deps.py ${{ matrix.family }}
|
||||
|
||||
- name: Build
|
||||
run: python3 tools/build_family.py ${{ matrix.family }}
|
||||
run: python3 tools/build_make.py ${{ matrix.family }}
|
||||
|
||||
- name: Linker Map
|
||||
run: |
|
||||
|
13
.github/workflows/build_arm.yml
vendored
13
.github/workflows/build_arm.yml
vendored
@ -36,16 +36,11 @@ jobs:
|
||||
- 'broadcom_32bit'
|
||||
- 'kinetis_k32l2'
|
||||
- 'lpc11 lpc13 lpc15 lpc17'
|
||||
- 'lpc51 lpc54'
|
||||
- 'lpc51'
|
||||
- 'mm32 msp432e4'
|
||||
- 'nrf'
|
||||
- 'ra'
|
||||
- 'samd11 samd21'
|
||||
- 'samd51 same5x'
|
||||
- 'saml2x'
|
||||
- 'samd11 same5x saml2x'
|
||||
- 'stm32f2 stm32f3'
|
||||
- 'stm32f4'
|
||||
- 'stm32l0 stm32u5 stm32wb'
|
||||
- 'stm32l0 stm32wb'
|
||||
- 'tm4c123 xmc4000'
|
||||
steps:
|
||||
- name: Setup Python
|
||||
@ -71,7 +66,7 @@ jobs:
|
||||
run: python3 tools/get_deps.py ${{ matrix.family }}
|
||||
|
||||
- name: Build
|
||||
run: python3 tools/build_family.py ${{ matrix.family }}
|
||||
run: python3 tools/build_make.py ${{ matrix.family }}
|
||||
|
||||
- name: Linker Map
|
||||
run: |
|
||||
|
21
.github/workflows/build_esp.yml
vendored
21
.github/workflows/build_esp.yml
vendored
@ -29,12 +29,10 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
board:
|
||||
# Alphabetical order
|
||||
# ESP32-S2
|
||||
- 'espressif_saola_1'
|
||||
- 'espressif_kaluga_1'
|
||||
# ESP32-S3
|
||||
#- 'espressif_s3_devkitm'
|
||||
# S3 compile error with "dangerous relocation: call8: call target out of range: memcpy"
|
||||
- 'espressif_s3_devkitm'
|
||||
|
||||
steps:
|
||||
- name: Setup Python
|
||||
@ -48,20 +46,5 @@ jobs:
|
||||
- name: Checkout TinyUSB
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Checkout hathach/linkermap
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: hathach/linkermap
|
||||
path: linkermap
|
||||
|
||||
- name: Build
|
||||
run: docker run --rm -v $PWD:/project -w /project espressif/idf:latest python3 tools/build_esp32.py ${{ matrix.board }}
|
||||
|
||||
- name: Linker Map
|
||||
run: |
|
||||
pip install linkermap/
|
||||
# find -quit to only print linkermap of 1 board per example
|
||||
for ex in `ls -d examples/device/*/`
|
||||
do
|
||||
find ${ex} -maxdepth 3 -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'
|
||||
done
|
||||
|
82
.github/workflows/build_iar.yml
vendored
82
.github/workflows/build_iar.yml
vendored
@ -32,7 +32,7 @@ jobs:
|
||||
# Alphabetical order
|
||||
# Note: bundle multiple families into a matrix since there is only one self-hosted instance can
|
||||
# run IAR build. Too many matrix can hurt due to setup/teardown overhead.
|
||||
- 'stm32f0 stm32f1 stm32f7 stm32g0 stm32g4 stm32h7 stm32l4'
|
||||
- 'lpc43 stm32f0 stm32f1 stm32f4 stm32f7 stm32g0 stm32g4 stm32h7 stm32l4'
|
||||
steps:
|
||||
- name: Clean workspace
|
||||
run: |
|
||||
@ -49,82 +49,6 @@ jobs:
|
||||
- name: Build
|
||||
run: python3 tools/build_cmake.py ${{ matrix.family }} -DTOOLCHAIN=iar -DCMAKE_BUILD_TYPE=MinSizeRel
|
||||
|
||||
# Upload binaries for hardware test with self-hosted
|
||||
- name: Prepare stm32l412nucleo Artifacts
|
||||
if: contains(matrix.family, 'stm32l4')
|
||||
working-directory: ${{github.workspace}}/cmake-build/cmake-build-stm32l412nucleo
|
||||
- name: Test on actual hardware (hardware in the loop)
|
||||
run: |
|
||||
find device/ -name "*.elf" -exec mv {} ../../ \;
|
||||
|
||||
- name: Upload Artifacts for stm32l412nucleo
|
||||
if: contains(matrix.family, 'stm32l4') && github.repository_owner == 'hathach'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: stm32l4
|
||||
path: |
|
||||
*.elf
|
||||
|
||||
# ---------------------------------------
|
||||
# Hardware in the loop (HIL)
|
||||
# Current self-hosted instance is running on an EPYC 7232 server hosted by HiFiPhile user
|
||||
# - STM32L412 Nucleo with on-board jlink as ttyACM0
|
||||
# ---------------------------------------
|
||||
hw-stm32l412nucleo-test:
|
||||
needs: cmake
|
||||
runs-on: [self-hosted, Linux, X64, hifiphile]
|
||||
|
||||
steps:
|
||||
- name: Clean workspace
|
||||
run: |
|
||||
echo "Cleaning up previous run"
|
||||
rm -rf "${{ github.workspace }}"
|
||||
mkdir -p "${{ github.workspace }}"
|
||||
|
||||
- name: Download stm32l4 Artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: stm32l4
|
||||
|
||||
- name: Create flash.sh
|
||||
run: |
|
||||
echo > flash.sh 'echo halt > flash.jlink'
|
||||
echo >> flash.sh 'echo r >> flash.jlink'
|
||||
echo >> flash.sh 'echo loadfile $1 >> flash.jlink'
|
||||
echo >> flash.sh 'echo r >> flash.jlink'
|
||||
echo >> flash.sh 'echo go >> flash.jlink'
|
||||
echo >> flash.sh 'echo exit >> flash.jlink'
|
||||
echo >> flash.sh 'cmdout=$(JLinkExe -device stm32l412kb -if swd -JTAGConf -1,-1 -speed auto -NoGui 1 -ExitOnError 1 -CommandFile flash.jlink)'
|
||||
echo >> flash.sh 'if (( $? )) ; then echo $cmdout ; fi'
|
||||
chmod +x flash.sh
|
||||
|
||||
- name: Test cdc_dual_ports
|
||||
run: |
|
||||
./flash.sh cdc_dual_ports.elf
|
||||
while (! ([ -e /dev/ttyACM1 ] && [ -e /dev/ttyACM2 ])) && [ $SECONDS -le 10 ]; do :; done
|
||||
test -e /dev/ttyACM1 && echo "ttyACM1 exists"
|
||||
test -e /dev/ttyACM2 && echo "ttyACM2 exists"
|
||||
|
||||
# Debian does not auto mount usb drive. skip this test for now
|
||||
- name: Test cdc_msc
|
||||
if: false
|
||||
run: |
|
||||
./flash.sh cdc_msc.elf
|
||||
readme='/media/pi/TinyUSB MSC/README.TXT'
|
||||
while (! ([ -e /dev/ttyACM1 ] && [ -f "$readme" ])) && [ $SECONDS -le 10 ]; do :; done
|
||||
test -e /dev/ttyACM1 && echo "ttyACM1 exists"
|
||||
test -f "$readme" && echo "$readme exists"
|
||||
cat "$readme"
|
||||
|
||||
- name: Test dfu
|
||||
run: |
|
||||
./flash.sh dfu.elf
|
||||
while (! (dfu-util -l | grep "Found DFU")) && [ $SECONDS -le 10 ]; do :; done
|
||||
dfu-util -d cafe -a 0 -U dfu0
|
||||
dfu-util -d cafe -a 1 -U dfu1
|
||||
grep "TinyUSB DFU! - Partition 0" dfu0
|
||||
grep "TinyUSB DFU! - Partition 1" dfu1
|
||||
|
||||
- name: Test dfu_runtime
|
||||
run: |
|
||||
./flash.sh dfu_runtime.elf
|
||||
while (! (dfu-util -l | grep "Found Runtime")) && [ $SECONDS -le 10 ]; do :; done
|
||||
python3 test/hil/hil_test.py hil_hfp.json
|
||||
|
2
.github/workflows/build_msp430.yml
vendored
2
.github/workflows/build_msp430.yml
vendored
@ -71,7 +71,7 @@ jobs:
|
||||
run: python3 tools/get_deps.py ${{ matrix.family }}
|
||||
|
||||
- name: Build
|
||||
run: python3 tools/build_family.py ${{ matrix.family }}
|
||||
run: python3 tools/build_make.py ${{ matrix.family }}
|
||||
|
||||
- name: Linker Map
|
||||
run: |
|
||||
|
2
.github/workflows/build_renesas.yml
vendored
2
.github/workflows/build_renesas.yml
vendored
@ -71,7 +71,7 @@ jobs:
|
||||
run: python3 tools/get_deps.py ${{ matrix.family }}
|
||||
|
||||
- name: Build
|
||||
run: python3 tools/build_family.py ${{ matrix.family }}
|
||||
run: python3 tools/build_make.py ${{ matrix.family }}
|
||||
|
||||
- name: Linker Map
|
||||
run: |
|
||||
|
2
.github/workflows/build_riscv.yml
vendored
2
.github/workflows/build_riscv.yml
vendored
@ -72,7 +72,7 @@ jobs:
|
||||
run: python3 tools/get_deps.py ${{ matrix.family }}
|
||||
|
||||
- name: Build
|
||||
run: python3 tools/build_family.py ${{ matrix.family }}
|
||||
run: python3 tools/build_make.py ${{ matrix.family }}
|
||||
|
||||
- name: Linker Map
|
||||
run: |
|
||||
|
2
.github/workflows/build_win_mac.yml
vendored
2
.github/workflows/build_win_mac.yml
vendored
@ -51,4 +51,4 @@ jobs:
|
||||
run: python3 tools/get_deps.py stm32f4
|
||||
|
||||
- name: Build
|
||||
run: python3 tools/build_family.py stm32f4 stm32f411disco
|
||||
run: python3 tools/build_make.py stm32f4 stm32f411disco
|
||||
|
57
.github/workflows/cmake_arm.yml
vendored
57
.github/workflows/cmake_arm.yml
vendored
@ -35,18 +35,23 @@ jobs:
|
||||
# Alphabetical order
|
||||
- 'imxrt'
|
||||
- 'kinetis_kl'
|
||||
- 'lpc18'
|
||||
- 'lpc55'
|
||||
- 'lpc18 lpc40 lpc43'
|
||||
- 'lpc54 lpc55'
|
||||
- 'mcx'
|
||||
- 'nrf'
|
||||
- 'ra'
|
||||
- 'rp2040'
|
||||
- 'samd21'
|
||||
- 'samd51'
|
||||
- 'stm32f0'
|
||||
- 'stm32f1'
|
||||
- 'stm32f4'
|
||||
- 'stm32f7'
|
||||
- 'stm32g0'
|
||||
- 'stm32g4'
|
||||
- 'stm32h7'
|
||||
- 'stm32l4'
|
||||
- 'stm32u5'
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
@ -100,15 +105,14 @@ jobs:
|
||||
|
||||
# ---------------------------------------
|
||||
# Hardware in the loop (HIL)
|
||||
# Current self-hosted instance is running on an RPI4 with
|
||||
# - pico + pico-probe connected via USB
|
||||
# - pico-probe is /dev/ttyACM0
|
||||
# Current self-hosted instance is running on an RPI4.
|
||||
# For attached hardware checkout hil_pi4.json
|
||||
# ---------------------------------------
|
||||
hw-rp2040-test:
|
||||
# run only with hathach's commit due to limited resource on RPI4
|
||||
if: github.repository_owner == 'hathach'
|
||||
needs: build-arm
|
||||
runs-on: [self-hosted, Linux, ARM64, rp2040]
|
||||
runs-on: [self-hosted, rp2040, hardware-in-the-loop]
|
||||
|
||||
steps:
|
||||
- name: Clean workspace
|
||||
@ -117,43 +121,16 @@ jobs:
|
||||
rm -rf "${{ github.workspace }}"
|
||||
mkdir -p "${{ github.workspace }}"
|
||||
|
||||
- name: Checkout test/hil
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
sparse-checkout: test/hil
|
||||
|
||||
- name: Download rp2040 Artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: rp2040
|
||||
|
||||
- name: Create flash.sh
|
||||
- name: Test on actual hardware (hardware in the loop)
|
||||
run: |
|
||||
echo > flash.sh 'cmdout=$(openocd -f "interface/cmsis-dap.cfg" -f "target/rp2040.cfg" -c "adapter speed 5000" -c "program $1 reset exit")'
|
||||
echo >> flash.sh 'if (( $? )) ; then echo $cmdout ; fi'
|
||||
chmod +x flash.sh
|
||||
|
||||
- name: Test cdc_dual_ports
|
||||
run: |
|
||||
./flash.sh cdc_dual_ports.elf
|
||||
while (! ([ -e /dev/ttyACM1 ] && [ -e /dev/ttyACM2 ])) && [ $SECONDS -le 10 ]; do :; done
|
||||
test -e /dev/ttyACM1 && echo "ttyACM1 exists"
|
||||
test -e /dev/ttyACM2 && echo "ttyACM2 exists"
|
||||
|
||||
- name: Test cdc_msc
|
||||
run: |
|
||||
./flash.sh cdc_msc.elf
|
||||
readme='/media/pi/TinyUSB MSC/README.TXT'
|
||||
while (! ([ -e /dev/ttyACM1 ] && [ -f "$readme" ])) && [ $SECONDS -le 10 ]; do :; done
|
||||
test -e /dev/ttyACM1 && echo "ttyACM1 exists"
|
||||
test -f "$readme" && echo "$readme exists"
|
||||
cat "$readme"
|
||||
|
||||
- name: Test dfu
|
||||
run: |
|
||||
./flash.sh dfu.elf
|
||||
while (! (dfu-util -l | grep "Found DFU")) && [ $SECONDS -le 10 ]; do :; done
|
||||
dfu-util -d cafe -a 0 -U dfu0
|
||||
dfu-util -d cafe -a 1 -U dfu1
|
||||
grep "TinyUSB DFU! - Partition 0" dfu0
|
||||
grep "TinyUSB DFU! - Partition 1" dfu1
|
||||
|
||||
- name: Test dfu_runtime
|
||||
run: |
|
||||
./flash.sh dfu_runtime.elf
|
||||
while (! (dfu-util -l | grep "Found Runtime")) && [ $SECONDS -le 10 ]; do :; done
|
||||
python3 test/hil/hil_test.py hil_pi4.json
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -81,6 +81,7 @@ hw/mcu/st/stm32u5xx_hal_driver
|
||||
hw/mcu/st/stm32wbxx_hal_driver
|
||||
hw/mcu/ti
|
||||
hw/mcu/wch/ch32v307
|
||||
hw/mcu/wch/ch32f20x
|
||||
lib/CMSIS_5
|
||||
lib/FreeRTOS-Kernel
|
||||
lib/lwip
|
||||
|
100
.idea/cmake.xml
generated
100
.idea/cmake.xml
generated
@ -2,50 +2,82 @@
|
||||
<project version="4">
|
||||
<component name="CMakeSharedSettings">
|
||||
<configurations>
|
||||
<configuration PROFILE_NAME="mcxn947" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=mcxn947brk -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="rp2040" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=raspberry_pi_pico -DLOG=2" />
|
||||
<configuration PROFILE_NAME="feather_rp2040" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=pico_sdk -DPICO_BOARD=adafruit_feather_rp2040" />
|
||||
<configuration PROFILE_NAME="metro esp32s2" ENABLED="false" TOOLCHAIN_NAME="ESP-IDF" GENERATION_OPTIONS="-DBOARD=adafruit_metro_esp32s2 -DMAX3421_HOST=1 -DLOG=2">
|
||||
<ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
<envs>
|
||||
<env name="ESPBAUD" value="1500000" />
|
||||
</envs>
|
||||
</ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
</configuration>
|
||||
<configuration PROFILE_NAME="esp32s2" ENABLED="false" TOOLCHAIN_NAME="ESP-IDF" GENERATION_OPTIONS="-DBOARD=espressif_saola_1">
|
||||
<ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
<envs>
|
||||
<env name="ESPBAUD" value="1500000" />
|
||||
</envs>
|
||||
</ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
</configuration>
|
||||
<configuration PROFILE_NAME="kaluga" ENABLED="false" TOOLCHAIN_NAME="ESP-IDF" GENERATION_OPTIONS="-DBOARD=espressif_kaluga_1 -DMAX3421_HOST=1 -DLOG=2">
|
||||
<ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
<envs>
|
||||
<env name="ESPBAUD" value="1500000" />
|
||||
</envs>
|
||||
</ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
</configuration>
|
||||
<configuration PROFILE_NAME="espressif_s3_devkitm" ENABLED="false" TOOLCHAIN_NAME="ESP-IDF" GENERATION_OPTIONS="-DBOARD=espressif_s3_devkitm -DMAX3421_HOST=1 -DLOG=2">
|
||||
<ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
<envs>
|
||||
<env name="ESPBAUD" value="1500000" />
|
||||
</envs>
|
||||
</ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
</configuration>
|
||||
<configuration PROFILE_NAME="espressif_s3_devkitc" ENABLED="false" TOOLCHAIN_NAME="ESP-IDF" GENERATION_OPTIONS="-DBOARD=espressif_s3_devkitc -DMAX3421_HOST=1 -DLOG=2">
|
||||
<ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
<envs>
|
||||
<env name="ESPBAUD" value="1500000" />
|
||||
</envs>
|
||||
</ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
</configuration>
|
||||
<configuration PROFILE_NAME="metro_m0_express" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=metro_m0_express -DLOG=3 -DLOGGER=RTT -DMAX3421_HOST=1" />
|
||||
<configuration PROFILE_NAME="feather_m0_express" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=feather_m0_express -DLOG=3 -DLOGGER=RTT -DMAX3421_HOST=1" />
|
||||
<configuration PROFILE_NAME="metro_m4_express" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=metro_m4_express -DLOG=3 -DLOGGER=RTT -DMAX3421_HOST=1" />
|
||||
<configuration PROFILE_NAME="feather_m4_express" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=feather_m4_express -DLOG=3 -DLOGGER=RTT -DMAX3421_HOST=1" />
|
||||
<configuration PROFILE_NAME="feather_nrf52840_express" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=feather_nrf52840_express -DLOG=3 -DLOGGER=RTT -DMAX3421_HOST=1" />
|
||||
<configuration PROFILE_NAME="pca10056" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=pca10056 -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||
<configuration PROFILE_NAME="pca10095" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=pca10095 -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||
<configuration PROFILE_NAME="esp32s2" ENABLED="false" GENERATION_OPTIONS="-DBOARD=espressif_saola_1 -DIDF_TARGET=esp32s2">
|
||||
<ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
<envs>
|
||||
<env name="ESPBAUD" value="1500000" />
|
||||
<env name="ESPPORT" value="/dev/ttyUSB0" />
|
||||
<env name="IDF_PATH" value="$PROJECT_DIR$/../esp-idf" />
|
||||
<env name="PATH" value="$PROJECT_DIR$/../esp-idf/components/esptool_py/esptool:/home/hathach/code/esp-idf/components/espcoredump:/home/hathach/code/esp-idf/components/partition_table:/home/hathach/code/esp-idf/components/app_update:/home/hathach/.espressif/tools/xtensa-esp-elf-gdb/11.2_20220823/xtensa-esp-elf-gdb/bin:/home/hathach/.espressif/tools/riscv32-esp-elf-gdb/11.2_20220823/riscv32-esp-elf-gdb/bin:/home/hathach/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin:/home/hathach/.espressif/tools/xtensa-esp32s2-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32s2-elf/bin:/home/hathach/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32s3-elf/bin:/home/hathach/.espressif/tools/riscv32-esp-elf/esp-2021r2-patch5-8.4.0/riscv32-esp-elf/bin:/home/hathach/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/home/hathach/.espressif/tools/openocd-esp32/v0.11.0-esp32-20221026/openocd-esp32/bin:/home/hathach/.espressif/python_env/idf4.4_py3.10_env/bin:/home/hathach/code/esp-idf/tools:/home/hathach/app/riscv-openocd-wch/src:/home/hathach/app/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/bin:/home/hathach/.local/bin:/home/hathach/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/opt/SEGGER/JLink:/home/hathach/app/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin:/home/hathach/.local/xPacks/@xpack-dev-tools/riscv-none-embed-gcc/10.2.0-1.2.1/.content/bin:/home/hathach/.local/xPacks/@xpack-dev-tools/openocd/*/.content/bin:/home/hathach/ti/msp430-gcc/bin:/home/hathach/ti/MSPFlasher_1.3.20:/home/hathach/ti/uniflash_7.0.0:/home/hathach/app/gcc_8.3.0.202102_gnurx-elf/bin:/home/hathach/app/RFP_CLI_Linux_V31101_x64/linux-x64:/home/hathach/app/fomu-toolchain-linux_x86_64-v1.5.5/bin:/home/hathach/app/nuclei_riscv_newlibc_prebuilt_linux64_2020.08/gcc/bin:/home/hathach/app/riscv32-embecosm-ubuntu2004-gcc11.1.0/bin:/home/hathach/app/cov-analysis-linux64-2019.03/bin:/opt/iarsystems/bxarm/arm/bin:/home/hathach/.local/bin" />
|
||||
</envs>
|
||||
</ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
</configuration>
|
||||
<configuration PROFILE_NAME="esp32s3" ENABLED="false" GENERATION_OPTIONS="-DBOARD=espressif_s3_devkitm -DIDF_TARGET=esp32s3">
|
||||
<ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
<envs>
|
||||
<env name="ESPBAUD" value="1500000" />
|
||||
<env name="ESPPORT" value="/dev/ttyUSB0" />
|
||||
<env name="IDF_PATH" value="$PROJECT_DIR$/../esp-idf" />
|
||||
<env name="PATH" value="$PROJECT_DIR$/../esp-idf/components/esptool_py/esptool:/home/hathach/code/esp-idf/components/espcoredump:/home/hathach/code/esp-idf/components/partition_table:/home/hathach/code/esp-idf/components/app_update:/home/hathach/.espressif/tools/xtensa-esp-elf-gdb/11.2_20220823/xtensa-esp-elf-gdb/bin:/home/hathach/.espressif/tools/riscv32-esp-elf-gdb/11.2_20220823/riscv32-esp-elf-gdb/bin:/home/hathach/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin:/home/hathach/.espressif/tools/xtensa-esp32s2-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32s2-elf/bin:/home/hathach/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32s3-elf/bin:/home/hathach/.espressif/tools/riscv32-esp-elf/esp-2021r2-patch5-8.4.0/riscv32-esp-elf/bin:/home/hathach/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/home/hathach/.espressif/tools/openocd-esp32/v0.11.0-esp32-20221026/openocd-esp32/bin:/home/hathach/.espressif/python_env/idf4.4_py3.10_env/bin:/home/hathach/code/esp-idf/tools:/home/hathach/app/riscv-openocd-wch/src:/home/hathach/app/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/bin:/home/hathach/.local/bin:/home/hathach/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/opt/SEGGER/JLink:/home/hathach/app/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin:/home/hathach/.local/xPacks/@xpack-dev-tools/riscv-none-embed-gcc/10.2.0-1.2.1/.content/bin:/home/hathach/.local/xPacks/@xpack-dev-tools/openocd/*/.content/bin:/home/hathach/ti/msp430-gcc/bin:/home/hathach/ti/MSPFlasher_1.3.20:/home/hathach/ti/uniflash_7.0.0:/home/hathach/app/gcc_8.3.0.202102_gnurx-elf/bin:/home/hathach/app/RFP_CLI_Linux_V31101_x64/linux-x64:/home/hathach/app/fomu-toolchain-linux_x86_64-v1.5.5/bin:/home/hathach/app/nuclei_riscv_newlibc_prebuilt_linux64_2020.08/gcc/bin:/home/hathach/app/riscv32-embecosm-ubuntu2004-gcc11.1.0/bin:/home/hathach/app/cov-analysis-linux64-2019.03/bin:/opt/iarsystems/bxarm/arm/bin:/home/hathach/.local/bin" />
|
||||
</envs>
|
||||
</ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
</configuration>
|
||||
<configuration PROFILE_NAME="rp2040" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=raspberry_pi_pico -DLOG=2" />
|
||||
<configuration PROFILE_NAME="rt1010 evk" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=mimxrt1010_evk" />
|
||||
<configuration PROFILE_NAME="rt1060 evk" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=mimxrt1060_evk" />
|
||||
<configuration PROFILE_NAME="rt1064 evk" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=mimxrt1064_evk" />
|
||||
<configuration PROFILE_NAME="metro m7 1011 sd" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=metro_m7_1011_sd -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||
<configuration PROFILE_NAME="metro m7 1011" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=metro_m7_1011 -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="rt1010 evk" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=mimxrt1010_evk -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="rt1060 evk" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=mimxrt1060_evk -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="rt1170 evkb" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=mimxrt1170_evkb -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||
<configuration PROFILE_NAME="mcb1800" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=mcb1800 -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||
<configuration PROFILE_NAME="lpcxpresso18s37" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=lpcxpresso18s37" />
|
||||
<configuration PROFILE_NAME="lpc55s69" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=lpcxpresso55s69" />
|
||||
<configuration PROFILE_NAME="ea4088 quickstart" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ea4088_quickstart -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||
<configuration PROFILE_NAME="ea4357" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ea4357 -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||
<configuration PROFILE_NAME="lpc54628" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=lpcxpresso54628 -DLOG=4 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="lpc55s69" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=lpcxpresso55s69 -DLOG=4 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="mcxn947" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=mcxn947brk -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="frdm_kl25z" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=frdm_kl25z -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="stm32f072disco" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32f072disco" />
|
||||
<configuration PROFILE_NAME="stm32f103_mini_2" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32f103_mini_2" />
|
||||
<configuration PROFILE_NAME="stm32f411disco" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32f411disco -DLOG=2 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="stm32f769disco" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32f769disco -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="stm32h743eval" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32h743eval -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||
<configuration PROFILE_NAME="stm32h743nucleo" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32h743nucleo -DLOG=3" />
|
||||
<configuration PROFILE_NAME="stm32l476disco" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32l476disco" />
|
||||
<configuration PROFILE_NAME="stm32g0b1nucleo" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32g0b1nucleo" />
|
||||
<configuration PROFILE_NAME="stm32g474nucleo" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32g474nucleo" />
|
||||
<configuration PROFILE_NAME="b_g474e_dpow1" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=b_g474e_dpow1 -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="b_g474e_dpow1 iar" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=b_g474e_dpow1 -DTOOLCHAIN=iar" />
|
||||
<configuration PROFILE_NAME="frdm_kl25z" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=frdm_kl25z -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="stm32h743eval" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32h743eval -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||
<configuration PROFILE_NAME="metro m7" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=metro_m7_1011 -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||
<configuration PROFILE_NAME="stm32f072disco" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32f072disco" />
|
||||
<configuration PROFILE_NAME="stm32f103_mini_2" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32f103_mini_2" />
|
||||
<configuration PROFILE_NAME="stm32f769disco" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32f769disco -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="stm32l476disco" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32l476disco" />
|
||||
<configuration PROFILE_NAME="stm32u575nucleo" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32u575nucleo -DLOG=3" />
|
||||
<configuration PROFILE_NAME="stm32u5a5nucleo" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32u5a5nucleo -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="ra2a1" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra2a1_ek -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="ra4m1" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra4m1_ek -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="ra6m1" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m1_ek -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="ra6m5" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m5_ek -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||
<configuration PROFILE_NAME="ra6m5 PORT0" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m5_ek -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1 -DPORT=0" />
|
||||
<configuration PROFILE_NAME="uno_r4" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=uno_r4 -DLOG=4 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="portenta_c33" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=portenta_c33 -DLOG=3" />
|
||||
</configurations>
|
||||
</component>
|
||||
</project>
|
2
.idea/runConfigurations/kl25.xml
generated
2
.idea/runConfigurations/kl25.xml
generated
@ -1,5 +1,5 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="kl25" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "MKL25Z128xxx4" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="cdc_msc" TARGET_NAME="cdc_msc" version="1" RUN_TARGET_PROJECT_NAME="cdc_msc" RUN_TARGET_NAME="cdc_msc">
|
||||
<configuration default="false" name="kl25" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "MKL25Z128xxx4" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="metro m7 1011 sd" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
|
2
.idea/runConfigurations/lpc1857.xml
generated
2
.idea/runConfigurations/lpc1857.xml
generated
@ -1,5 +1,5 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="lpc1857" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "lpc1857" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="cdc_msc" TARGET_NAME="cdc_msc" CONFIG_NAME="pca10056" version="1" RUN_TARGET_PROJECT_NAME="cdc_msc" RUN_TARGET_NAME="cdc_msc">
|
||||
<configuration default="false" name="lpc1857" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" folderName="lpc" PROGRAM_PARAMS="-device "lpc1857" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="metro m7 1011 sd" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
|
10
.idea/runConfigurations/lpc4088.xml
generated
Normal file
10
.idea/runConfigurations/lpc4088.xml
generated
Normal file
@ -0,0 +1,10 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="lpc4088" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" folderName="lpc" PROGRAM_PARAMS="-device "lpc4088" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="metro m7 1011 sd" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/lpc54628.xml
generated
Normal file
10
.idea/runConfigurations/lpc54628.xml
generated
Normal file
@ -0,0 +1,10 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="lpc54628" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" folderName="lpc" PROGRAM_PARAMS="-device "LPC54628J512" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="metro m7 1011 sd" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/lpc55s69.xml
generated
Normal file
10
.idea/runConfigurations/lpc55s69.xml
generated
Normal file
@ -0,0 +1,10 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="lpc55s69" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" folderName="lpc" PROGRAM_PARAMS="-device "lpc55s69" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="metro m7 1011 sd" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
2
.idea/runConfigurations/mcx947.xml
generated
2
.idea/runConfigurations/mcx947.xml
generated
@ -1,5 +1,5 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="mcx947" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "MCXN947_M33_0" -if swd -speed 50000 -port 25321 -nogui -singlerun -jlinkscriptfile $ProjectFileDir$/hw/bsp/mcx/mcx.jlinkscript" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="cdc_msc" TARGET_NAME="cdc_msc" CONFIG_NAME="pca10056" version="1" RUN_TARGET_PROJECT_NAME="cdc_msc" RUN_TARGET_NAME="cdc_msc">
|
||||
<configuration default="false" name="mcx947" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "MCXN947_M33_0" -if swd -speed 50000 -port 25321 -nogui -singlerun -jlinkscriptfile $ProjectFileDir$/hw/bsp/mcx/debug.jlinkscript" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="metro m7 1011 sd" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
|
2
.idea/runConfigurations/nrf52840.xml
generated
2
.idea/runConfigurations/nrf52840.xml
generated
@ -1,5 +1,5 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="nrf52840" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "nrf52840_xxaa" -if swd -speed 8000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="cdc_msc" TARGET_NAME="cdc_msc" CONFIG_NAME="pca10056" version="1" RUN_TARGET_PROJECT_NAME="cdc_msc" RUN_TARGET_NAME="cdc_msc">
|
||||
<configuration default="false" name="nrf52840" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-select usb=752001685 -device "nrf52840_xxaa" -if swd -speed 8000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="metro m7 1011 sd" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
|
2
.idea/runConfigurations/nrf5340.xml
generated
2
.idea/runConfigurations/nrf5340.xml
generated
@ -1,5 +1,5 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="nrf5340" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "nrf5340_xxaa_app" -if swd -speed 16000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="cdc_msc" TARGET_NAME="cdc_msc" version="1" RUN_TARGET_PROJECT_NAME="cdc_msc" RUN_TARGET_NAME="cdc_msc">
|
||||
<configuration default="false" name="nrf5340" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-select usb=752001685 -device "nrf5340_xxaa_app" -if swd -speed 16000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="metro m7 1011 sd" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="ALWAYS" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
|
10
.idea/runConfigurations/ra4m1.xml
generated
Normal file
10
.idea/runConfigurations/ra4m1.xml
generated
Normal file
@ -0,0 +1,10 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="ra4m1" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" folderName="renesas" PROGRAM_PARAMS="-device "R7FA4M1AB" -if swd -speed 50000 -port 25321 -nogui -singlerun -jlinkscriptfile $PROJECT_DIR$/hw/bsp/ra/debug.jlinkscript" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="metro m7 1011 sd" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="ALWAYS" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/ra6m1.xml
generated
Normal file
10
.idea/runConfigurations/ra6m1.xml
generated
Normal file
@ -0,0 +1,10 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="ra6m1" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" folderName="renesas" PROGRAM_PARAMS="-device "R7FA6M1AD" -if swd -speed 50000 -port 25321 -nogui -singlerun -jlinkscriptfile $PROJECT_DIR$/hw/bsp/ra/debug.jlinkscript" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="metro m7 1011 sd" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="ALWAYS" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/ra6m5.xml
generated
Normal file
10
.idea/runConfigurations/ra6m5.xml
generated
Normal file
@ -0,0 +1,10 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="ra6m5" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" folderName="renesas" PROGRAM_PARAMS="-device "R7FA6M5BH" -if swd -speed 50000 -port 25321 -nogui -singlerun -jlinkscriptfile $PROJECT_DIR$/hw/bsp/ra/debug.jlinkscript" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="metro m7 1011 sd" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="ALWAYS" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
2
.idea/runConfigurations/rp2040.xml
generated
2
.idea/runConfigurations/rp2040.xml
generated
@ -1,5 +1,5 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="rp2040" type="com.jetbrains.cidr.embedded.openocd.conf.type" factoryName="com.jetbrains.cidr.embedded.openocd.conf.factory" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_device_examples" TARGET_NAME="cdc_msc" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_device_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<configuration default="false" name="rp2040" type="com.jetbrains.cidr.embedded.openocd.conf.type" factoryName="com.jetbrains.cidr.embedded.openocd.conf.factory" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="rp2040" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<openocd version="1" gdb-port="3333" telnet-port="4444" board-config="$PROJECT_DIR$/hw/bsp/rp2040/rp2040-openocd.cfg" reset-type="INIT" download-type="UPDATED_ONLY">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</openocd>
|
||||
|
4
.idea/runConfigurations/rt1010.xml
generated
4
.idea/runConfigurations/rt1010.xml
generated
@ -1,6 +1,6 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="rt1010" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "MIMXRT1011xxx5A" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="cdc_msc" TARGET_NAME="cdc_msc" CONFIG_NAME="pca10056" version="1" RUN_TARGET_PROJECT_NAME="cdc_msc" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<configuration default="false" name="rt1010" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" folderName="imxrt" PROGRAM_PARAMS="-device "MIMXRT1011xxx5A" -if swd -speed 50000 -port 25321 -nogui -singlerun -jlinkscriptfile $ProjectFileDir$/hw/bsp/imxrt/debug.jlinkscript" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="metro m7 1011 sd" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="ALWAYS" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
|
2
.idea/runConfigurations/rt1060.xml
generated
2
.idea/runConfigurations/rt1060.xml
generated
@ -1,5 +1,5 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="rt1060" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "MIMXRT1062xxx5A" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="cdc_msc" TARGET_NAME="cdc_msc" CONFIG_NAME="pca10056" version="1" RUN_TARGET_PROJECT_NAME="cdc_msc" RUN_TARGET_NAME="cdc_msc">
|
||||
<configuration default="false" name="rt1060" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" folderName="imxrt" PROGRAM_PARAMS="-device "MIMXRT1062xxx5A" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="metro m7 1011 sd" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
|
10
.idea/runConfigurations/samd21g18.xml
generated
Normal file
10
.idea/runConfigurations/samd21g18.xml
generated
Normal file
@ -0,0 +1,10 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="samd21g18" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "ATSAMD21G18" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="metro m7 1011 sd" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/samd51j19.xml
generated
Normal file
10
.idea/runConfigurations/samd51j19.xml
generated
Normal file
@ -0,0 +1,10 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="samd51j19" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "ATSAMD51J19A" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="metro m7 1011 sd" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
4
.idea/runConfigurations/stlink.xml
generated
4
.idea/runConfigurations/stlink.xml
generated
@ -1,6 +1,6 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="stlink" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-p 62847 -cp "/opt/st/stm32cubeide_1.12.1/plugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.linux64_2.0.600.202301161003/tools/bin" --frequency 24000 --swd" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="cdc_msc" TARGET_NAME="cdc_msc" version="1" RUN_TARGET_PROJECT_NAME="cdc_msc" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::62847" executable="/opt/st/stm32cubeide_1.12.1/plugins/com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.linux64_2.0.500.202301161003/tools/bin/ST-LINK_gdbserver" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<configuration default="false" name="stlink" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" folderName="stm32" PROGRAM_PARAMS="-p 62847 -cp "/opt/st/stm32cubeide_1.12.1/plugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.linux64_2.0.600.202301161003/tools/bin" --frequency 24000 --swd" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="cdc_msc" TARGET_NAME="cdc_msc" version="1" RUN_TARGET_PROJECT_NAME="cdc_msc" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::62847" executable="/opt/st/stm32cubeide_1.12.1/plugins/com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.linux64_2.0.500.202301161003/tools/bin/ST-LINK_gdbserver" warmup-ms="0" download-type="ALWAYS" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
|
2
.idea/runConfigurations/stm32g474.xml
generated
2
.idea/runConfigurations/stm32g474.xml
generated
@ -1,5 +1,5 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="stm32g474" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "stm32g474re" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="cdc_msc" TARGET_NAME="cdc_msc" version="1" RUN_TARGET_PROJECT_NAME="cdc_msc" RUN_TARGET_NAME="cdc_msc">
|
||||
<configuration default="false" name="stm32g474" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" folderName="stm32" PROGRAM_PARAMS="-device "stm32g474re" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="metro m7 1011 sd" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
|
2
.idea/runConfigurations/stm32h743.xml
generated
2
.idea/runConfigurations/stm32h743.xml
generated
@ -1,5 +1,5 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="stm32h743" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "stm32h743xi" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="cdc_msc" TARGET_NAME="cdc_msc" version="1" RUN_TARGET_PROJECT_NAME="cdc_msc" RUN_TARGET_NAME="cdc_msc">
|
||||
<configuration default="false" name="stm32h743" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" folderName="stm32" PROGRAM_PARAMS="-device "stm32h743xi" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc_freertos" CONFIG_NAME="metro m7 1011 sd" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc_freertos">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
|
10
.idea/runConfigurations/uno_r4.xml
generated
Normal file
10
.idea/runConfigurations/uno_r4.xml
generated
Normal file
@ -0,0 +1,10 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="uno_r4" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" folderName="renesas" PROGRAM_PARAMS="-device "R7FA4M1AB" -if swd -speed 20000 -port 25321 -nogui -singlerun -jlinkscriptfile $PROJECT_DIR$/hw/bsp/ra/debug.jlinkscript" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="metro m7 1011 sd" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
@ -200,6 +200,8 @@ Notable contributors
|
||||
- Add new DCD port for Microchip SAMx7x
|
||||
- Add IAR compiler support
|
||||
- Improve UAC2, CDC, DFU class driver
|
||||
- Improve stm32_fsdev, chipidea_ci_hs, lpc_ip3511 DCD
|
||||
- Host IAR Build CI & hardware in the loop (HITL) test
|
||||
|
||||
|
||||
`Full contributors list <https://github.com/hathach/tinyusb/contributors>`__
|
||||
|
159
README.rst
159
README.rst
@ -1,14 +1,24 @@
|
||||
|Build Status| |Documentation Status| |Fuzzing Status| |License|
|
||||
|
||||
Sponsors
|
||||
========
|
||||
|
||||
TinyUSB is funded by: Adafruit. Purchasing products from them helps to support this project.
|
||||
|
||||
.. figure:: docs/assets/adafruit_logo.svg
|
||||
:alt: Adafruit Logo
|
||||
:target: https://www.adafruit.com
|
||||
|
||||
TinyUSB Project
|
||||
===============
|
||||
|
||||
.. figure:: docs/assets/logo.svg
|
||||
:alt: TinyUSB
|
||||
|
||||
|Build Status| |Documentation Status| |Fuzzing Status| |License|
|
||||
|
||||
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.
|
||||
|
||||
Please take a look at the online `documentation <https://docs.tinyusb.org/>`__.
|
||||
the non-ISR task function. Check out the online `documentation <https://docs.tinyusb.org/>`__ for more details.
|
||||
|
||||
.. figure:: docs/assets/stack.svg
|
||||
:width: 500px
|
||||
@ -16,51 +26,30 @@ Please take a look at the online `documentation <https://docs.tinyusb.org/>`__.
|
||||
|
||||
::
|
||||
|
||||
.
|
||||
├── docs # Documentation
|
||||
├── examples # Sample with Makefile build support
|
||||
├── hw
|
||||
│ ├── bsp # Supported boards source files
|
||||
│ └── mcu # Low level mcu core & peripheral drivers
|
||||
├── lib # Sources from 3rd party such as freeRTOS, fatfs ...
|
||||
├── src # All sources files for TinyUSB stack itself.
|
||||
├── test # Unit tests for the stack
|
||||
└── tools # Files used internally
|
||||
.
|
||||
├── docs # Documentation
|
||||
├── examples # Examples with make and cmake build system
|
||||
├── hw
|
||||
│ ├── bsp # Supported boards source files
|
||||
│ └── mcu # Low level mcu core & peripheral drivers
|
||||
├── lib # Sources from 3rd party such as freeRTOS, fatfs ...
|
||||
├── src # All sources files for TinyUSB stack itself.
|
||||
├── test # Tests: unit test, fuzzing, hardware test
|
||||
└── tools # Files used internally
|
||||
|
||||
Supported MCUs
|
||||
==============
|
||||
|
||||
The stack supports the following MCUs:
|
||||
Getting started
|
||||
===============
|
||||
|
||||
- **Allwinner:** F1C100s/F1C200s
|
||||
- **Broadcom:** BCM2837, BCM2711
|
||||
- **Dialog:** DA1469x
|
||||
- **Espressif:** ESP32-S2, ESP32-S3
|
||||
- **GigaDevice:** GD32VF103
|
||||
- **Infineon:** XMC4500
|
||||
- **MicroChip:** SAMD11, SAMD21, SAMD51, SAME5x, SAMG55, SAML21, SAML22, SAME7x
|
||||
- **NordicSemi:** nRF52833, nRF52840, nRF5340
|
||||
- **Nuvoton:** NUC120, NUC121/NUC125, NUC126, NUC505
|
||||
- **NXP:**
|
||||
See the `online documentation <https://docs.tinyusb.org>`_ for information about using TinyUSB and how it is implemented.
|
||||
|
||||
- iMX RT Series: RT10xx, RT11xx
|
||||
- Kinetis: KL25, K32L2
|
||||
- LPC Series: 11u, 13, 15, 17, 18, 40, 43, 51u, 54, 55
|
||||
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.
|
||||
|
||||
- **Raspberry Pi:** RP2040
|
||||
- **Renesas:**
|
||||
For bugs and feature requests, please `raise an issue <https://github.com/hathach/tinyusb/issues>`_ and follow the templates there.
|
||||
|
||||
- RX Series: 63N, 65N, 72N
|
||||
- RA Series: RA4M1, RA4M3
|
||||
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.
|
||||
|
||||
- **Silabs:** EFM32GG
|
||||
- **Sony:** CXD56
|
||||
- **ST:** STM32 series: F0, F1, F2, F3, F4, F7, H7, G0, G4, L0, L1, L4, L4+, WB
|
||||
- **TI:** MSP430, MSP432E4, TM4C123
|
||||
- **ValentyUSB:** eptri
|
||||
- **WCH:** CH32V307
|
||||
|
||||
Here is the list of `Supported Devices`_ that can be used with provided examples.
|
||||
See `Porting`_ guide for adding support for new MCUs and boards.
|
||||
|
||||
Device Stack
|
||||
============
|
||||
@ -87,8 +76,12 @@ Host Stack
|
||||
|
||||
- Human Interface Device (HID): Keyboard, Mouse, Generic
|
||||
- Mass Storage Class (MSC)
|
||||
- Communication Device Class: CDC-ACM
|
||||
- Vendor serial over USB: FTDI, CP210x
|
||||
- Hub with multiple-level support
|
||||
|
||||
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.
|
||||
|
||||
TypeC PD Stack
|
||||
==============
|
||||
|
||||
@ -106,6 +99,76 @@ TinyUSB is completely thread-safe by pushing all Interrupt Service Request (ISR)
|
||||
- `RT-Thread <https://github.com/RT-Thread/rt-thread>`_: `repo <https://github.com/RT-Thread-packages/tinyusb>`_
|
||||
- **Mynewt** Due to the newt package build system, Mynewt examples are better to be on its `own repo <https://github.com/hathach/mynewt-tinyusb-example>`_
|
||||
|
||||
Supported CPUs
|
||||
==============
|
||||
|
||||
Following CPUs are supported, check out `Supported Devices`_ for comprehensive list of driver, features for each CPU.
|
||||
|
||||
+--------------+------------------------------------------------------------+
|
||||
| Manufacturer | Family |
|
||||
+==============+============================================================+
|
||||
| Allwinner | F1C100s/F1C200s |
|
||||
+--------------+------------------------------------------------------------+
|
||||
| Analog | MAX3421E (usb host shield) |
|
||||
+--------------+------------------------------------------------------------+
|
||||
| Brigetek | FT90x |
|
||||
+--------------+------------------------------------------------------------+
|
||||
| Broadcom | BCM2711, BCM2837 |
|
||||
+--------------+------------------------------------------------------------+
|
||||
| Dialog | DA1469x |
|
||||
+--------------+------------------------------------------------------------+
|
||||
| Espressif | ESP32 S2, S3 |
|
||||
+--------------+------------------------------------------------------------+
|
||||
| GigaDevice | GD32VF103 |
|
||||
+--------------+------------------------------------------------------------+
|
||||
| Infineon | XMC4500 |
|
||||
+--------------+-----+------------------------------------------------------+
|
||||
| MicroChip | SAM | D11, D21, D51, E5x, G55, L2x, E7x, S7x, V7x |
|
||||
| +-----+------------------------------------------------------+
|
||||
| | PIC | 24, 32mm, 32mk, 32mx, 32mz, dsPIC33 |
|
||||
+--------------+-----+------------------------------------------------------+
|
||||
| Mind Montion | mm32 |
|
||||
+--------------+------------------------------------------------------------+
|
||||
| NordicSemi | nRF52833, nRF52840, nRF5340 |
|
||||
+--------------+------------------------------------------------------------+
|
||||
| Nuvoton | NUC 120, 121, 125, 126, 505 |
|
||||
+--------------+---------+--------------------------------------------------+
|
||||
| NXP | iMXRT | RT10xx, RT11xx |
|
||||
| +---------+--------------------------------------------------+
|
||||
| | Kinetis | KL, K32L2 |
|
||||
| +---------+--------------------------------------------------+
|
||||
| | LPC | 11u, 13, 15, 17, 18, 40, 43, 51u, 54, 55 |
|
||||
| +---------+--------------------------------------------------+
|
||||
| | MCX | N9 |
|
||||
+--------------+---------+--------------------------------------------------+
|
||||
| Raspberry Pi | RP2040 |
|
||||
+--------------+-----+------------------------------------------------------+
|
||||
| Renesas | RX | 63N, 65N, 72N |
|
||||
+--------------+-----+------------------------------------------------------+
|
||||
| | RA | 4M1, 4M3, 6M1, 6M5 |
|
||||
+--------------+-----+------------------------------------------------------+
|
||||
| Silabs | EFM32GG12 |
|
||||
+--------------+------------------------------------------------------------+
|
||||
| Sony | CXD56 |
|
||||
+--------------+------------------------------------------------------------+
|
||||
| ST STM32 | F0, F1, F2, F3, F4, F7, H7, G0, G4, L0, L1, L4, L4+ U5, WB |
|
||||
+--------------+------------------------------------------------------------+
|
||||
| TI | MSP430, MSP432E4, TM4C123 |
|
||||
+--------------+------------------------------------------------------------+
|
||||
| ValentyUSB | eptri |
|
||||
+--------------+------------------------------------------------------------+
|
||||
| WCH | CH32F20x, CH32V307, |
|
||||
+--------------+------------------------------------------------------------+
|
||||
|
||||
License
|
||||
=======
|
||||
|
||||
All TinyUSB sources in the ``src`` folder are licensed under MIT
|
||||
license, the `Full license is here <LICENSE>`__. However, each file can be
|
||||
individually licensed especially those in ``lib`` and ``hw/mcu`` folder.
|
||||
Please make sure you understand all the license term for files you use
|
||||
in your project.
|
||||
|
||||
Docs
|
||||
====
|
||||
|
||||
@ -128,16 +191,6 @@ Docs
|
||||
- `Structure`_
|
||||
- `Porting`_
|
||||
|
||||
License
|
||||
=======
|
||||
|
||||
All TinyUSB sources in the ``src`` folder are licensed under MIT
|
||||
license, the `Full license is here <LICENSE>`__. However, each file can be
|
||||
individually licensed especially those in ``lib`` and ``hw/mcu`` folder.
|
||||
Please make sure you understand all the license term for files you use
|
||||
in your project.
|
||||
|
||||
|
||||
.. |Build Status| image:: https://github.com/hathach/tinyusb/actions/workflows/cmake_arm.yml/badge.svg
|
||||
:target: https://github.com/hathach/tinyusb/actions
|
||||
.. |Documentation Status| image:: https://readthedocs.org/projects/tinyusb/badge/?version=latest
|
||||
|
21
docs/assets/adafruit_logo.svg
Normal file
21
docs/assets/adafruit_logo.svg
Normal file
@ -0,0 +1,21 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" style="enable-background:new 0 0 1382 768;" xml:space="preserve" width="144" height="80" viewBox="14 12.81 1350 455.81">
|
||||
<style type="text/css">
|
||||
.st0{fill:#0;}
|
||||
</style>
|
||||
<rect x="0" y="0" width="1382" height="768" fill="#fff"/>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st0" d="M402.26,321.44c6.2-6.18,13.5-8.71,27.53-8.71h56.48c15.72,0,25,2.79,30.63,8.71 c7.04,6.99,9.28,15.16,9.28,41.28v104.52h-43v-17.68c-18.55,15.16-25.28,17.96-39.05,17.96h-21.09 c-13.76,0-21.07-1.68-27.24-7.83c-5.35-5.37-8.97-14.36-8.97-34.57c0-19.11,2.79-30.92,9.56-37.67c7-7.02,15.99-10.4,43.79-10.4 c14.91,0,30.36,1.71,43.01,4.5v-13.77c0-15.17-0.85-18.26-2.82-20.51c-1.98-1.71-4.78-2.28-11.24-2.28h-21.62 c-5.91,0-9.01,0.57-10.7,2.28c-2.24,2.25-2.53,5.34-3.09,14.61h-40.71C393.27,336.06,395.8,327.58,402.26,321.44z M483.18,428.75 v-25.84h-28.36c-16.32,0-20.25,1.12-23.06,3.91c-2.79,2.84-3.36,6.2-3.36,13.23c0,7.88,0.57,12.08,2.81,14.34 c2.25,2.22,5.33,2.5,10.95,2.5h12.07C463.24,436.88,469.13,436.06,483.18,428.75z"/>
|
||||
<path class="st0" d="M642.16,467.24V447.3c-19.39,16.87-26.14,20.23-38.79,20.23h-16.28c-16.32,0-25.01-2.8-31.74-9.54 c-9.26-9.26-12.93-22.78-12.93-68.01c0-45.52,4.47-58.42,14.03-67.99c6.76-6.72,15.73-9.53,31.18-9.53h16.86 c12.92,0,19.95,2.81,37.67,17.69V259.9h43v207.34H642.16z M642.16,426.5v-73.6c-9.01-4.21-15.47-6.17-22.49-6.17h-15.43 c-7.88,0-11.57,1.11-14.08,3.64c-3.93,3.64-5.03,10.13-5.03,39.6c0,29.5,1.11,35.7,5.03,39.65c2.51,2.5,6.2,3.37,14.08,3.37 h14.02C625.57,432.99,632.58,431,642.16,426.5z"/>
|
||||
<path class="st0" d="M716.83,321.44c6.17-6.18,13.49-8.71,27.52-8.71h56.49c15.73,0,24.99,2.79,30.64,8.71 c7.01,6.99,9.26,15.16,9.26,41.28v104.52h-43v-17.68c-18.54,15.16-25.29,17.96-39.05,17.96h-21.05 c-13.78,0-21.11-1.68-27.26-7.83c-5.35-5.37-9.01-14.36-9.01-34.57c0-19.11,2.81-30.92,9.56-37.67 c7.03-7.02,16.02-10.4,43.83-10.4c14.91,0,30.34,1.71,42.99,4.5v-13.77c0-15.17-0.84-18.26-2.81-20.51 c-1.94-1.71-4.79-2.28-11.24-2.28h-21.63c-5.91,0-8.99,0.57-10.67,2.28c-2.27,2.25-2.53,5.34-3.12,14.61h-40.72 C707.84,336.06,710.38,327.58,716.83,321.44z M797.74,428.75v-25.84h-28.35c-16.31,0-20.26,1.12-23.05,3.91 c-2.81,2.84-3.38,6.2-3.38,13.23c0,7.88,0.57,12.08,2.82,14.34c2.24,2.22,5.32,2.5,10.95,2.5h12.06 C777.8,436.88,783.7,436.06,797.74,428.75z"/>
|
||||
<path class="st0" d="M856.96,467.24V305.41c0-19.39,2.55-29.52,9.01-35.96c6.47-6.46,13.77-9.55,30.34-9.55h35.41v32.57h-20.82 c-5.6,0-7.28,0.57-8.96,1.96c-1.42,1.71-1.96,4.75-1.96,12.38v6.19h31.75v33.44h-31.48v120.79H856.96z"/>
|
||||
<path class="st0" d="M947.94,467.24V312.72h42.96v23.59c16.04-16.59,24.17-23.87,36.53-23.87H1044v42.42h-19.94 c-11.79,0-20.78,1.11-33.16,6.17v106.2H947.94z"/>
|
||||
<path class="st0" d="M1199.3,312.72v154.52h-43.27v-20.48c-19.66,17.69-26.13,20.77-40.18,20.77h-18.82 c-13.49,0-21.92-2.8-27.79-8.71c-6.2-6.46-9-14.59-9-37.1v-109h43.27v104.24c0,6.44,0.83,10.11,3.36,12.66 c2.53,2.5,5.06,3.37,12.64,3.37h12.39c7.28,0,13.77-1.71,24.13-6.2V312.72H1199.3z"/>
|
||||
<path class="st0" d="M1257.74,291.34h-42.42V259.9h42.42V291.34z M1257.74,467.24h-42.42V312.72h42.42V467.24z"/>
|
||||
<path class="st0" d="M1349,433.26h-18.53c-7.06,0-9.86-0.59-11.24-1.7c-1.42-1.69-1.98-3.93-1.98-10.68v-74.44H1349v-33.72 h-31.75v-21.38h-43.27v21.38v33.72v85.97c0,15.73,1.96,22.76,7.03,27.81c5.34,5.35,13.19,8.4,27.82,8.4 c11.51,0,23.04-1.68,29.78-3.36l10.39-2.7V433.26z"/>
|
||||
</g>
|
||||
</g>
|
||||
<path class="st0" d="M469.56,213.53c-1.48-9.33-6.54-12.01-18.77-15.91c-9.28-2.98-71.47-22.79-71.47-22.79 s-43.35-16.38-75.48,6.78c-4.32,3.13-8.81,6.68-13.31,10.47c3.78-4.5,7.34-8.99,10.45-13.31c23.09-32.18,6.65-75.5,6.65-75.5 s-19.91-62.13-22.92-71.44c-3.93-12.2-6.6-17.27-15.94-18.72c-9.36-1.48-13.45,2.5-20.94,12.92c-5.71,7.91-43.77,60.94-43.77,60.94 s-28.94,36.16-16.87,73.88c1.64,5.06,3.63,10.43,5.86,15.89c-3.13-5-6.3-9.76-9.46-14.05c-23.47-31.89-69.73-29.66-69.73-29.66 s-65.26-0.26-75.02-0.27c-12.83-0.05-18.46,0.95-22.76,9.37c-4.29,8.42-1.75,13.57,5.83,23.9c5.76,7.88,44.44,60.45,44.44,60.45 s25.44,38.72,65.03,38.88c5.32,0.03,11.02-0.22,16.88-0.64c-5.69,1.42-11.19,2.98-16.24,4.64c-37.59,12.46-49.74,57.17-49.74,57.17 s-20.42,61.99-23.46,71.27c-3.98,12.18-4.79,17.84,1.9,24.51c6.69,6.7,12.36,5.87,24.53,1.85c9.27-3.03,71.24-23.58,71.24-23.58 s44.66-12.24,57.04-49.85c1.68-5.06,3.2-10.55,4.63-16.22c-0.42,5.84-0.64,11.53-0.6,16.85c0.21,39.6,38.98,64.98,38.98,64.98 s52.64,38.55,60.52,44.31c10.37,7.55,15.5,10.08,23.93,5.78c8.41-4.3,9.39-9.93,9.33-22.77c-0.04-9.75-0.43-75.01-0.43-75.01 s2.18-46.27-29.76-69.68c-4.3-3.15-9.05-6.31-14.03-9.41c5.44,2.19,10.79,4.18,15.87,5.77c37.72,12.03,73.85-16.98,73.85-16.98 s52.94-38.15,60.85-43.87C467.06,226.99,471.04,222.86,469.56,213.53z M244.76,165.48c7.13,1.11,10.66,16.26,7.87,33.82 c-2.75,17.56-10.75,30.88-17.88,29.76c-7.11-1.13-10.65-16.26-7.89-33.82C229.63,177.69,237.64,164.36,244.76,165.48z M153.6,212.02c3.25-6.43,18.75-5.09,34.57,2.96c15.85,8.05,26.05,19.8,22.78,26.22c-3.27,6.41-18.75,5.1-34.59-2.95 C160.52,230.2,150.33,218.45,153.6,212.02z M201.66,299.59c-12.56,12.58-26.87,18.63-31.96,13.54 c-5.11-5.09,0.94-19.41,13.49-31.99c12.55-12.59,26.86-18.65,31.97-13.56C220.27,272.68,214.23,287.01,201.66,299.59z M270.82,329.06c-6.43,3.27-18.19-6.89-26.26-22.71c-8.08-15.84-9.43-31.34-3-34.61c6.41-3.27,18.15,6.9,26.24,22.73 C275.88,310.29,277.25,325.78,270.82,329.06z M287.49,255.75c-17.55,2.81-32.7-0.71-33.83-7.82c-1.13-7.12,12.18-15.16,29.74-17.95 c17.54-2.79,32.69,0.71,33.82,7.82C318.35,244.91,305.05,252.96,287.49,255.75z"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 5.5 KiB |
@ -1 +1 @@
|
||||
../../CODE_OF_CONDUCT.rst
|
||||
../../CODE_OF_CONDUCT.rst
|
@ -2,6 +2,148 @@
|
||||
Changelog
|
||||
*********
|
||||
|
||||
0.16.0
|
||||
======
|
||||
|
||||
- New controller driver: MAX3421e (usb host shield), rusb2 (Renesas USB2.0), ChipIdea fullspeed
|
||||
- New MCUs: MCXn9, nRF5340, STM32: G0, G4, L5, U575, U5A5, RA6m5, CH32F20x
|
||||
- Add initial TypeC PowerDelivery support with STM32G4
|
||||
- Remove submodules and use python script to manage repo dependencies #1947
|
||||
- Add CMake support for most families and boards, move build file from tools/ to examples/build_system
|
||||
- Add ETM trace support with JTrace for nrf52840, nrf5340, mcb1857, stm32h743eval, ra6m5
|
||||
- [osal] Make it possible to override the osal_task_delay() in osal_none
|
||||
- Add CDC+UAC2 composite device example
|
||||
- Enhance Hardware-in-the-loop (HIL) testing with more boards: rp2040, stm32l412nucleo, stm32f746disco, lpcxpresso43s67
|
||||
|
||||
Controller Driver (DCD & HCD)
|
||||
-----------------------------
|
||||
|
||||
- Add new ISO endpoint API: dcd_edpt_iso_alloc() and dcd_edpt_iso_activate()
|
||||
- Remove legacy driver st/synopsys
|
||||
|
||||
- EHCI
|
||||
|
||||
- [iMXRT] Add dache clean/invalidate when memory is in cacheable memory
|
||||
- Fix portsc write issue which cause problem with enumeration
|
||||
- Fix an issue when doing port reset write to portsc
|
||||
- Fix port change detect is not recognized when power on with attached device
|
||||
- Fix xfer failed with disconnected device as stalled
|
||||
- Fix error on EHCI causes xfer error in non-queued qhd which cause memory fault
|
||||
- Un-roll recursive hub removal with usbh queue
|
||||
- Fix issue when removing queue head
|
||||
- Implement hcd_edpt_abort_xfer()
|
||||
- use standard USB complete interrupt instead of custom chipidea async/period interrupt to be more compatible with other ehci implementation
|
||||
- refactor usb complete & error isr processing, merge, update. Fix EHCI QHD reuses QTD on wrong endpoint
|
||||
- Improve bus reset, fix send_setup() not carried out if halted previously
|
||||
- Fix clear qhd halted bit if not caused by STALL protocol to allow for next transfer
|
||||
|
||||
- ChipIdea Highspeed
|
||||
|
||||
- Fix control transfer issue when previous status and new setup complete in the same isr frame
|
||||
- [imxrt] Add dcache support for cache region
|
||||
|
||||
- ChipIdea Fullspeed
|
||||
|
||||
- Generalize ChipIdea Fullspeed driver for mcxn9 (port 0), kinetis
|
||||
|
||||
- nrf
|
||||
|
||||
- Fix DMA race condition with ISO OUT transfer #1946
|
||||
- Add support for nRF5340 with pca10095 board
|
||||
|
||||
- Renesas rusb2
|
||||
|
||||
- Generalize rusb2 driver for ra, rx mcus
|
||||
- rework both dcd and hcd for better multiple ports support
|
||||
- Add support for board with HS USB port: ra6m5 port1
|
||||
|
||||
- rp2040
|
||||
|
||||
- [dcd] Make writes to SIE_CTRL aware of concurrent access
|
||||
- [hcd] add hcd_frame_number(), hcd_edpt_abort_xfer() for pio-usb host
|
||||
|
||||
- stm32 fsdev:
|
||||
|
||||
- Add STM32L5 support
|
||||
- Implement dcd_edpt_iso_alloc() and dcd_edpt_iso_activate()
|
||||
|
||||
- OHCI
|
||||
|
||||
- Allows configurable root hub ports, handles SMM mode (Ref OHCI spec 5.1.1.3.3) and Bios mode (Ref OHCI spec 5.1.1.3.4)
|
||||
- Fix FrameIntervalToggle must be toggled after we write the FrameInterval (Ref OHCI Spec 7.3.1)
|
||||
- Wait PowerOnToPowerGoodTime after we enable power of the RH ports (Ref OHCI Spec 7.4.1)
|
||||
- Generate port interrupts for devices already connected during init.
|
||||
- Fix issue when removing queue head
|
||||
- Disable MIE during IRQ processing and clear HccaDoneHead on completion as per OCHI Spec Page 80
|
||||
|
||||
Device Stack
|
||||
------------
|
||||
|
||||
- Add optional hooks tud_event_hook_cb()
|
||||
- Audio (UAC2)
|
||||
|
||||
- Fix feedback EP buffer alignment.
|
||||
- Fix encoding, update example
|
||||
- Improve IN transfer
|
||||
|
||||
- Bluetooth
|
||||
|
||||
- Add historical EP compatibility for Bluetooth HCI
|
||||
|
||||
- CDC
|
||||
|
||||
- Fix line_coding alignment
|
||||
- Fix typo in cdc line coding enum
|
||||
|
||||
- MIDI
|
||||
|
||||
- Fix stream_write() always writes system messages to cable 0
|
||||
- Fix incorrect NOTE_ON, NOTE_OFF definitions
|
||||
|
||||
- USBTMC: Fix tmc488 bit order
|
||||
|
||||
- Vendor: fix read()/write() race condition
|
||||
|
||||
- Video (UVC)
|
||||
|
||||
- Add the capability for video class to handle a bulk endpoint in the streaming interface.
|
||||
|
||||
Host Stack
|
||||
----------
|
||||
|
||||
- USBH
|
||||
|
||||
- Add new APIs: tuh_interface_set(), tuh_task_event_ready(), tuh_edpt_abort_xfer(), tuh_rhport_reset_bus(), tuh_rhport_is_active()
|
||||
- Fix issue when device generate multiple attach/detach/attach when plugging in
|
||||
- Prefer application callback over built-in driver on transfer complete event
|
||||
- Correct hcd_edpt_clear_stall() API signature
|
||||
- Separate bus reset delay and contact debouncing delay in enumeration
|
||||
- Support usbh_app_driver_get_cb() for application drivers
|
||||
- Fix usbh enumeration removal race condition
|
||||
- Add optional hooks tuh_event_hook_cb()
|
||||
|
||||
- CDC
|
||||
|
||||
- Breaking: change tuh_cdc_itf_get_info() to use tuh_itf_info_t instead of tuh_cdc_info_t
|
||||
- Fix cdc host enumeration issue when device does not support line request
|
||||
- Add support for vendor usb2uart serial: ftdi, cp210x, ch9102f
|
||||
- Improve sync control API e.g tuh_cdc_set_control_line_state(), tuh_cdc_set_line_coding()
|
||||
|
||||
- HID
|
||||
|
||||
- Add new APIs tuh_hid_send_report(), tuh_hid_itf_get_info(), tuh_hid_receive_ready(), tuh_hid_send_ready(), tuh_hid_set_default_protocol()
|
||||
- Change meaning of CFG_TUH_HID to total number of HID interfaces supported. Previously CFG_TUH_HID is max number of interfaces per device which is rather limited and consume more resources than needed.
|
||||
|
||||
- HUB
|
||||
|
||||
- Fix handling of empty "status change" interrupt
|
||||
- Fix issue with hub status_change is not aligned
|
||||
|
||||
- MSC
|
||||
|
||||
- Fix bug in tuh_msc_ready()
|
||||
- Fix host msc get maxlun not using aligned section memory
|
||||
|
||||
0.15.0
|
||||
======
|
||||
|
||||
|
@ -1 +1 @@
|
||||
../../CONTRIBUTORS.rst
|
||||
../../CONTRIBUTORS.rst
|
@ -4,61 +4,61 @@ Dependencies
|
||||
|
||||
MCU low-level peripheral driver and external libraries for building TinyUSB examples
|
||||
|
||||
======================================== ============================================================== ========================================
|
||||
Path Project Commit
|
||||
======================================== ============================================================== ========================================
|
||||
hw/mcu/allwinner https://github.com/hathach/allwinner_driver.git 8e5e89e8e132c0fd90e72d5422e5d3d68232b756
|
||||
hw/mcu/bridgetek/ft9xx/ft90x-sdk https://github.com/BRTSG-FOSS/ft90x-sdk.git 91060164afe239fcb394122e8bf9eb24d3194eb1
|
||||
hw/mcu/broadcom https://github.com/adafruit/broadcom-peripherals.git 08370086080759ed54ac1136d62d2ad24c6fa267
|
||||
hw/mcu/gd/nuclei-sdk https://github.com/Nuclei-Software/nuclei-sdk.git 7eb7bfa9ea4fbeacfafe1d5f77d5a0e6ed3922e7
|
||||
hw/mcu/infineon/mtb-xmclib-cat3 https://github.com/Infineon/mtb-xmclib-cat3.git daf5500d03cba23e68c2f241c30af79cd9d63880
|
||||
hw/mcu/microchip https://github.com/hathach/microchip_driver.git 9e8b37e307d8404033bb881623a113931e1edf27
|
||||
hw/mcu/mindmotion/mm32sdk https://github.com/hathach/mm32sdk.git 0b79559eb411149d36e073c1635c620e576308d4
|
||||
hw/mcu/nordic/nrfx https://github.com/NordicSemiconductor/nrfx.git 281cc2e178fd9a470d844b3afdea9eb322a0b0e8
|
||||
hw/mcu/nuvoton https://github.com/majbthrd/nuc_driver.git 2204191ec76283371419fbcec207da02e1bc22fa
|
||||
hw/mcu/nxp/lpcopen https://github.com/hathach/nxp_lpcopen.git 43c45c85405a5dd114fff0ea95cca62837740c13
|
||||
hw/mcu/nxp/mcux-sdk https://github.com/NXPmicro/mcux-sdk.git ae2ab01d9d70ad00cd0e935c2552bd5f0e5c0294
|
||||
hw/mcu/nxp/nxp_sdk https://github.com/hathach/nxp_sdk.git 845c8fc49b6fb660f06a5c45225494eacb06f00c
|
||||
hw/mcu/raspberry_pi/Pico-PIO-USB https://github.com/sekigon-gonnoc/Pico-PIO-USB.git c3715ce94b6f6391856de56081d4d9b3e98fa93d
|
||||
hw/mcu/renesas/fsp https://github.com/renesas/fsp.git 8dc14709f2a6518b43f71efad70d900b7718d9f1
|
||||
hw/mcu/renesas/rx https://github.com/kkitayam/rx_device.git 706b4e0cf485605c32351e2f90f5698267996023
|
||||
hw/mcu/silabs/cmsis-dfp-efm32gg12b https://github.com/cmsis-packs/cmsis-dfp-efm32gg12b.git f1c31b7887669cb230b3ea63f9b56769078960bc
|
||||
hw/mcu/sony/cxd56/spresense-exported-sdk https://github.com/sonydevworld/spresense-exported-sdk.git 2ec2a1538362696118dc3fdf56f33dacaf8f4067
|
||||
hw/mcu/st/cmsis_device_f0 https://github.com/STMicroelectronics/cmsis_device_f0.git 2fc25ee22264bc27034358be0bd400b893ef837e
|
||||
hw/mcu/st/cmsis_device_f1 https://github.com/STMicroelectronics/cmsis_device_f1.git 6601104a6397299b7304fd5bcd9a491f56cb23a6
|
||||
hw/mcu/st/cmsis_device_f2 https://github.com/STMicroelectronics/cmsis_device_f2.git 182fcb3681ce116816feb41b7764f1b019ce796f
|
||||
hw/mcu/st/cmsis_device_f3 https://github.com/STMicroelectronics/cmsis_device_f3.git 5e4ee5ed7a7b6c85176bb70a9fd3c72d6eb99f1b
|
||||
hw/mcu/st/cmsis_device_f4 https://github.com/STMicroelectronics/cmsis_device_f4.git 2615e866fa48fe1ff1af9e31c348813f2b19e7ec
|
||||
hw/mcu/st/cmsis_device_f7 https://github.com/STMicroelectronics/cmsis_device_f7.git fc676ef1ad177eb874eaa06444d3d75395fc51f4
|
||||
hw/mcu/st/cmsis_device_g0 https://github.com/STMicroelectronics/cmsis_device_g0.git 08258b28ee95f50cb9624d152a1cbf084be1f9a5
|
||||
hw/mcu/st/cmsis_device_g4 https://github.com/STMicroelectronics/cmsis_device_g4.git ce822adb1dc552b3aedd13621edbc7fdae124878
|
||||
hw/mcu/st/cmsis_device_h7 https://github.com/STMicroelectronics/cmsis_device_h7.git 60dc2c913203dc8629dc233d4384dcc41c91e77f
|
||||
hw/mcu/st/cmsis_device_l0 https://github.com/STMicroelectronics/cmsis_device_l0.git 06748ca1f93827befdb8b794402320d94d02004f
|
||||
hw/mcu/st/cmsis_device_l1 https://github.com/STMicroelectronics/cmsis_device_l1.git 7f16ec0a1c4c063f84160b4cc6bf88ad554a823e
|
||||
hw/mcu/st/cmsis_device_l4 https://github.com/STMicroelectronics/cmsis_device_l4.git 6ca7312fa6a5a460b5a5a63d66da527fdd8359a6
|
||||
hw/mcu/st/cmsis_device_l5 https://github.com/STMicroelectronics/cmsis_device_l5.git d922865fc0326a102c26211c44b8e42f52c1e53d
|
||||
hw/mcu/st/cmsis_device_u5 https://github.com/STMicroelectronics/cmsis_device_u5.git bc00f3c9d8a4e25220f84c26d414902cc6bdf566
|
||||
hw/mcu/st/cmsis_device_wb https://github.com/STMicroelectronics/cmsis_device_wb.git 9c5d1920dd9fabbe2548e10561d63db829bb744f
|
||||
hw/mcu/st/stm32f0xx_hal_driver https://github.com/STMicroelectronics/stm32f0xx_hal_driver.git 0e95cd88657030f640a11e690a8a5186c7712ea5
|
||||
hw/mcu/st/stm32f1xx_hal_driver https://github.com/STMicroelectronics/stm32f1xx_hal_driver.git 1dd9d3662fb7eb2a7f7d3bc0a4c1dc7537915a29
|
||||
hw/mcu/st/stm32f2xx_hal_driver https://github.com/STMicroelectronics/stm32f2xx_hal_driver.git c75ace9b908a9aca631193ebf2466963b8ea33d0
|
||||
hw/mcu/st/stm32f3xx_hal_driver https://github.com/STMicroelectronics/stm32f3xx_hal_driver.git 1761b6207318ede021706e75aae78f452d72b6fa
|
||||
hw/mcu/st/stm32f4xx_hal_driver https://github.com/STMicroelectronics/stm32f4xx_hal_driver.git 04e99fbdabd00ab8f370f377c66b0a4570365b58
|
||||
hw/mcu/st/stm32f7xx_hal_driver https://github.com/STMicroelectronics/stm32f7xx_hal_driver.git f7ffdf6bf72110e58b42c632b0a051df5997e4ee
|
||||
hw/mcu/st/stm32g0xx_hal_driver https://github.com/STMicroelectronics/stm32g0xx_hal_driver.git 5b53e6cee664a82b16c86491aa0060e2110c00cb
|
||||
hw/mcu/st/stm32g4xx_hal_driver https://github.com/STMicroelectronics/stm32g4xx_hal_driver.git 8b4518417706d42eef5c14e56a650005abf478a8
|
||||
hw/mcu/st/stm32h7xx_hal_driver https://github.com/STMicroelectronics/stm32h7xx_hal_driver.git d8461b980b59b1625207d8c4f2ce0a9c2a7a3b04
|
||||
hw/mcu/st/stm32l0xx_hal_driver https://github.com/STMicroelectronics/stm32l0xx_hal_driver.git fbdacaf6f8c82a4e1eb9bd74ba650b491e97e17b
|
||||
hw/mcu/st/stm32l1xx_hal_driver https://github.com/STMicroelectronics/stm32l1xx_hal_driver.git 44efc446fa69ed8344e7fd966e68ed11043b35d9
|
||||
hw/mcu/st/stm32l4xx_hal_driver https://github.com/STMicroelectronics/stm32l4xx_hal_driver.git aee3d5bf283ae5df87532b781bdd01b7caf256fc
|
||||
hw/mcu/st/stm32l5xx_hal_driver https://github.com/STMicroelectronics/stm32l5xx_hal_driver.git 675c32a75df37f39d50d61f51cb0dcf53f07e1cb
|
||||
hw/mcu/st/stm32u5xx_hal_driver https://github.com/STMicroelectronics/stm32u5xx_hal_driver.git 2e1d4cdb386e33391cb261dfff4fefa92e4aa35a
|
||||
hw/mcu/st/stm32wbxx_hal_driver https://github.com/STMicroelectronics/stm32wbxx_hal_driver.git 2c5f06638be516c1b772f768456ba637f077bac8
|
||||
hw/mcu/ti https://github.com/hathach/ti_driver.git 143ed6cc20a7615d042b03b21e070197d473e6e5
|
||||
hw/mcu/wch/ch32v307 https://github.com/openwch/ch32v307.git 17761f5cf9dbbf2dcf665b7c04934188add20082
|
||||
lib/CMSIS_5 https://github.com/ARM-software/CMSIS_5.git 20285262657d1b482d132d20d755c8c330d55c1f
|
||||
lib/FreeRTOS-Kernel https://github.com/FreeRTOS/FreeRTOS-Kernel.git def7d2df2b0506d3d249334974f51e427c17a41c
|
||||
lib/lwip https://github.com/lwip-tcpip/lwip.git 159e31b689577dbf69cf0683bbaffbd71fa5ee10
|
||||
lib/sct_neopixel https://github.com/gsteiert/sct_neopixel.git e73e04ca63495672d955f9268e003cffe168fcd8
|
||||
tools/uf2 https://github.com/microsoft/uf2.git 19615407727073e36d81bf239c52108ba92e7660
|
||||
======================================== ============================================================== ========================================
|
||||
======================================== ============================================================== ======================================== =======================================================================================================================================================================================================
|
||||
Local Path Repo Commit Required by
|
||||
======================================== ============================================================== ======================================== =======================================================================================================================================================================================================
|
||||
hw/mcu/allwinner https://github.com/hathach/allwinner_driver.git 8e5e89e8e132c0fd90e72d5422e5d3d68232b756 fc100s
|
||||
hw/mcu/bridgetek/ft9xx/ft90x-sdk https://github.com/BRTSG-FOSS/ft90x-sdk.git 91060164afe239fcb394122e8bf9eb24d3194eb1 brtmm90x
|
||||
hw/mcu/broadcom https://github.com/adafruit/broadcom-peripherals.git 08370086080759ed54ac1136d62d2ad24c6fa267 broadcom_32bit broadcom_64bit
|
||||
hw/mcu/gd/nuclei-sdk https://github.com/Nuclei-Software/nuclei-sdk.git 7eb7bfa9ea4fbeacfafe1d5f77d5a0e6ed3922e7 gd32vf103
|
||||
hw/mcu/infineon/mtb-xmclib-cat3 https://github.com/Infineon/mtb-xmclib-cat3.git daf5500d03cba23e68c2f241c30af79cd9d63880 xmc4000
|
||||
hw/mcu/microchip https://github.com/hathach/microchip_driver.git 9e8b37e307d8404033bb881623a113931e1edf27 sam3x samd11 samd21 samd51 same5x same7x saml2x samg
|
||||
hw/mcu/mindmotion/mm32sdk https://github.com/hathach/mm32sdk.git 0b79559eb411149d36e073c1635c620e576308d4 mm32
|
||||
hw/mcu/nordic/nrfx https://github.com/NordicSemiconductor/nrfx.git 2527e3c8449cfd38aee41598e8af8492f410ed15 nrf
|
||||
hw/mcu/nuvoton https://github.com/majbthrd/nuc_driver.git 2204191ec76283371419fbcec207da02e1bc22fa nuc
|
||||
hw/mcu/nxp/lpcopen https://github.com/hathach/nxp_lpcopen.git 84e0bd3e43910aaf71eefd62075cf57495418312 lpc11 lpc13 lpc15 lpc17 lpc18 lpc40 lpc43
|
||||
hw/mcu/nxp/mcux-sdk https://github.com/hathach/mcux-sdk.git 950819b7de9b32f92c3edf396bc5ffb8d66e7009 kinetis_k32l2 kinetis_kl lpc51 lpc54 lpc55 mcx imxrt
|
||||
hw/mcu/raspberry_pi/Pico-PIO-USB https://github.com/sekigon-gonnoc/Pico-PIO-USB.git d00a10a8c425d0d40f81b87169102944b01f3bb3 rp2040
|
||||
hw/mcu/renesas/fsp https://github.com/renesas/fsp.git d52e5a6a59b7c638da860c2bb309b6e78e752ff8 ra
|
||||
hw/mcu/renesas/rx https://github.com/kkitayam/rx_device.git 706b4e0cf485605c32351e2f90f5698267996023 rx
|
||||
hw/mcu/silabs/cmsis-dfp-efm32gg12b https://github.com/cmsis-packs/cmsis-dfp-efm32gg12b.git f1c31b7887669cb230b3ea63f9b56769078960bc efm32
|
||||
hw/mcu/sony/cxd56/spresense-exported-sdk https://github.com/sonydevworld/spresense-exported-sdk.git 2ec2a1538362696118dc3fdf56f33dacaf8f4067 spresense
|
||||
hw/mcu/st/cmsis_device_f0 https://github.com/STMicroelectronics/cmsis_device_f0.git 2fc25ee22264bc27034358be0bd400b893ef837e stm32f0
|
||||
hw/mcu/st/cmsis_device_f1 https://github.com/STMicroelectronics/cmsis_device_f1.git 6601104a6397299b7304fd5bcd9a491f56cb23a6 stm32f1
|
||||
hw/mcu/st/cmsis_device_f2 https://github.com/STMicroelectronics/cmsis_device_f2.git 182fcb3681ce116816feb41b7764f1b019ce796f stm32f2
|
||||
hw/mcu/st/cmsis_device_f3 https://github.com/STMicroelectronics/cmsis_device_f3.git 5e4ee5ed7a7b6c85176bb70a9fd3c72d6eb99f1b stm32f3
|
||||
hw/mcu/st/cmsis_device_f4 https://github.com/STMicroelectronics/cmsis_device_f4.git 2615e866fa48fe1ff1af9e31c348813f2b19e7ec stm32f4
|
||||
hw/mcu/st/cmsis_device_f7 https://github.com/STMicroelectronics/cmsis_device_f7.git fc676ef1ad177eb874eaa06444d3d75395fc51f4 stm32f7
|
||||
hw/mcu/st/cmsis_device_g0 https://github.com/STMicroelectronics/cmsis_device_g0.git 3a23e1224417f3f2d00300ecd620495e363f2094 stm32g0
|
||||
hw/mcu/st/cmsis_device_g4 https://github.com/STMicroelectronics/cmsis_device_g4.git ce822adb1dc552b3aedd13621edbc7fdae124878 stm32g4
|
||||
hw/mcu/st/cmsis_device_h7 https://github.com/STMicroelectronics/cmsis_device_h7.git 60dc2c913203dc8629dc233d4384dcc41c91e77f stm32h7
|
||||
hw/mcu/st/cmsis_device_l0 https://github.com/STMicroelectronics/cmsis_device_l0.git 06748ca1f93827befdb8b794402320d94d02004f stm32l0
|
||||
hw/mcu/st/cmsis_device_l1 https://github.com/STMicroelectronics/cmsis_device_l1.git 7f16ec0a1c4c063f84160b4cc6bf88ad554a823e stm32l1
|
||||
hw/mcu/st/cmsis_device_l4 https://github.com/STMicroelectronics/cmsis_device_l4.git 6ca7312fa6a5a460b5a5a63d66da527fdd8359a6 stm32l4
|
||||
hw/mcu/st/cmsis_device_l5 https://github.com/STMicroelectronics/cmsis_device_l5.git d922865fc0326a102c26211c44b8e42f52c1e53d stm32l5
|
||||
hw/mcu/st/cmsis_device_u5 https://github.com/STMicroelectronics/cmsis_device_u5.git 06d7edade7167b0eafdd550bf77cfc4fa98eae2e stm32u5
|
||||
hw/mcu/st/cmsis_device_wb https://github.com/STMicroelectronics/cmsis_device_wb.git 9c5d1920dd9fabbe2548e10561d63db829bb744f stm32wb
|
||||
hw/mcu/st/stm32f0xx_hal_driver https://github.com/STMicroelectronics/stm32f0xx_hal_driver.git 0e95cd88657030f640a11e690a8a5186c7712ea5 stm32f0
|
||||
hw/mcu/st/stm32f1xx_hal_driver https://github.com/STMicroelectronics/stm32f1xx_hal_driver.git 1dd9d3662fb7eb2a7f7d3bc0a4c1dc7537915a29 stm32f1
|
||||
hw/mcu/st/stm32f2xx_hal_driver https://github.com/STMicroelectronics/stm32f2xx_hal_driver.git c75ace9b908a9aca631193ebf2466963b8ea33d0 stm32f2
|
||||
hw/mcu/st/stm32f3xx_hal_driver https://github.com/STMicroelectronics/stm32f3xx_hal_driver.git 1761b6207318ede021706e75aae78f452d72b6fa stm32f3
|
||||
hw/mcu/st/stm32f4xx_hal_driver https://github.com/STMicroelectronics/stm32f4xx_hal_driver.git 04e99fbdabd00ab8f370f377c66b0a4570365b58 stm32f4
|
||||
hw/mcu/st/stm32f7xx_hal_driver https://github.com/STMicroelectronics/stm32f7xx_hal_driver.git f7ffdf6bf72110e58b42c632b0a051df5997e4ee stm32f7
|
||||
hw/mcu/st/stm32g0xx_hal_driver https://github.com/STMicroelectronics/stm32g0xx_hal_driver.git e911b12c7f67084d7f6b76157a4c0d4e2ec3779c stm32g0
|
||||
hw/mcu/st/stm32g4xx_hal_driver https://github.com/STMicroelectronics/stm32g4xx_hal_driver.git 8b4518417706d42eef5c14e56a650005abf478a8 stm32g4
|
||||
hw/mcu/st/stm32h7xx_hal_driver https://github.com/STMicroelectronics/stm32h7xx_hal_driver.git d8461b980b59b1625207d8c4f2ce0a9c2a7a3b04 stm32h7
|
||||
hw/mcu/st/stm32l0xx_hal_driver https://github.com/STMicroelectronics/stm32l0xx_hal_driver.git fbdacaf6f8c82a4e1eb9bd74ba650b491e97e17b stm32l0
|
||||
hw/mcu/st/stm32l1xx_hal_driver https://github.com/STMicroelectronics/stm32l1xx_hal_driver.git 44efc446fa69ed8344e7fd966e68ed11043b35d9 stm32l1
|
||||
hw/mcu/st/stm32l4xx_hal_driver https://github.com/STMicroelectronics/stm32l4xx_hal_driver.git aee3d5bf283ae5df87532b781bdd01b7caf256fc stm32l4
|
||||
hw/mcu/st/stm32l5xx_hal_driver https://github.com/STMicroelectronics/stm32l5xx_hal_driver.git 675c32a75df37f39d50d61f51cb0dcf53f07e1cb stm32l5
|
||||
hw/mcu/st/stm32u5xx_hal_driver https://github.com/STMicroelectronics/stm32u5xx_hal_driver.git 4d93097a67928e9377e655ddd14622adc31b9770 stm32u5
|
||||
hw/mcu/st/stm32wbxx_hal_driver https://github.com/STMicroelectronics/stm32wbxx_hal_driver.git 2c5f06638be516c1b772f768456ba637f077bac8 stm32wb
|
||||
hw/mcu/ti https://github.com/hathach/ti_driver.git 143ed6cc20a7615d042b03b21e070197d473e6e5 msp430 msp432e4 tm4c123
|
||||
hw/mcu/wch/ch32f20x https://github.com/openwch/ch32f20x.git 77c4095087e5ed2c548ec9058e655d0b8757663b ch32f20x
|
||||
hw/mcu/wch/ch32v307 https://github.com/openwch/ch32v307.git 17761f5cf9dbbf2dcf665b7c04934188add20082 ch32v307
|
||||
lib/CMSIS_5 https://github.com/ARM-software/CMSIS_5.git 20285262657d1b482d132d20d755c8c330d55c1f imxrt kinetis_k32l2 kinetis_kl lpc51 lpc54 lpc55 mcx mm32 msp432e4 nrf ra saml2xstm32f0 stm32f1 stm32f2 stm32f3 stm32f4 stm32f7 stm32g0 stm32g4 stm32h7 stm32l0 stm32l1 stm32l4 stm32l5 stm32u5 stm32wb
|
||||
lib/FreeRTOS-Kernel https://github.com/FreeRTOS/FreeRTOS-Kernel.git 4ff01a7a4a51f53b44496aefee1e3c0071b7b173 all
|
||||
lib/lwip https://github.com/lwip-tcpip/lwip.git 159e31b689577dbf69cf0683bbaffbd71fa5ee10 all
|
||||
lib/sct_neopixel https://github.com/gsteiert/sct_neopixel.git e73e04ca63495672d955f9268e003cffe168fcd8 lpc55
|
||||
tools/uf2 https://github.com/microsoft/uf2.git 19615407727073e36d81bf239c52108ba92e7660 all
|
||||
======================================== ============================================================== ======================================== =======================================================================================================================================================================================================
|
||||
|
@ -5,8 +5,7 @@ Getting Started
|
||||
Add TinyUSB to your project
|
||||
---------------------------
|
||||
|
||||
It is relatively simple to incorporate tinyusb to your (existing) project
|
||||
|
||||
It is relatively simple to incorporate tinyusb to your project
|
||||
|
||||
* Copy or ``git submodule`` this repo into your project in a subfolder. Let's say it is *your_project/tinyusb*
|
||||
* Add all the .c in the ``tinyusb/src`` folder to your project
|
||||
@ -46,6 +45,26 @@ For your convenience, TinyUSB contains a handful of examples for both host and d
|
||||
|
||||
Some ports will also require a port-specific SDK (e.g. RP2040) or binary (e.g. Sony Spresense) to build examples. They are out of scope for tinyusb, you should download/install it first according to its manufacturer guide.
|
||||
|
||||
Dependencies
|
||||
^^^^^^^^^^^^
|
||||
|
||||
The hardware code is located in ``hw/bsp`` folder, and is organized by family/boards. e.g raspberry_pi_pico is located in ``hw/bsp/rp2040/boards/raspberry_pi_pico`` where FAMILY=rp2040 and BOARD=raspberry_pi_pico. Before building, we firstly need to download dependencies such as: MCU low-level peripheral driver and external libraries e.g FreeRTOS (required by some examples). We can do that by either ways:
|
||||
|
||||
1. Run ``tools/get_deps.py {FAMILY}`` script to download all dependencies for a family as follow. Note: For TinyUSB developer to download all dependencies, use FAMILY=all.
|
||||
|
||||
.. code-block::
|
||||
|
||||
$ python tools/get_deps.py rp2040
|
||||
|
||||
2. Or run the ``get-deps`` target in one of the example folder as follow.
|
||||
|
||||
.. code-block::
|
||||
|
||||
$ cd examples/device/cdc_msc
|
||||
$ make BOARD=raspberry_pi_pico get-deps
|
||||
|
||||
You only need to do this once per family. Check out `complete list of dependencies and their designated path here <dependencies.rst>`_
|
||||
|
||||
Build
|
||||
^^^^^
|
||||
|
||||
@ -55,19 +74,12 @@ To build example, first change directory to an example folder.
|
||||
|
||||
$ cd examples/device/cdc_msc
|
||||
|
||||
Before building, we firstly need to download dependencies such as: MCU low-level peripheral driver and external libraries e.g FreeRTOS (required by some examples). Run the ``get-deps`` target in one of the example folder as follow. You only need to do this once per mcu. Check out `complete list of dependencies and their designated path here <dependencies.rst>`_
|
||||
|
||||
.. code-block::
|
||||
|
||||
$ make BOARD=raspberry_pi_pico get-deps
|
||||
|
||||
Then compile with ``make BOARD=[board_name] all``\ , for example
|
||||
Then compile with ``make BOARD={board_name} all`` , for example
|
||||
|
||||
.. code-block::
|
||||
|
||||
$ make BOARD=raspberry_pi_pico all
|
||||
|
||||
Note: ``BOARD`` can be found as directory name in ``hw/bsp``\ , either in its family/boards or directly under bsp (no family).
|
||||
Note: some examples especially those that uses Vendor class (e.g webUSB) may requires udev permission on Linux (and/or macOS) to access usb device. It depends on your OS distro, typically copy ``99-tinyusb.rules`` and reload your udev is good to go
|
||||
|
||||
.. code-block::
|
||||
@ -75,8 +87,8 @@ Note: some examples especially those that uses Vendor class (e.g webUSB) may req
|
||||
$ cp examples/device/99-tinyusb.rules /etc/udev/rules.d/
|
||||
$ sudo udevadm control --reload-rules && sudo udevadm trigger
|
||||
|
||||
Port Selection
|
||||
~~~~~~~~~~~~~~
|
||||
RootHub Port Selection
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If a board has several ports, one port is chosen by default in the individual board.mk file. Use option ``PORT=x`` To choose another port. For example to select the HS port of a STM32F746Disco board, use:
|
||||
|
||||
|
@ -8,6 +8,12 @@ Supported MCUs
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| Manufacturer | Family | Device | Host | Highspeed | Driver | Note |
|
||||
+==============+=======================+========+======+===========+===================+==============+
|
||||
| Allwinner | F1C100s/F1C200s | ✔ | | ✔ | sunxi | musb variant |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| Analog | MAX3421E | | ✔ | ✖ | max3421 | via SPI |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| Brigetek | FT90x | ✔ | | ✔ | ft9xx | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| Broadcom | BCM2711, BCM2837 | ✔ | | ✔ | dwc2 | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| Dialog | DA1469x | ✔ | ✖ | ✖ | da146xx | |
|
||||
@ -17,36 +23,46 @@ Supported MCUs
|
||||
| GigaDevice | GD32VF103 | ✔ | | ✖ | dwc2 | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| Infineon | XMC4500 | ✔ | | ✖ | dwc2 | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| MicroChip | SAM D11, D21 | ✔ | | ✖ | samd | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | SAM D51, E5x | ✔ | | ✖ | samd | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | SAM G55 | ✔ | | ✖ | samg | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | SAM L21, L22 | ✔ | | ✖ | samd | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | SAM E70,S70,V70,V71 | ✔ | | ✔ | samx7x | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
+--------------+-----+-----------------+--------+------+-----------+-------------------+--------------+
|
||||
| MicroChip | SAM | D11, D21 | ✔ | | ✖ | samd | |
|
||||
| | +-----------------+--------+------+-----------+-------------------+--------------+
|
||||
| | | D51, E5x | ✔ | | ✖ | samd | |
|
||||
| | +-----------------+--------+------+-----------+-------------------+--------------+
|
||||
| | | G55 | ✔ | | ✖ | samg | |
|
||||
| | +-----------------+--------+------+-----------+-------------------+--------------+
|
||||
| | | L21, L22 | ✔ | | ✖ | samd | |
|
||||
| | +-----------------+--------+------+-----------+-------------------+--------------+
|
||||
| | | E70,S70,V70,V71 | ✔ | | ✔ | samx7x | |
|
||||
| +-----+-----------------+--------+------+-----------+-------------------+--------------+
|
||||
| | PIC | 24 | ✔ | | | pic | ci_fs variant|
|
||||
| | +-----------------+--------+------+-----------+-------------------+--------------+
|
||||
| | | 32 mm, mk, mx | ✔ | | | pic | ci_fs variant|
|
||||
| | +-----------------+--------+------+-----------+-------------------+--------------+
|
||||
| | | dsPIC33 | ✔ | | | pic | ci_fs variant|
|
||||
| | +-----------------+--------+------+-----------+-------------------+--------------+
|
||||
| | | 32mz | ✔ | | | pic32mz | musb variant |
|
||||
+--------------+-----+-----------------+--------+------+-----------+-------------------+--------------+
|
||||
| Mind Montion | mm32 | ✔ | | ✖ | mm32f327x_otg | ci_fs variant|
|
||||
+--------------+-----+-----------------+--------+------+-----------+-------------------+--------------+
|
||||
| NordicSemi | nRF52833, nRF52840 | ✔ | ✖ | ✖ | nrf5x | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | nRF5340 | ✔ | ✖ | ✖ | nrf5x | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| Nuvoton | NUC120 | ✔ | ✖ | ✖ | | |
|
||||
| Nuvoton | NUC120 | ✔ | ✖ | ✖ | nuc120 | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | NUC121/NUC125 | ✔ | ✖ | ✖ | | |
|
||||
| | NUC121/NUC125 | ✔ | ✖ | ✖ | nuc121 | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | NUC126 | ✔ | ✖ | ✖ | | |
|
||||
| | NUC126 | ✔ | ✖ | ✖ | nuc121 | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | NUC505 | ✔ | | ✔ | | |
|
||||
| | NUC505 | ✔ | | ✔ | nuc505 | |
|
||||
+--------------+---------+-------------+--------+------+-----------+-------------------+--------------+
|
||||
| NXP | iMXRT | RT10xx | ✔ | ✔ | ✔ | ci_hs | |
|
||||
| | +-------------+--------+------+-----------+-------------------+--------------+
|
||||
| | | RT11xx | ✔ | ✔ | ✔ | ci_hs | |
|
||||
| +---------+-------------+--------+------+-----------+-------------------+--------------+
|
||||
| | Kinetis | KL25 | ✔ | ⚠ | ✖ | | |
|
||||
| | Kinetis | KL | ✔ | ⚠ | ✖ | ci_fs, khci | |
|
||||
| | +-------------+--------+------+-----------+-------------------+--------------+
|
||||
| | | K32L2 | ✔ | | ✖ | | |
|
||||
| | | K32L2 | ✔ | | ✖ | khci | ci_fs variant|
|
||||
| +---------+-------------+--------+------+-----------+-------------------+--------------+
|
||||
| | LPC | 11u, 13, 15 | ✔ | ✖ | ✖ | lpc_ip3511 | |
|
||||
| | +-------------+--------+------+-----------+-------------------+--------------+
|
||||
@ -59,12 +75,16 @@ Supported MCUs
|
||||
| | | 54 | ✔ | | ✔ | lpc_ip3511 | |
|
||||
| | +-------------+--------+------+-----------+-------------------+--------------+
|
||||
| | | 55 | ✔ | | ✔ | lpc_ip3511 | |
|
||||
| +---------+-------------+--------+------+-----------+-------------------+--------------+
|
||||
| | MCX | N9 | ✔ | | ✔ | ci_fs, ci_hs | |
|
||||
+--------------+---------+-------------+--------+------+-----------+-------------------+--------------+
|
||||
| Raspberry Pi | RP2040 | ✔ | ✔ | ✖ | rp2040, pio_usb | |
|
||||
+--------------+-----+-----------------+--------+------+-----------+-------------------+--------------+
|
||||
| Renesas | RX | 63N, 65N, 72N | ✔ | ✔ | ✖ | rusb2 | |
|
||||
| +-----+-----------------+--------+------+-----------+-------------------+--------------+
|
||||
| | RA | XXX | ✔ | ✔ | | rusb2 | |
|
||||
| | RA | 4M1, 4M3, 6M1 | ✔ | ✔ | ✖ | rusb2 | |
|
||||
| | +-----------------+--------+------+-----------+-------------------+--------------+
|
||||
| | | 6M5 | ✔ | ✔ | ✔ | rusb2 | |
|
||||
+--------------+-----+-----------------+--------+------+-----------+-------------------+--------------+
|
||||
| Silabs | EFM32GG12 | ✔ | | ✖ | dwc2 | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
@ -96,7 +116,7 @@ Supported MCUs
|
||||
| +----+------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | L4+ | ✔ | | | dwc2 | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | U5 | ⚠ | | | dwc2 | |
|
||||
| | U5 | ✔ | | ✔ | dwc2 | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | WBx5 | ✔ | | | stm32_fsdev | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
@ -109,6 +129,8 @@ Supported MCUs
|
||||
| ValentyUSB | eptri | ✔ | ✖ | ✖ | eptri | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| WCH | CH32V307 | ✔ | | ✔ | ch32v307 | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | CH32F20x | ✔ | | ✔ | ch32f205 | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
|
||||
|
||||
@ -175,7 +197,7 @@ SAMD11 & SAMD21
|
||||
- `Adafruit Feather M0 Express <https://www.adafruit.com/product/3403>`__
|
||||
- `Adafruit ItsyBitsy M0 Express <https://www.adafruit.com/product/3727>`__
|
||||
- `Adafruit Metro M0 Express <https://www.adafruit.com/product/3505>`__
|
||||
- `Great Scott Gadgets LUNA <https://greatscottgadgets.com/luna/>`__
|
||||
- `Great Scott Gadgets Cynthion <https://greatscottgadgets.com/cynthion/>`__
|
||||
- `Microchip SAMD11 Xplained Pro <https://www.microchip.com/developmenttools/ProductDetails/atsamd11-xpro>`__
|
||||
- `Microchip SAMD21 Xplained Pro <https://www.microchip.com/DevelopmentTools/ProductDetails/ATSAMD21-XPRO>`__
|
||||
- `Seeeduino Xiao <https://www.seeedstudio.com/Seeeduino-XIAO-Arduino-Microcontroller-SAMD21-Cortex-M0+-p-4426.html>`__
|
||||
@ -278,7 +300,6 @@ LPC 18-43
|
||||
- `Embedded Artists LPC4357 Developer Kit <http://www.embeddedartists.com/products/kits/lpc4357_kit.php>`__
|
||||
- `Keil MCB1800 Evaluation Board <http://www.keil.com/mcb1800>`__
|
||||
- `LPCXpresso18S37 Development Board <https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc4000-cortex-m4/lpcxpresso18s37-development-board:OM13076>`__
|
||||
- `NGX LPC4330-Xplorer <https://www.nxp.com/design/designs/lpc4330-xplorer-board:OM13027>`__
|
||||
|
||||
LPC 51
|
||||
^^^^^^
|
||||
@ -415,4 +436,5 @@ Tomu
|
||||
WCH
|
||||
---
|
||||
|
||||
- `CH32V307V-R1-1v0 <https://lcsc.com/product-detail/Development-Boards-Kits_WCH-Jiangsu-Qin-Heng-CH32V307V-EVT-R1_C2943980.html>`
|
||||
- `CH32V307V-R1-1v0 <https://lcsc.com/product-detail/Development-Boards-Kits_WCH-Jiangsu-Qin-Heng-CH32V307V-EVT-R1_C2943980.html>`__
|
||||
- `CH32F205R-R0-1v0 <https://github.com/openwch/ch32f20x/blob/main/EVT/PUB/CH32F20x%20Evaluation%20Board%20Reference-EN.pdf>`__
|
||||
|
17
examples/build_system/cmake/cpu/cortex-m23.cmake
Normal file
17
examples/build_system/cmake/cpu/cortex-m23.cmake
Normal file
@ -0,0 +1,17 @@
|
||||
if (TOOLCHAIN STREQUAL "gcc")
|
||||
set(TOOLCHAIN_COMMON_FLAGS
|
||||
-mthumb
|
||||
-mcpu=cortex-m23
|
||||
-mfloat-abi=soft
|
||||
)
|
||||
|
||||
set(FREERTOS_PORT GCC_ARM_CM0 CACHE INTERNAL "")
|
||||
|
||||
elseif (TOOLCHAIN STREQUAL "iar")
|
||||
set(TOOLCHAIN_COMMON_FLAGS
|
||||
--cpu cortex-m23
|
||||
)
|
||||
|
||||
set(FREERTOS_PORT IAR_ARM_CM0 CACHE INTERNAL "")
|
||||
|
||||
endif ()
|
@ -29,7 +29,7 @@ list(APPEND TOOLCHAIN_COMMON_FLAGS
|
||||
-fno-strict-aliasing
|
||||
)
|
||||
|
||||
set(TOOLCHAIN_EXE_LINKER_FLAGS
|
||||
list(APPEND TOOLCHAIN_EXE_LINKER_FLAGS
|
||||
-Wl,--print-memory-usage
|
||||
-Wl,--gc-sections
|
||||
-Wl,--cref
|
14
examples/build_system/make/cpu/cortex-m23.mk
Normal file
14
examples/build_system/make/cpu/cortex-m23.mk
Normal file
@ -0,0 +1,14 @@
|
||||
ifeq ($(TOOLCHAIN),gcc)
|
||||
CFLAGS += \
|
||||
-mthumb \
|
||||
-mcpu=cortex-m23 \
|
||||
-mfloat-abi=soft \
|
||||
|
||||
else ifeq ($(TOOLCHAIN),iar)
|
||||
# IAR Flags
|
||||
CFLAGS += --cpu cortex-m23
|
||||
ASFLAGS += --cpu cortex-m23
|
||||
endif
|
||||
|
||||
# For freeRTOS port source
|
||||
FREERTOS_PORTABLE_SRC ?= $(FREERTOS_PORTABLE_PATH)/ARM_CM23
|
@ -2,19 +2,15 @@
|
||||
# Common make definition for all examples
|
||||
# ---------------------------------------
|
||||
|
||||
# Supported toolchain: gcc, iar
|
||||
TOOLCHAIN ?= gcc
|
||||
|
||||
#-------------- TOP and CURRENT_PATH ------------
|
||||
|
||||
# Set TOP to be the path to get from the current directory (where make was
|
||||
# invoked) to the top of the tree. $(lastword $(MAKEFILE_LIST)) returns
|
||||
# the name of this makefile relative to where make was invoked.
|
||||
# Set TOP to be the path to get from the current directory (where make was invoked) to the top of the tree.
|
||||
# $(lastword $(MAKEFILE_LIST)) returns the name of this makefile relative to where make was invoked.
|
||||
THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST))
|
||||
|
||||
# strip off /tools/top.mk to get for example ../../..
|
||||
# strip off /examples/build_system/make to get for example ../../..
|
||||
# and Set TOP to an absolute path
|
||||
TOP = $(abspath $(subst make.mk,..,$(THIS_MAKEFILE)))
|
||||
TOP = $(abspath $(subst make.mk,../../..,$(THIS_MAKEFILE)))
|
||||
|
||||
# Set CURRENT_PATH to the relative path from TOP to the current directory, ie examples/device/cdc_msc_freertos
|
||||
CURRENT_PATH = $(subst $(TOP)/,,$(abspath .))
|
||||
@ -26,9 +22,6 @@ ifeq '$(findstring ;,$(PATH))' ';'
|
||||
CMDEXE := 1
|
||||
|
||||
# makefile shell commands should use syntax for DOS CMD, not unix sh
|
||||
# Unfortunately, SHELL may point to sh or bash, which can't accept DOS syntax.
|
||||
# We can't just use sh, because while sh and/or bash shell may be available,
|
||||
# many Windows environments won't have utilities like realpath used below, so...
|
||||
# Force DOS command shell on Windows.
|
||||
SHELL := cmd.exe
|
||||
endif
|
||||
@ -41,7 +34,6 @@ __check_defined = \
|
||||
$(if $(value $1),, \
|
||||
$(error Undefined make flag: $1$(if $2, ($2))))
|
||||
|
||||
|
||||
# Build directory
|
||||
BUILD := _build/$(BOARD)
|
||||
|
||||
@ -73,20 +65,19 @@ ifeq ($(FAMILY),)
|
||||
else
|
||||
# Include Family and Board specific defs
|
||||
include $(TOP)/$(FAMILY_PATH)/family.mk
|
||||
|
||||
SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(FAMILY_PATH)/*.c))
|
||||
endif
|
||||
|
||||
#-------------- Cross Compiler ------------
|
||||
#-------------- Toolchain ------------
|
||||
|
||||
# Supported toolchain: gcc, iar
|
||||
TOOLCHAIN ?= gcc
|
||||
|
||||
# Can be set by board, default to ARM GCC
|
||||
CROSS_COMPILE ?= arm-none-eabi-
|
||||
|
||||
ifeq ($(TOOLCHAIN),iar)
|
||||
CC := iccarm
|
||||
endif
|
||||
|
||||
ifeq ($(CC),iccarm)
|
||||
USE_IAR = 1
|
||||
endif
|
||||
|
||||
@ -105,17 +96,24 @@ endif
|
||||
#-------------- Source files and compiler flags --------------
|
||||
# tinyusb makefile
|
||||
include $(TOP)/src/tinyusb.mk
|
||||
SRC_C += $(TINYUSB_SRC_C)
|
||||
|
||||
# Include all source C in family & board folder
|
||||
SRC_C += hw/bsp/board.c
|
||||
SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(BOARD_PATH)/*.c))
|
||||
|
||||
SRC_C += $(TINYUSB_SRC_C)
|
||||
|
||||
INC += \
|
||||
$(TOP)/$(FAMILY_PATH) \
|
||||
$(TOP)/src \
|
||||
|
||||
BOARD_UPPER = $(subst a,A,$(subst b,B,$(subst c,C,$(subst d,D,$(subst e,E,$(subst f,F,$(subst g,G,$(subst h,H,$(subst i,I,$(subst j,J,$(subst k,K,$(subst l,L,$(subst m,M,$(subst n,N,$(subst o,O,$(subst p,P,$(subst q,Q,$(subst r,R,$(subst s,S,$(subst t,T,$(subst u,U,$(subst v,V,$(subst w,W,$(subst x,X,$(subst y,Y,$(subst z,Z,$(subst -,_,$(BOARD))))))))))))))))))))))))))))
|
||||
CFLAGS += -DBOARD_$(BOARD_UPPER)
|
||||
|
||||
# use max3421 as host controller
|
||||
ifeq (${MAX3421_HOST},1)
|
||||
SRC_C += src/portable/analog/max3421/hcd_max3421.c
|
||||
CFLAGS += -DCFG_TUH_MAX3421=1
|
||||
endif
|
||||
|
||||
# Log level is mapped to TUSB DEBUG option
|
||||
ifneq ($(LOG),)
|
||||
@ -139,8 +137,8 @@ endif
|
||||
|
||||
# CPU specific flags
|
||||
ifdef CPU_CORE
|
||||
include $(TOP)/tools/make/cpu/$(CPU_CORE).mk
|
||||
include ${TOP}/examples/build_system/make/cpu/$(CPU_CORE).mk
|
||||
endif
|
||||
|
||||
# toolchain specific
|
||||
include $(TOP)/tools/make/toolchain/arm_$(TOOLCHAIN).mk
|
||||
include ${TOP}/examples/build_system/make/toolchain/arm_$(TOOLCHAIN).mk
|
@ -37,7 +37,7 @@ vpath %.c . $(TOP)
|
||||
vpath %.s . $(TOP)
|
||||
vpath %.S . $(TOP)
|
||||
|
||||
include $(TOP)/tools/make/toolchain/arm_$(TOOLCHAIN)_rules.mk
|
||||
include ${TOP}/examples/build_system/make/toolchain/arm_$(TOOLCHAIN)_rules.mk
|
||||
|
||||
|
||||
OBJ_DIRS = $(sort $(dir $(OBJ)))
|
||||
@ -72,7 +72,7 @@ endif
|
||||
# get depenecies
|
||||
.PHONY: get-deps
|
||||
get-deps:
|
||||
$(PYTHON) $(TOP)/tools/get_deps.py $(DEPS_SUBMODULES)
|
||||
$(PYTHON) $(TOP)/tools/get_deps.py ${FAMILY}
|
||||
|
||||
.PHONY: size
|
||||
size: $(BUILD)/$(PROJECT).elf
|
||||
@ -88,7 +88,7 @@ linkermap: $(BUILD)/$(PROJECT).elf
|
||||
# Flash Targets
|
||||
# ---------------------------------------
|
||||
|
||||
# Jlink binary
|
||||
# --------------- Jlink -----------------
|
||||
ifeq ($(OS),Windows_NT)
|
||||
JLINKEXE = JLink.exe
|
||||
else
|
||||
@ -99,24 +99,23 @@ endif
|
||||
JLINK_IF ?= swd
|
||||
|
||||
# Jlink script
|
||||
define jlink_script
|
||||
halt
|
||||
loadfile $^
|
||||
r
|
||||
go
|
||||
exit
|
||||
endef
|
||||
export jlink_script
|
||||
$(BUILD)/$(BOARD).jlink: $(BUILD)/$(PROJECT).hex
|
||||
@echo halt > $@
|
||||
@echo loadfile $^ >> $@
|
||||
@echo r >> $@
|
||||
@echo go >> $@
|
||||
@echo exit >> $@
|
||||
|
||||
# Flash using jlink
|
||||
flash-jlink: $(BUILD)/$(PROJECT).hex
|
||||
@echo "$$jlink_script" > $(BUILD)/$(BOARD).jlink
|
||||
$(JLINKEXE) -device $(JLINK_DEVICE) -if $(JLINK_IF) -JTAGConf -1,-1 -speed auto -CommandFile $(BUILD)/$(BOARD).jlink
|
||||
flash-jlink: $(BUILD)/$(BOARD).jlink
|
||||
$(JLINKEXE) -device $(JLINK_DEVICE) -if $(JLINK_IF) -JTAGConf -1,-1 -speed auto -CommandFile $<
|
||||
|
||||
# --------------- stm32 cube programmer -----------------
|
||||
# Flash STM32 MCU using stlink with STM32 Cube Programmer CLI
|
||||
flash-stlink: $(BUILD)/$(PROJECT).elf
|
||||
STM32_Programmer_CLI --connect port=swd --write $< --go
|
||||
|
||||
# --------------- xfel -----------------
|
||||
$(BUILD)/$(PROJECT)-sunxi.bin: $(BUILD)/$(PROJECT).bin
|
||||
$(PYTHON) $(TOP)/tools/mksunxi.py $< $@
|
||||
|
||||
@ -124,18 +123,23 @@ flash-xfel: $(BUILD)/$(PROJECT)-sunxi.bin
|
||||
xfel spinor write 0 $<
|
||||
xfel reset
|
||||
|
||||
# Flash using pyocd
|
||||
# --------------- pyocd -----------------
|
||||
PYOCD_OPTION ?=
|
||||
flash-pyocd: $(BUILD)/$(PROJECT).hex
|
||||
pyocd flash -t $(PYOCD_TARGET) $(PYOCD_OPTION) $<
|
||||
#pyocd reset -t $(PYOCD_TARGET)
|
||||
|
||||
# Flash using openocd
|
||||
# --------------- openocd -----------------
|
||||
OPENOCD_OPTION ?=
|
||||
flash-openocd: $(BUILD)/$(PROJECT).elf
|
||||
openocd $(OPENOCD_OPTION) -c "program $< verify reset exit"
|
||||
|
||||
# flash with Black Magic Probe
|
||||
# --------------- dfu-util -----------------
|
||||
DFU_UTIL_OPTION ?= -a 0
|
||||
flash-dfu-util: $(BUILD)/$(PROJECT).bin
|
||||
dfu-util -R $(DFU_UTIL_OPTION) -D $<
|
||||
|
||||
# --------------- Black Magic -----------------
|
||||
# This symlink is created by https://github.com/blacksphere/blackmagic/blob/master/driver/99-blackmagic.rules
|
||||
BMP ?= /dev/ttyBmpGdb
|
||||
|
@ -9,6 +9,9 @@ GDB = $(CROSS_COMPILE)gdb
|
||||
OBJCOPY = $(CROSS_COMPILE)objcopy
|
||||
SIZE = $(CROSS_COMPILE)size
|
||||
|
||||
CC_VERSION := $(shell $(CC) -dumpversion)
|
||||
CC_VERSION_MAJOR = $(firstword $(subst ., ,$(CC_VERSION)))
|
||||
|
||||
# ---------------------------------------
|
||||
# Compiler Flags
|
||||
# ---------------------------------------
|
||||
@ -65,7 +68,12 @@ LDFLAGS += \
|
||||
-Wl,-cref \
|
||||
-Wl,-gc-sections \
|
||||
|
||||
# Some toolchain such as renesas rx does not support --print-memory-usage flags
|
||||
# renesas rx does not support --print-memory-usage flags
|
||||
ifneq ($(FAMILY),rx)
|
||||
LDFLAGS += -Wl,--print-memory-usage
|
||||
endif
|
||||
|
||||
# from version 12
|
||||
ifeq ($(shell expr $(CC_VERSION_MAJOR) \>= 12),1)
|
||||
LDFLAGS += -Wl,--no-warn-rwx-segment
|
||||
endif
|
@ -31,10 +31,6 @@ ifdef LD_FILE_GCC
|
||||
LDFLAGS += -Wl,-T,$(TOP)/$(LD_FILE_GCC)
|
||||
endif
|
||||
|
||||
ifneq ($(SKIP_NANOLIB), 1)
|
||||
LDFLAGS += --specs=nosys.specs --specs=nano.specs
|
||||
endif
|
||||
|
||||
ASFLAGS += $(CFLAGS)
|
||||
|
||||
LIBS_GCC ?= -lgcc -lm -lnosys
|
||||
@ -65,9 +61,10 @@ $(BUILD)/obj/%_asm.o: %.S
|
||||
@echo AS $(notdir $@)
|
||||
@$(AS) $(ASFLAGS) -c -o $@ $<
|
||||
|
||||
OBJCOPY_BIN_OPTION ?=
|
||||
$(BUILD)/$(PROJECT).bin: $(BUILD)/$(PROJECT).elf
|
||||
@echo CREATE $@
|
||||
@$(OBJCOPY) -O binary $^ $@
|
||||
$(OBJCOPY) -O binary $(OBJCOPY_BIN_OPTION) $^ $@
|
||||
|
||||
$(BUILD)/$(PROJECT).hex: $(BUILD)/$(PROJECT).elf
|
||||
@echo CREATE $@
|
@ -13,9 +13,11 @@ family_add_subdirectory(board_test)
|
||||
family_add_subdirectory(cdc_dual_ports)
|
||||
family_add_subdirectory(cdc_msc)
|
||||
family_add_subdirectory(cdc_msc_freertos)
|
||||
family_add_subdirectory(cdc_uac2)
|
||||
family_add_subdirectory(dfu)
|
||||
family_add_subdirectory(dfu_runtime)
|
||||
family_add_subdirectory(dynamic_configuration)
|
||||
family_add_subdirectory(hid_boot_interface)
|
||||
family_add_subdirectory(hid_composite)
|
||||
family_add_subdirectory(hid_composite_freertos)
|
||||
family_add_subdirectory(hid_generic_inout)
|
||||
|
@ -28,6 +28,11 @@ target_include_directories(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
# Add libm for GCC
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
target_link_libraries(${PROJECT} PUBLIC m)
|
||||
endif()
|
||||
|
||||
# Configure compilation flags and libraries for the example without RTOS.
|
||||
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
|
||||
family_configure_device_example(${PROJECT} noos)
|
||||
|
@ -1,11 +1,14 @@
|
||||
include ../../make.mk
|
||||
include ../../build_system/make/make.mk
|
||||
|
||||
INC += \
|
||||
src \
|
||||
$(TOP)/hw \
|
||||
|
||||
# Example source
|
||||
EXAMPLE_SOURCE += $(wildcard src/*.c)
|
||||
EXAMPLE_SOURCE += \
|
||||
src/main.c \
|
||||
src/usb_descriptors.c \
|
||||
|
||||
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
|
||||
|
||||
include ../../rules.mk
|
||||
include ../../build_system/make/rules.mk
|
||||
|
@ -1,3 +1,4 @@
|
||||
mcu:SAMD11
|
||||
mcu:SAME5X
|
||||
mcu:SAMG
|
||||
family:broadcom_64bit
|
||||
|
@ -34,17 +34,16 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "tusb.h"
|
||||
#include "tusb_config.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// MACRO CONSTANT TYPEDEF PROTYPES
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
#ifndef AUDIO_SAMPLE_RATE
|
||||
#define AUDIO_SAMPLE_RATE 48000
|
||||
#endif
|
||||
#define AUDIO_SAMPLE_RATE CFG_TUD_AUDIO_FUNC_1_SAMPLE_RATE
|
||||
|
||||
/* Blink pattern
|
||||
* - 250 ms : device not mounted
|
||||
@ -70,8 +69,13 @@ uint8_t clkValid;
|
||||
audio_control_range_2_n_t(1) volumeRng[CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX+1]; // Volume range state
|
||||
audio_control_range_4_n_t(1) sampleFreqRng; // Sample frequency range state
|
||||
|
||||
// Audio test data
|
||||
uint16_t i2s_dummy_buffer[CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ/2]; // Ensure half word aligned
|
||||
#if CFG_TUD_AUDIO_ENABLE_ENCODING
|
||||
// Audio test data, each buffer contains 2 channels, buffer[0] for CH0-1, buffer[1] for CH1-2
|
||||
uint16_t i2s_dummy_buffer[CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX*CFG_TUD_AUDIO_FUNC_1_SAMPLE_RATE/1000/CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO];
|
||||
#else
|
||||
// Audio test data, 4 channels muxed together, buffer[0] for CH0, buffer[1] for CH1, buffer[2] for CH2, buffer[3] for CH3
|
||||
uint16_t i2s_dummy_buffer[CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX*CFG_TUD_AUDIO_FUNC_1_SAMPLE_RATE/1000];
|
||||
#endif
|
||||
|
||||
void led_blinking_task(void);
|
||||
void audio_task(void);
|
||||
@ -84,6 +88,10 @@ int main(void)
|
||||
// init device stack on configured roothub port
|
||||
tud_init(BOARD_TUD_RHPORT);
|
||||
|
||||
if (board_init_after_tusb) {
|
||||
board_init_after_tusb();
|
||||
}
|
||||
|
||||
// Init values
|
||||
sampFreq = AUDIO_SAMPLE_RATE;
|
||||
clkValid = 1;
|
||||
@ -93,6 +101,45 @@ int main(void)
|
||||
sampleFreqRng.subrange[0].bMax = AUDIO_SAMPLE_RATE;
|
||||
sampleFreqRng.subrange[0].bRes = 0;
|
||||
|
||||
// Generate dummy data
|
||||
#if CFG_TUD_AUDIO_ENABLE_ENCODING
|
||||
uint16_t * p_buff = i2s_dummy_buffer[0];
|
||||
uint16_t dataVal = 1;
|
||||
for (uint16_t cnt = 0; cnt < AUDIO_SAMPLE_RATE/1000; cnt++)
|
||||
{
|
||||
// CH0 saw wave
|
||||
*p_buff++ = dataVal;
|
||||
// CH1 inverted saw wave
|
||||
*p_buff++ = 60 + AUDIO_SAMPLE_RATE/1000 - dataVal;
|
||||
dataVal++;
|
||||
}
|
||||
p_buff = i2s_dummy_buffer[1];
|
||||
for (uint16_t cnt = 0; cnt < AUDIO_SAMPLE_RATE/1000; cnt++)
|
||||
{
|
||||
// CH3 square wave
|
||||
*p_buff++ = cnt < (AUDIO_SAMPLE_RATE/1000/2) ? 120:170;
|
||||
// CH4 sinus wave
|
||||
float t = 2*3.1415f * cnt / (AUDIO_SAMPLE_RATE/1000);
|
||||
*p_buff++ = (uint16_t)(sinf(t) * 25) + 200;
|
||||
}
|
||||
#else
|
||||
uint16_t * p_buff = i2s_dummy_buffer;
|
||||
uint16_t dataVal = 1;
|
||||
for (uint16_t cnt = 0; cnt < AUDIO_SAMPLE_RATE/1000; cnt++)
|
||||
{
|
||||
// CH0 saw wave
|
||||
*p_buff++ = dataVal;
|
||||
// CH1 inverted saw wave
|
||||
*p_buff++ = 60 + AUDIO_SAMPLE_RATE/1000 - dataVal;
|
||||
dataVal++;
|
||||
// CH3 square wave
|
||||
*p_buff++ = cnt < (AUDIO_SAMPLE_RATE/1000/2) ? 120:170;
|
||||
// CH4 sinus wave
|
||||
float t = 2*3.1415f * cnt / (AUDIO_SAMPLE_RATE/1000);
|
||||
*p_buff++ = (uint16_t)(sinf(t) * 25) + 200;
|
||||
}
|
||||
#endif
|
||||
|
||||
while (1)
|
||||
{
|
||||
tud_task(); // tinyusb device task
|
||||
@ -129,7 +176,7 @@ void tud_suspend_cb(bool remote_wakeup_en)
|
||||
// Invoked when usb bus is resumed
|
||||
void tud_resume_cb(void)
|
||||
{
|
||||
blink_interval_ms = BLINK_MOUNTED;
|
||||
blink_interval_ms = tud_mounted() ? BLINK_MOUNTED : BLINK_NOT_MOUNTED;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
@ -138,8 +185,21 @@ void tud_resume_cb(void)
|
||||
|
||||
void audio_task(void)
|
||||
{
|
||||
// Yet to be filled - e.g. put meas data into TX FIFOs etc.
|
||||
// asm("nop");
|
||||
// Yet to be filled - e.g. read audio from I2S buffer.
|
||||
// Here we simulate a I2S receive callback every 1ms.
|
||||
static uint32_t start_ms = 0;
|
||||
uint32_t curr_ms = board_millis();
|
||||
if ( start_ms == curr_ms ) return; // not enough time
|
||||
start_ms = curr_ms;
|
||||
#if CFG_TUD_AUDIO_ENABLE_ENCODING
|
||||
// Write I2S buffer into FIFO
|
||||
for (uint8_t cnt=0; cnt < 2; cnt++)
|
||||
{
|
||||
tud_audio_write_support_ff(cnt, i2s_dummy_buffer[cnt], AUDIO_SAMPLE_RATE/1000 * CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX * CFG_TUD_AUDIO_FUNC_1_CHANNEL_PER_FIFO_TX);
|
||||
}
|
||||
#else
|
||||
tud_audio_write(i2s_dummy_buffer, AUDIO_SAMPLE_RATE/1000 * CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX * CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX);
|
||||
#endif
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
@ -360,7 +420,8 @@ bool tud_audio_get_req_entity_cb(uint8_t rhport, tusb_control_request_t const *
|
||||
{
|
||||
case AUDIO_CS_REQ_CUR:
|
||||
TU_LOG2(" Get Sample Freq.\r\n");
|
||||
return tud_control_xfer(rhport, p_request, &sampFreq, sizeof(sampFreq));
|
||||
// Buffered control transfer is needed for IN flow control to work
|
||||
return tud_audio_buffer_and_schedule_control_xfer(rhport, p_request, &sampFreq, sizeof(sampFreq));
|
||||
|
||||
case AUDIO_CS_REQ_RANGE:
|
||||
TU_LOG2(" Get Sample Freq. range\r\n");
|
||||
@ -396,10 +457,14 @@ bool tud_audio_tx_done_pre_load_cb(uint8_t rhport, uint8_t itf, uint8_t ep_in, u
|
||||
(void) ep_in;
|
||||
(void) cur_alt_setting;
|
||||
|
||||
for (uint8_t cnt=0; cnt < CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO; cnt++)
|
||||
{
|
||||
tud_audio_write_support_ff(cnt, i2s_dummy_buffer[cnt], AUDIO_SAMPLE_RATE/1000 * CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX * CFG_TUD_AUDIO_FUNC_1_CHANNEL_PER_FIFO_TX);
|
||||
}
|
||||
|
||||
// In read world application data flow is driven by I2S clock,
|
||||
// both tud_audio_tx_done_pre_load_cb() & tud_audio_tx_done_post_load_cb() are hardly used.
|
||||
// For example in your I2S receive callback:
|
||||
// void I2S_Rx_Callback(int channel, const void* data, uint16_t samples)
|
||||
// {
|
||||
// tud_audio_write_support_ff(channel, data, samples * N_BYTES_PER_SAMPLE * N_CHANNEL_PER_FIFO);
|
||||
// }
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -412,22 +477,6 @@ bool tud_audio_tx_done_post_load_cb(uint8_t rhport, uint16_t n_bytes_copied, uin
|
||||
(void) ep_in;
|
||||
(void) cur_alt_setting;
|
||||
|
||||
uint16_t dataVal;
|
||||
|
||||
// Generate dummy data
|
||||
for (uint16_t cnt = 0; cnt < CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO; cnt++)
|
||||
{
|
||||
uint16_t * p_buff = i2s_dummy_buffer[cnt]; // 2 bytes per sample
|
||||
dataVal = 1;
|
||||
for (uint16_t cnt2 = 0; cnt2 < AUDIO_SAMPLE_RATE/1000; cnt2++)
|
||||
{
|
||||
for (uint8_t cnt3 = 0; cnt3 < CFG_TUD_AUDIO_FUNC_1_CHANNEL_PER_FIFO_TX; cnt3++)
|
||||
{
|
||||
*p_buff++ = dataVal;
|
||||
}
|
||||
dataVal++;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -10,11 +10,11 @@ if __name__ == '__main__':
|
||||
# print(sd.query_devices())
|
||||
|
||||
fs = 48000 # Sample rate
|
||||
duration = 100e-3 # Duration of recording
|
||||
duration = 1 # Duration of recording
|
||||
|
||||
if platform.system() == 'Windows':
|
||||
# WDM-KS is needed since there are more than one MicNode device APIs (at least in Windows)
|
||||
device = 'Microphone (MicNode_4_Ch), Windows WDM-KS'
|
||||
device = 'Microphone (MicNode_4_Ch), Windows WASAPI'
|
||||
elif platform.system() == 'Darwin':
|
||||
device = 'MicNode_4_Ch'
|
||||
else:
|
||||
@ -25,9 +25,13 @@ if __name__ == '__main__':
|
||||
sd.wait() # Wait until recording is finished
|
||||
print('Done!')
|
||||
|
||||
|
||||
time = np.arange(0, duration, 1 / fs) # time vector
|
||||
# strip starting zero
|
||||
|
||||
plt.plot(time, myrecording)
|
||||
plt.xlabel('Time [s]')
|
||||
plt.ylabel('Amplitude')
|
||||
plt.title('MicNode 4 Channel')
|
||||
plt.legend(['CH-1', 'CH-2', 'CH-3','CH-4'])
|
||||
plt.show()
|
||||
|
@ -103,6 +103,7 @@ extern "C" {
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
// Have a look into audio_device.h for all configurations
|
||||
#define CFG_TUD_AUDIO_FUNC_1_SAMPLE_RATE 48000
|
||||
|
||||
#define CFG_TUD_AUDIO_FUNC_1_DESC_LEN TUD_AUDIO_MIC_FOUR_CH_DESC_LEN
|
||||
|
||||
@ -112,15 +113,27 @@ extern "C" {
|
||||
#define CFG_TUD_AUDIO_ENABLE_EP_IN 1
|
||||
#define CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX 2 // This value is not required by the driver, it parses this information from the descriptor once the alternate interface is set by the host - we use it for the setup
|
||||
#define CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX 4 // This value is not required by the driver, it parses this information from the descriptor once the alternate interface is set by the host - we use it for the setup
|
||||
#define CFG_TUD_AUDIO_EP_SZ_IN (48 + 1) * CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX * CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX // 48 Samples (48 kHz) x 2 Bytes/Sample x CFG_TUD_AUDIO_N_CHANNELS_TX Channels - the Windows driver always needs an extra sample per channel of space more, otherwise it complains... found by trial and error
|
||||
#define CFG_TUD_AUDIO_EP_SZ_IN TUD_AUDIO_EP_SIZE(CFG_TUD_AUDIO_FUNC_1_SAMPLE_RATE, CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX, CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX)
|
||||
|
||||
#define CFG_TUD_AUDIO_ENABLE_ENCODING 1
|
||||
#define CFG_TUD_AUDIO_EP_IN_FLOW_CONTROL 1
|
||||
|
||||
#if CFG_TUD_AUDIO_ENABLE_ENCODING
|
||||
|
||||
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX CFG_TUD_AUDIO_EP_SZ_IN
|
||||
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ CFG_TUD_AUDIO_EP_SZ_IN
|
||||
|
||||
#define CFG_TUD_AUDIO_ENABLE_ENCODING 1
|
||||
#define CFG_TUD_AUDIO_ENABLE_TYPE_I_ENCODING 1
|
||||
#define CFG_TUD_AUDIO_FUNC_1_CHANNEL_PER_FIFO_TX 2 // One I2S stream contains two channels, each stream is saved within one support FIFO - this value is currently fixed, the driver does not support a changing value
|
||||
#define CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO (CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX / CFG_TUD_AUDIO_FUNC_1_CHANNEL_PER_FIFO_TX)
|
||||
#define CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ (CFG_TUD_AUDIO_EP_SZ_IN / CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO)
|
||||
#define CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ (TUD_OPT_HIGH_SPEED ? 32 : 4) * (CFG_TUD_AUDIO_EP_SZ_IN / CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO) // Example write FIFO every 1ms, so it should be 8 times larger for HS device
|
||||
|
||||
#else
|
||||
|
||||
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX CFG_TUD_AUDIO_EP_SZ_IN
|
||||
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ (TUD_OPT_HIGH_SPEED ? 32 : 4) * CFG_TUD_AUDIO_EP_SZ_IN // Example write FIFO every 1ms, so it should be 8 times larger for HS device
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -23,6 +23,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "bsp/board_api.h"
|
||||
#include "tusb.h"
|
||||
|
||||
/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
|
||||
@ -116,50 +117,63 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
|
||||
// String Descriptors
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// array of pointer to string descriptors
|
||||
char const* string_desc_arr [] =
|
||||
{
|
||||
(const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
|
||||
"PaniRCorp", // 1: Manufacturer
|
||||
"MicNode_4_Ch", // 2: Product
|
||||
"123458", // 3: Serials, should use chip ID
|
||||
"UAC2", // 4: Audio Interface
|
||||
// String Descriptor Index
|
||||
enum {
|
||||
STRID_LANGID = 0,
|
||||
STRID_MANUFACTURER,
|
||||
STRID_PRODUCT,
|
||||
STRID_SERIAL,
|
||||
};
|
||||
|
||||
static uint16_t _desc_str[32];
|
||||
// array of pointer to string descriptors
|
||||
char const* string_desc_arr [] = {
|
||||
(const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
|
||||
"PaniRCorp", // 1: Manufacturer
|
||||
"MicNode_4_Ch", // 2: Product
|
||||
NULL, // 3: Serials will use unique ID if possible
|
||||
"UAC2", // 4: Audio Interface
|
||||
};
|
||||
|
||||
static uint16_t _desc_str[32 + 1];
|
||||
|
||||
// Invoked when received GET STRING DESCRIPTOR request
|
||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
|
||||
{
|
||||
uint16_t const *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
|
||||
(void) langid;
|
||||
size_t chr_count;
|
||||
|
||||
uint8_t chr_count;
|
||||
switch ( index ) {
|
||||
case STRID_LANGID:
|
||||
memcpy(&_desc_str[1], string_desc_arr[0], 2);
|
||||
chr_count = 1;
|
||||
break;
|
||||
|
||||
if ( index == 0)
|
||||
{
|
||||
memcpy(&_desc_str[1], string_desc_arr[0], 2);
|
||||
chr_count = 1;
|
||||
}else
|
||||
{
|
||||
// Convert ASCII string into UTF-16
|
||||
case STRID_SERIAL:
|
||||
chr_count = board_usb_get_serial(_desc_str + 1, 32);
|
||||
break;
|
||||
|
||||
if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
|
||||
default:
|
||||
// Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
|
||||
// https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
|
||||
|
||||
const char* str = string_desc_arr[index];
|
||||
if ( !(index < sizeof(string_desc_arr) / sizeof(string_desc_arr[0])) ) return NULL;
|
||||
|
||||
// Cap at max char
|
||||
chr_count = (uint8_t) strlen(str);
|
||||
if ( chr_count > 31 ) chr_count = 31;
|
||||
const char *str = string_desc_arr[index];
|
||||
|
||||
for(uint8_t i=0; i<chr_count; i++)
|
||||
{
|
||||
_desc_str[1+i] = str[i];
|
||||
}
|
||||
// Cap at max char
|
||||
chr_count = strlen(str);
|
||||
size_t const max_count = sizeof(_desc_str) / sizeof(_desc_str[0]) - 1; // -1 for string type
|
||||
if ( chr_count > max_count ) chr_count = max_count;
|
||||
|
||||
// Convert ASCII string into UTF-16
|
||||
for ( size_t i = 0; i < chr_count; i++ ) {
|
||||
_desc_str[1 + i] = str[i];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// first byte is length (including header), second byte is string type
|
||||
_desc_str[0] = (uint16_t) ((TUSB_DESC_STRING << 8 ) | (2*chr_count + 2));
|
||||
_desc_str[0] = (uint16_t) ((TUSB_DESC_STRING << 8) | (2 * chr_count + 2));
|
||||
|
||||
return _desc_str;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
include ../../make.mk
|
||||
include ../../build_system/make/make.mk
|
||||
|
||||
INC += \
|
||||
src \
|
||||
@ -8,4 +8,4 @@ INC += \
|
||||
EXAMPLE_SOURCE += $(wildcard src/*.c)
|
||||
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
|
||||
|
||||
include ../../rules.mk
|
||||
include ../../build_system/make/rules.mk
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "tusb.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
@ -85,6 +85,10 @@ int main(void)
|
||||
// init device stack on configured roothub port
|
||||
tud_init(BOARD_TUD_RHPORT);
|
||||
|
||||
if (board_init_after_tusb) {
|
||||
board_init_after_tusb();
|
||||
}
|
||||
|
||||
// Init values
|
||||
sampFreq = AUDIO_SAMPLE_RATE;
|
||||
clkValid = 1;
|
||||
@ -130,7 +134,7 @@ void tud_suspend_cb(bool remote_wakeup_en)
|
||||
// Invoked when usb bus is resumed
|
||||
void tud_resume_cb(void)
|
||||
{
|
||||
blink_interval_ms = BLINK_MOUNTED;
|
||||
blink_interval_ms = tud_mounted() ? BLINK_MOUNTED : BLINK_NOT_MOUNTED;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -23,6 +23,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "bsp/board_api.h"
|
||||
#include "tusb.h"
|
||||
|
||||
/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
|
||||
@ -116,50 +117,65 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
|
||||
// String Descriptors
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// String Descriptor Index
|
||||
enum {
|
||||
STRID_LANGID = 0,
|
||||
STRID_MANUFACTURER,
|
||||
STRID_PRODUCT,
|
||||
STRID_SERIAL,
|
||||
};
|
||||
|
||||
// array of pointer to string descriptors
|
||||
char const* string_desc_arr [] =
|
||||
{
|
||||
(const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
|
||||
"PaniRCorp", // 1: Manufacturer
|
||||
"MicNode", // 2: Product
|
||||
"123456", // 3: Serials, should use chip ID
|
||||
"UAC2", // 4: Audio Interface
|
||||
(const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
|
||||
"PaniRCorp", // 1: Manufacturer
|
||||
"MicNode", // 2: Product
|
||||
NULL, // 3: Serials will use unique ID if possible
|
||||
"UAC2", // 4: Audio Interface
|
||||
|
||||
};
|
||||
|
||||
static uint16_t _desc_str[32];
|
||||
static uint16_t _desc_str[32 + 1];
|
||||
|
||||
// Invoked when received GET STRING DESCRIPTOR request
|
||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
|
||||
{
|
||||
uint16_t const *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
|
||||
(void) langid;
|
||||
size_t chr_count;
|
||||
|
||||
uint8_t chr_count;
|
||||
switch ( index ) {
|
||||
case STRID_LANGID:
|
||||
memcpy(&_desc_str[1], string_desc_arr[0], 2);
|
||||
chr_count = 1;
|
||||
break;
|
||||
|
||||
if ( index == 0)
|
||||
{
|
||||
memcpy(&_desc_str[1], string_desc_arr[0], 2);
|
||||
chr_count = 1;
|
||||
}else
|
||||
{
|
||||
// Convert ASCII string into UTF-16
|
||||
case STRID_SERIAL:
|
||||
chr_count = board_usb_get_serial(_desc_str + 1, 32);
|
||||
break;
|
||||
|
||||
if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
|
||||
default:
|
||||
// Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
|
||||
// https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
|
||||
|
||||
const char* str = string_desc_arr[index];
|
||||
if ( !(index < sizeof(string_desc_arr) / sizeof(string_desc_arr[0])) ) return NULL;
|
||||
|
||||
// Cap at max char
|
||||
chr_count = (uint8_t) strlen(str);
|
||||
if ( chr_count > 31 ) chr_count = 31;
|
||||
const char *str = string_desc_arr[index];
|
||||
|
||||
for(uint8_t i=0; i<chr_count; i++)
|
||||
{
|
||||
_desc_str[1+i] = str[i];
|
||||
}
|
||||
// Cap at max char
|
||||
chr_count = strlen(str);
|
||||
size_t const max_count = sizeof(_desc_str) / sizeof(_desc_str[0]) - 1; // -1 for string type
|
||||
if ( chr_count > max_count ) chr_count = max_count;
|
||||
|
||||
// Convert ASCII string into UTF-16
|
||||
for ( size_t i = 0; i < chr_count; i++ ) {
|
||||
_desc_str[1 + i] = str[i];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// first byte is length (including header), second byte is string type
|
||||
_desc_str[0] = (uint16_t) ((TUSB_DESC_STRING << 8 ) | (2*chr_count + 2));
|
||||
_desc_str[0] = (uint16_t) ((TUSB_DESC_STRING << 8) | (2 * chr_count + 2));
|
||||
|
||||
return _desc_str;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
include ../../make.mk
|
||||
include ../../build_system/make/make.mk
|
||||
|
||||
INC += \
|
||||
src \
|
||||
@ -8,4 +8,4 @@ INC += \
|
||||
EXAMPLE_SOURCE += $(wildcard src/*.c)
|
||||
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
|
||||
|
||||
include ../../rules.mk
|
||||
include ../../build_system/make/rules.mk
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "tusb.h"
|
||||
#include "usb_descriptors.h"
|
||||
|
||||
@ -99,6 +99,10 @@ int main(void)
|
||||
// init device stack on configured roothub port
|
||||
tud_init(BOARD_TUD_RHPORT);
|
||||
|
||||
if (board_init_after_tusb) {
|
||||
board_init_after_tusb();
|
||||
}
|
||||
|
||||
// Init values
|
||||
sampFreq = sampleRatesList[0];
|
||||
clkValid = 1;
|
||||
@ -142,7 +146,7 @@ void tud_suspend_cb(bool remote_wakeup_en)
|
||||
// Invoked when usb bus is resumed
|
||||
void tud_resume_cb(void)
|
||||
{
|
||||
blink_interval_ms = BLINK_MOUNTED;
|
||||
blink_interval_ms = tud_mounted() ? BLINK_MOUNTED : BLINK_NOT_MOUNTED;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -24,6 +24,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "bsp/board_api.h"
|
||||
#include "tusb.h"
|
||||
#include "usb_descriptors.h"
|
||||
|
||||
@ -120,50 +121,65 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
|
||||
// String Descriptors
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// String Descriptor Index
|
||||
enum {
|
||||
STRID_LANGID = 0,
|
||||
STRID_MANUFACTURER,
|
||||
STRID_PRODUCT,
|
||||
STRID_SERIAL,
|
||||
};
|
||||
|
||||
// array of pointer to string descriptors
|
||||
char const* string_desc_arr [] =
|
||||
{
|
||||
(const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
|
||||
"PaniRCorp", // 1: Manufacturer
|
||||
"MicNode", // 2: Product
|
||||
"123456", // 3: Serials, should use chip ID
|
||||
"UAC2", // 4: Audio Interface
|
||||
(const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
|
||||
"PaniRCorp", // 1: Manufacturer
|
||||
"MicNode", // 2: Product
|
||||
NULL, // 3: Serials will use unique ID if possible
|
||||
"UAC2", // 4: Audio Interface
|
||||
|
||||
};
|
||||
|
||||
static uint16_t _desc_str[32];
|
||||
static uint16_t _desc_str[32 + 1];
|
||||
|
||||
// Invoked when received GET STRING DESCRIPTOR request
|
||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
|
||||
{
|
||||
uint16_t const *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
|
||||
(void) langid;
|
||||
size_t chr_count;
|
||||
|
||||
uint8_t chr_count;
|
||||
switch ( index ) {
|
||||
case STRID_LANGID:
|
||||
memcpy(&_desc_str[1], string_desc_arr[0], 2);
|
||||
chr_count = 1;
|
||||
break;
|
||||
|
||||
if ( index == 0)
|
||||
{
|
||||
memcpy(&_desc_str[1], string_desc_arr[0], 2);
|
||||
chr_count = 1;
|
||||
}else
|
||||
{
|
||||
// Convert ASCII string into UTF-16
|
||||
case STRID_SERIAL:
|
||||
chr_count = board_usb_get_serial(_desc_str + 1, 32);
|
||||
break;
|
||||
|
||||
if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
|
||||
default:
|
||||
// Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
|
||||
// https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
|
||||
|
||||
const char* str = string_desc_arr[index];
|
||||
if ( !(index < sizeof(string_desc_arr) / sizeof(string_desc_arr[0])) ) return NULL;
|
||||
|
||||
// Cap at max char
|
||||
chr_count = (uint8_t) strlen(str);
|
||||
if ( chr_count > 31 ) chr_count = 31;
|
||||
const char *str = string_desc_arr[index];
|
||||
|
||||
for(uint8_t i=0; i<chr_count; i++)
|
||||
{
|
||||
_desc_str[1+i] = str[i];
|
||||
}
|
||||
// Cap at max char
|
||||
chr_count = strlen(str);
|
||||
size_t const max_count = sizeof(_desc_str) / sizeof(_desc_str[0]) - 1; // -1 for string type
|
||||
if ( chr_count > max_count ) chr_count = max_count;
|
||||
|
||||
// Convert ASCII string into UTF-16
|
||||
for ( size_t i = 0; i < chr_count; i++ ) {
|
||||
_desc_str[1 + i] = str[i];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// first byte is length (including header), second byte is string type
|
||||
_desc_str[0] = (uint16_t) ((TUSB_DESC_STRING << 8 ) | (2*chr_count + 2));
|
||||
_desc_str[0] = (uint16_t) ((TUSB_DESC_STRING << 8) | (2 * chr_count + 2));
|
||||
|
||||
return _desc_str;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
include ../../make.mk
|
||||
include ../../build_system/make/make.mk
|
||||
|
||||
INC += \
|
||||
src \
|
||||
@ -8,4 +8,4 @@ INC += \
|
||||
EXAMPLE_SOURCE += $(wildcard src/*.c)
|
||||
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
|
||||
|
||||
include ../../rules.mk
|
||||
include ../../build_system/make/rules.mk
|
||||
|
@ -26,39 +26,31 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "bsp/board.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// MACRO CONSTANT TYPEDEF PROTOTYPES
|
||||
//--------------------------------------------------------------------+
|
||||
#include "bsp/board_api.h"
|
||||
|
||||
/* Blink pattern
|
||||
* - 250 ms : button is not pressed
|
||||
* - 1000 ms : button is pressed (and hold)
|
||||
*/
|
||||
enum {
|
||||
enum {
|
||||
BLINK_PRESSED = 250,
|
||||
BLINK_UNPRESSED = 1000
|
||||
};
|
||||
|
||||
#define HELLO_STR "Hello from TinyUSB\r\n"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int main(void) {
|
||||
board_init();
|
||||
board_led_write(true);
|
||||
|
||||
uint32_t start_ms = 0;
|
||||
bool led_state = false;
|
||||
|
||||
while (1)
|
||||
{
|
||||
while (1) {
|
||||
uint32_t interval_ms = board_button_read() ? BLINK_PRESSED : BLINK_UNPRESSED;
|
||||
|
||||
// Blink and print every interval ms
|
||||
if ( !(board_millis() - start_ms < interval_ms) )
|
||||
{
|
||||
if (!(board_millis() - start_ms < interval_ms)) {
|
||||
board_uart_write(HELLO_STR, strlen(HELLO_STR));
|
||||
|
||||
start_ms = board_millis();
|
||||
@ -69,16 +61,14 @@ int main(void)
|
||||
|
||||
// echo
|
||||
uint8_t ch;
|
||||
if ( board_uart_read(&ch, 1) > 0 )
|
||||
{
|
||||
if (board_uart_read(&ch, 1) > 0) {
|
||||
board_uart_write(&ch, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 || CFG_TUSB_MCU == OPT_MCU_ESP32S3
|
||||
void app_main(void)
|
||||
{
|
||||
void app_main(void) {
|
||||
main();
|
||||
}
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
include ../../make.mk
|
||||
include ../../build_system/make/make.mk
|
||||
|
||||
INC += \
|
||||
src \
|
||||
@ -8,4 +8,4 @@ INC += \
|
||||
EXAMPLE_SOURCE += $(wildcard src/*.c)
|
||||
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
|
||||
|
||||
include ../../rules.mk
|
||||
include ../../build_system/make/rules.mk
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "tusb.h"
|
||||
|
||||
//------------- prototypes -------------//
|
||||
@ -42,6 +42,10 @@ int main(void)
|
||||
// init device stack on configured roothub port
|
||||
tud_init(BOARD_TUD_RHPORT);
|
||||
|
||||
if (board_init_after_tusb) {
|
||||
board_init_after_tusb();
|
||||
}
|
||||
|
||||
while (1)
|
||||
{
|
||||
tud_task(); // tinyusb device task
|
||||
|
@ -23,13 +23,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "bsp/board_api.h"
|
||||
#include "tusb.h"
|
||||
|
||||
/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
|
||||
* Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
|
||||
*
|
||||
* Auto ProductID layout's Bitmap:
|
||||
* [MSB] MIDI | HID | MSC | CDC [LSB]
|
||||
* [MSB] HID | MSC | CDC [LSB]
|
||||
*/
|
||||
#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
|
||||
#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
|
||||
@ -213,52 +214,64 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
|
||||
// String Descriptors
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// String Descriptor Index
|
||||
enum {
|
||||
STRID_LANGID = 0,
|
||||
STRID_MANUFACTURER,
|
||||
STRID_PRODUCT,
|
||||
STRID_SERIAL,
|
||||
};
|
||||
|
||||
// array of pointer to string descriptors
|
||||
char const* string_desc_arr [] =
|
||||
char const *string_desc_arr[] =
|
||||
{
|
||||
(const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
|
||||
"TinyUSB", // 1: Manufacturer
|
||||
"TinyUSB Device", // 2: Product
|
||||
"123456", // 3: Serials, should use chip ID
|
||||
NULL, // 3: Serials will use unique ID if possible
|
||||
"TinyUSB CDC", // 4: CDC Interface
|
||||
};
|
||||
|
||||
static uint16_t _desc_str[32];
|
||||
static uint16_t _desc_str[32 + 1];
|
||||
|
||||
// Invoked when received GET STRING DESCRIPTOR request
|
||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
|
||||
{
|
||||
uint16_t const *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
|
||||
(void) langid;
|
||||
size_t chr_count;
|
||||
|
||||
uint8_t chr_count;
|
||||
switch ( index ) {
|
||||
case STRID_LANGID:
|
||||
memcpy(&_desc_str[1], string_desc_arr[0], 2);
|
||||
chr_count = 1;
|
||||
break;
|
||||
|
||||
if ( index == 0)
|
||||
{
|
||||
memcpy(&_desc_str[1], string_desc_arr[0], 2);
|
||||
chr_count = 1;
|
||||
}else
|
||||
{
|
||||
// Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
|
||||
// https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
|
||||
case STRID_SERIAL:
|
||||
chr_count = board_usb_get_serial(_desc_str + 1, 32);
|
||||
break;
|
||||
|
||||
if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
|
||||
default:
|
||||
// Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
|
||||
// https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
|
||||
|
||||
const char* str = string_desc_arr[index];
|
||||
if ( !(index < sizeof(string_desc_arr) / sizeof(string_desc_arr[0])) ) return NULL;
|
||||
|
||||
// Cap at max char
|
||||
chr_count = (uint8_t) strlen(str);
|
||||
if ( chr_count > 31 ) chr_count = 31;
|
||||
const char *str = string_desc_arr[index];
|
||||
|
||||
// Convert ASCII string into UTF-16
|
||||
for(uint8_t i=0; i<chr_count; i++)
|
||||
{
|
||||
_desc_str[1+i] = str[i];
|
||||
}
|
||||
// Cap at max char
|
||||
chr_count = strlen(str);
|
||||
size_t const max_count = sizeof(_desc_str) / sizeof(_desc_str[0]) - 1; // -1 for string type
|
||||
if ( chr_count > max_count ) chr_count = max_count;
|
||||
|
||||
// Convert ASCII string into UTF-16
|
||||
for ( size_t i = 0; i < chr_count; i++ ) {
|
||||
_desc_str[1 + i] = str[i];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// first byte is length (including header), second byte is string type
|
||||
_desc_str[0] = (uint16_t) ((TUSB_DESC_STRING << 8 ) | (2*chr_count + 2));
|
||||
_desc_str[0] = (uint16_t) ((TUSB_DESC_STRING << 8) | (2 * chr_count + 2));
|
||||
|
||||
return _desc_str;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
include ../../make.mk
|
||||
include ../../build_system/make/make.mk
|
||||
|
||||
INC += \
|
||||
src \
|
||||
@ -12,4 +12,4 @@ EXAMPLE_SOURCE += \
|
||||
|
||||
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
|
||||
|
||||
include ../../rules.mk
|
||||
include ../../build_system/make/rules.mk
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "tusb.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
@ -39,7 +39,7 @@
|
||||
* - 1000 ms : device mounted
|
||||
* - 2500 ms : device is suspended
|
||||
*/
|
||||
enum {
|
||||
enum {
|
||||
BLINK_NOT_MOUNTED = 250,
|
||||
BLINK_MOUNTED = 1000,
|
||||
BLINK_SUSPENDED = 2500,
|
||||
@ -51,15 +51,17 @@ void led_blinking_task(void);
|
||||
void cdc_task(void);
|
||||
|
||||
/*------------- MAIN -------------*/
|
||||
int main(void)
|
||||
{
|
||||
int main(void) {
|
||||
board_init();
|
||||
|
||||
// init device stack on configured roothub port
|
||||
tud_init(BOARD_TUD_RHPORT);
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (board_init_after_tusb) {
|
||||
board_init_after_tusb();
|
||||
}
|
||||
|
||||
while (1) {
|
||||
tud_task(); // tinyusb device task
|
||||
led_blinking_task();
|
||||
|
||||
@ -72,45 +74,39 @@ int main(void)
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// Invoked when device is mounted
|
||||
void tud_mount_cb(void)
|
||||
{
|
||||
void tud_mount_cb(void) {
|
||||
blink_interval_ms = BLINK_MOUNTED;
|
||||
}
|
||||
|
||||
// Invoked when device is unmounted
|
||||
void tud_umount_cb(void)
|
||||
{
|
||||
void tud_umount_cb(void) {
|
||||
blink_interval_ms = BLINK_NOT_MOUNTED;
|
||||
}
|
||||
|
||||
// Invoked when usb bus is suspended
|
||||
// remote_wakeup_en : if host allow us to perform remote wakeup
|
||||
// Within 7ms, device must draw an average of current less than 2.5 mA from bus
|
||||
void tud_suspend_cb(bool remote_wakeup_en)
|
||||
{
|
||||
void tud_suspend_cb(bool remote_wakeup_en) {
|
||||
(void) remote_wakeup_en;
|
||||
blink_interval_ms = BLINK_SUSPENDED;
|
||||
}
|
||||
|
||||
// Invoked when usb bus is resumed
|
||||
void tud_resume_cb(void)
|
||||
{
|
||||
blink_interval_ms = BLINK_MOUNTED;
|
||||
void tud_resume_cb(void) {
|
||||
blink_interval_ms = tud_mounted() ? BLINK_MOUNTED : BLINK_NOT_MOUNTED;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB CDC
|
||||
//--------------------------------------------------------------------+
|
||||
void cdc_task(void)
|
||||
{
|
||||
void cdc_task(void) {
|
||||
// connected() check for DTR bit
|
||||
// Most but not all terminal client set this when making connection
|
||||
// if ( tud_cdc_connected() )
|
||||
{
|
||||
// connected and there are data available
|
||||
if ( tud_cdc_available() )
|
||||
{
|
||||
if (tud_cdc_available()) {
|
||||
// read data
|
||||
char buf[64];
|
||||
uint32_t count = tud_cdc_read(buf, sizeof(buf));
|
||||
@ -127,37 +123,32 @@ void cdc_task(void)
|
||||
}
|
||||
|
||||
// Invoked when cdc when line state changed e.g connected/disconnected
|
||||
void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts)
|
||||
{
|
||||
void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts) {
|
||||
(void) itf;
|
||||
(void) rts;
|
||||
|
||||
// TODO set some indicator
|
||||
if ( dtr )
|
||||
{
|
||||
if (dtr) {
|
||||
// Terminal connected
|
||||
}else
|
||||
{
|
||||
} else {
|
||||
// Terminal disconnected
|
||||
}
|
||||
}
|
||||
|
||||
// Invoked when CDC interface received data from host
|
||||
void tud_cdc_rx_cb(uint8_t itf)
|
||||
{
|
||||
void tud_cdc_rx_cb(uint8_t itf) {
|
||||
(void) itf;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLINKING TASK
|
||||
//--------------------------------------------------------------------+
|
||||
void led_blinking_task(void)
|
||||
{
|
||||
void led_blinking_task(void) {
|
||||
static uint32_t start_ms = 0;
|
||||
static bool led_state = false;
|
||||
|
||||
// Blink every interval ms
|
||||
if ( board_millis() - start_ms < blink_interval_ms) return; // not enough time
|
||||
if (board_millis() - start_ms < blink_interval_ms) return; // not enough time
|
||||
start_ms += blink_interval_ms;
|
||||
|
||||
board_led_write(led_state);
|
||||
|
@ -23,7 +23,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "tusb.h"
|
||||
|
||||
#if CFG_TUD_MSC
|
||||
|
@ -23,6 +23,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "bsp/board_api.h"
|
||||
#include "tusb.h"
|
||||
|
||||
/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
|
||||
@ -41,35 +42,33 @@
|
||||
//--------------------------------------------------------------------+
|
||||
// Device Descriptors
|
||||
//--------------------------------------------------------------------+
|
||||
tusb_desc_device_t const desc_device =
|
||||
{
|
||||
.bLength = sizeof(tusb_desc_device_t),
|
||||
.bDescriptorType = TUSB_DESC_DEVICE,
|
||||
.bcdUSB = USB_BCD,
|
||||
tusb_desc_device_t const desc_device = {
|
||||
.bLength = sizeof(tusb_desc_device_t),
|
||||
.bDescriptorType = TUSB_DESC_DEVICE,
|
||||
.bcdUSB = USB_BCD,
|
||||
|
||||
// Use Interface Association Descriptor (IAD) for CDC
|
||||
// As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1)
|
||||
.bDeviceClass = TUSB_CLASS_MISC,
|
||||
.bDeviceSubClass = MISC_SUBCLASS_COMMON,
|
||||
.bDeviceProtocol = MISC_PROTOCOL_IAD,
|
||||
// Use Interface Association Descriptor (IAD) for CDC
|
||||
// As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1)
|
||||
.bDeviceClass = TUSB_CLASS_MISC,
|
||||
.bDeviceSubClass = MISC_SUBCLASS_COMMON,
|
||||
.bDeviceProtocol = MISC_PROTOCOL_IAD,
|
||||
|
||||
.bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
|
||||
.bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
|
||||
|
||||
.idVendor = USB_VID,
|
||||
.idProduct = USB_PID,
|
||||
.bcdDevice = 0x0100,
|
||||
.idVendor = USB_VID,
|
||||
.idProduct = USB_PID,
|
||||
.bcdDevice = 0x0100,
|
||||
|
||||
.iManufacturer = 0x01,
|
||||
.iProduct = 0x02,
|
||||
.iSerialNumber = 0x03,
|
||||
.iManufacturer = 0x01,
|
||||
.iProduct = 0x02,
|
||||
.iSerialNumber = 0x03,
|
||||
|
||||
.bNumConfigurations = 0x01
|
||||
.bNumConfigurations = 0x01
|
||||
};
|
||||
|
||||
// Invoked when received GET DEVICE DESCRIPTOR
|
||||
// Application return pointer to descriptor
|
||||
uint8_t const * tud_descriptor_device_cb(void)
|
||||
{
|
||||
uint8_t const *tud_descriptor_device_cb(void) {
|
||||
return (uint8_t const *) &desc_device;
|
||||
}
|
||||
|
||||
@ -77,8 +76,7 @@ uint8_t const * tud_descriptor_device_cb(void)
|
||||
// Configuration Descriptor
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
ITF_NUM_CDC = 0,
|
||||
ITF_NUM_CDC_DATA,
|
||||
ITF_NUM_MSC,
|
||||
@ -95,7 +93,7 @@ enum
|
||||
#define EPNUM_MSC_OUT 0x05
|
||||
#define EPNUM_MSC_IN 0x85
|
||||
|
||||
#elif CFG_TUSB_MCU == OPT_MCU_SAMG || CFG_TUSB_MCU == OPT_MCU_SAMX7X
|
||||
#elif CFG_TUSB_MCU == OPT_MCU_SAMG || CFG_TUSB_MCU == OPT_MCU_SAMX7X
|
||||
// SAMG & SAME70 don't support a same endpoint number with different direction IN and OUT
|
||||
// e.g EP1 OUT & EP1 IN cannot exist together
|
||||
#define EPNUM_CDC_NOTIF 0x81
|
||||
@ -140,67 +138,62 @@ enum
|
||||
#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_CDC_DESC_LEN + TUD_MSC_DESC_LEN)
|
||||
|
||||
// full speed configuration
|
||||
uint8_t const desc_fs_configuration[] =
|
||||
{
|
||||
// Config number, interface count, string index, total length, attribute, power in mA
|
||||
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, 0x00, 100),
|
||||
uint8_t const desc_fs_configuration[] = {
|
||||
// Config number, interface count, string index, total length, attribute, power in mA
|
||||
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, 0x00, 100),
|
||||
|
||||
// Interface number, string index, EP notification address and size, EP data address (out, in) and size.
|
||||
TUD_CDC_DESCRIPTOR(ITF_NUM_CDC, 4, EPNUM_CDC_NOTIF, 8, EPNUM_CDC_OUT, EPNUM_CDC_IN, 64),
|
||||
// Interface number, string index, EP notification address and size, EP data address (out, in) and size.
|
||||
TUD_CDC_DESCRIPTOR(ITF_NUM_CDC, 4, EPNUM_CDC_NOTIF, 8, EPNUM_CDC_OUT, EPNUM_CDC_IN, 64),
|
||||
|
||||
// Interface number, string index, EP Out & EP In address, EP size
|
||||
TUD_MSC_DESCRIPTOR(ITF_NUM_MSC, 5, EPNUM_MSC_OUT, EPNUM_MSC_IN, 64),
|
||||
// Interface number, string index, EP Out & EP In address, EP size
|
||||
TUD_MSC_DESCRIPTOR(ITF_NUM_MSC, 5, EPNUM_MSC_OUT, EPNUM_MSC_IN, 64),
|
||||
};
|
||||
|
||||
#if TUD_OPT_HIGH_SPEED
|
||||
// Per USB specs: high speed capable device must report device_qualifier and other_speed_configuration
|
||||
|
||||
// high speed configuration
|
||||
uint8_t const desc_hs_configuration[] =
|
||||
{
|
||||
// Config number, interface count, string index, total length, attribute, power in mA
|
||||
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, 0x00, 100),
|
||||
uint8_t const desc_hs_configuration[] = {
|
||||
// Config number, interface count, string index, total length, attribute, power in mA
|
||||
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, 0x00, 100),
|
||||
|
||||
// Interface number, string index, EP notification address and size, EP data address (out, in) and size.
|
||||
TUD_CDC_DESCRIPTOR(ITF_NUM_CDC, 4, EPNUM_CDC_NOTIF, 8, EPNUM_CDC_OUT, EPNUM_CDC_IN, 512),
|
||||
// Interface number, string index, EP notification address and size, EP data address (out, in) and size.
|
||||
TUD_CDC_DESCRIPTOR(ITF_NUM_CDC, 4, EPNUM_CDC_NOTIF, 8, EPNUM_CDC_OUT, EPNUM_CDC_IN, 512),
|
||||
|
||||
// Interface number, string index, EP Out & EP In address, EP size
|
||||
TUD_MSC_DESCRIPTOR(ITF_NUM_MSC, 5, EPNUM_MSC_OUT, EPNUM_MSC_IN, 512),
|
||||
// Interface number, string index, EP Out & EP In address, EP size
|
||||
TUD_MSC_DESCRIPTOR(ITF_NUM_MSC, 5, EPNUM_MSC_OUT, EPNUM_MSC_IN, 512),
|
||||
};
|
||||
|
||||
// other speed configuration
|
||||
uint8_t desc_other_speed_config[CONFIG_TOTAL_LEN];
|
||||
|
||||
// device qualifier is mostly similar to device descriptor since we don't change configuration based on speed
|
||||
tusb_desc_device_qualifier_t const desc_device_qualifier =
|
||||
{
|
||||
.bLength = sizeof(tusb_desc_device_qualifier_t),
|
||||
.bDescriptorType = TUSB_DESC_DEVICE_QUALIFIER,
|
||||
.bcdUSB = USB_BCD,
|
||||
tusb_desc_device_qualifier_t const desc_device_qualifier = {
|
||||
.bLength = sizeof(tusb_desc_device_qualifier_t),
|
||||
.bDescriptorType = TUSB_DESC_DEVICE_QUALIFIER,
|
||||
.bcdUSB = USB_BCD,
|
||||
|
||||
.bDeviceClass = TUSB_CLASS_MISC,
|
||||
.bDeviceSubClass = MISC_SUBCLASS_COMMON,
|
||||
.bDeviceProtocol = MISC_PROTOCOL_IAD,
|
||||
.bDeviceClass = TUSB_CLASS_MISC,
|
||||
.bDeviceSubClass = MISC_SUBCLASS_COMMON,
|
||||
.bDeviceProtocol = MISC_PROTOCOL_IAD,
|
||||
|
||||
.bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
|
||||
.bNumConfigurations = 0x01,
|
||||
.bReserved = 0x00
|
||||
.bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
|
||||
.bNumConfigurations = 0x01,
|
||||
.bReserved = 0x00
|
||||
};
|
||||
|
||||
// Invoked when received GET DEVICE QUALIFIER DESCRIPTOR request
|
||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete.
|
||||
// device_qualifier descriptor describes information about a high-speed capable device that would
|
||||
// change if the device were operating at the other speed. If not highspeed capable stall this request.
|
||||
uint8_t const* tud_descriptor_device_qualifier_cb(void)
|
||||
{
|
||||
return (uint8_t const*) &desc_device_qualifier;
|
||||
uint8_t const *tud_descriptor_device_qualifier_cb(void) {
|
||||
return (uint8_t const *) &desc_device_qualifier;
|
||||
}
|
||||
|
||||
// Invoked when received GET OTHER SEED CONFIGURATION DESCRIPTOR request
|
||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||
// Configuration descriptor in the other speed e.g if high speed then this is for full speed and vice versa
|
||||
uint8_t const* tud_descriptor_other_speed_configuration_cb(uint8_t index)
|
||||
{
|
||||
uint8_t const *tud_descriptor_other_speed_configuration_cb(uint8_t index) {
|
||||
(void) index; // for multiple configurations
|
||||
|
||||
// if link speed is high return fullspeed config, and vice versa
|
||||
@ -220,13 +213,12 @@ uint8_t const* tud_descriptor_other_speed_configuration_cb(uint8_t index)
|
||||
// Invoked when received GET CONFIGURATION DESCRIPTOR
|
||||
// Application return pointer to descriptor
|
||||
// Descriptor contents must exist long enough for transfer to complete
|
||||
uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
|
||||
{
|
||||
uint8_t const *tud_descriptor_configuration_cb(uint8_t index) {
|
||||
(void) index; // for multiple configurations
|
||||
|
||||
#if TUD_OPT_HIGH_SPEED
|
||||
// Although we are highspeed, host may be fullspeed.
|
||||
return (tud_speed_get() == TUSB_SPEED_HIGH) ? desc_hs_configuration : desc_fs_configuration;
|
||||
return (tud_speed_get() == TUSB_SPEED_HIGH) ? desc_hs_configuration : desc_fs_configuration;
|
||||
#else
|
||||
return desc_fs_configuration;
|
||||
#endif
|
||||
@ -236,53 +228,64 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
|
||||
// String Descriptors
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// array of pointer to string descriptors
|
||||
char const* string_desc_arr [] =
|
||||
{
|
||||
(const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
|
||||
"TinyUSB", // 1: Manufacturer
|
||||
"TinyUSB Device", // 2: Product
|
||||
"123456789012", // 3: Serials, should use chip ID
|
||||
"TinyUSB CDC", // 4: CDC Interface
|
||||
"TinyUSB MSC", // 5: MSC Interface
|
||||
// String Descriptor Index
|
||||
enum {
|
||||
STRID_LANGID = 0,
|
||||
STRID_MANUFACTURER,
|
||||
STRID_PRODUCT,
|
||||
STRID_SERIAL,
|
||||
};
|
||||
|
||||
static uint16_t _desc_str[32];
|
||||
// array of pointer to string descriptors
|
||||
char const *string_desc_arr[] = {
|
||||
(const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
|
||||
"TinyUSB", // 1: Manufacturer
|
||||
"TinyUSB Device", // 2: Product
|
||||
NULL, // 3: Serials will use unique ID if possible
|
||||
"TinyUSB CDC", // 4: CDC Interface
|
||||
"TinyUSB MSC", // 5: MSC Interface
|
||||
};
|
||||
|
||||
static uint16_t _desc_str[32 + 1];
|
||||
|
||||
// Invoked when received GET STRING DESCRIPTOR request
|
||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
|
||||
{
|
||||
uint16_t const *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
|
||||
(void) langid;
|
||||
size_t chr_count;
|
||||
|
||||
uint8_t chr_count;
|
||||
switch ( index ) {
|
||||
case STRID_LANGID:
|
||||
memcpy(&_desc_str[1], string_desc_arr[0], 2);
|
||||
chr_count = 1;
|
||||
break;
|
||||
|
||||
if ( index == 0)
|
||||
{
|
||||
memcpy(&_desc_str[1], string_desc_arr[0], 2);
|
||||
chr_count = 1;
|
||||
}else
|
||||
{
|
||||
// Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
|
||||
// https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
|
||||
case STRID_SERIAL:
|
||||
chr_count = board_usb_get_serial(_desc_str + 1, 32);
|
||||
break;
|
||||
|
||||
if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
|
||||
default:
|
||||
// Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
|
||||
// https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
|
||||
|
||||
const char* str = string_desc_arr[index];
|
||||
if ( !(index < sizeof(string_desc_arr) / sizeof(string_desc_arr[0])) ) return NULL;
|
||||
|
||||
// Cap at max char
|
||||
chr_count = (uint8_t) strlen(str);
|
||||
if ( chr_count > 31 ) chr_count = 31;
|
||||
const char *str = string_desc_arr[index];
|
||||
|
||||
// Convert ASCII string into UTF-16
|
||||
for(uint8_t i=0; i<chr_count; i++)
|
||||
{
|
||||
_desc_str[1+i] = str[i];
|
||||
}
|
||||
// Cap at max char
|
||||
chr_count = strlen(str);
|
||||
size_t const max_count = sizeof(_desc_str) / sizeof(_desc_str[0]) - 1; // -1 for string type
|
||||
if ( chr_count > max_count ) chr_count = max_count;
|
||||
|
||||
// Convert ASCII string into UTF-16
|
||||
for ( size_t i = 0; i < chr_count; i++ ) {
|
||||
_desc_str[1 + i] = str[i];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// first byte is length (including header), second byte is string type
|
||||
_desc_str[0] = (uint16_t) ((TUSB_DESC_STRING << 8 ) | (2*chr_count + 2));
|
||||
_desc_str[0] = (uint16_t) ((TUSB_DESC_STRING << 8) | (2 * chr_count + 2));
|
||||
|
||||
return _desc_str;
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
DEPS_SUBMODULES += lib/FreeRTOS-Kernel
|
||||
|
||||
include ../../make.mk
|
||||
include ../../build_system/make/make.mk
|
||||
|
||||
FREERTOS_SRC = lib/FreeRTOS-Kernel
|
||||
FREERTOS_PORTABLE_PATH= $(FREERTOS_SRC)/portable/$(if $(USE_IAR),IAR,GCC)
|
||||
@ -10,7 +8,7 @@ INC += \
|
||||
src/FreeRTOSConfig \
|
||||
$(TOP)/hw \
|
||||
$(TOP)/$(FREERTOS_SRC)/include \
|
||||
$(TOP)/$(FREERTOS_PORTABLE_SRC)
|
||||
$(TOP)/$(FREERTOS_PORTABLE_SRC) \
|
||||
|
||||
# Example source
|
||||
EXAMPLE_SOURCE = \
|
||||
@ -45,4 +43,4 @@ CFLAGS_GCC += -Wno-error=cast-qual
|
||||
# FreeRTOS (lto + Os) linker issue
|
||||
LDFLAGS_GCC += -Wl,--undefined=vTaskSwitchContext
|
||||
|
||||
include ../../rules.mk
|
||||
include ../../build_system/make/rules.mk
|
||||
|
@ -8,5 +8,6 @@ mcu:RP2040
|
||||
mcu:SAMD11
|
||||
mcu:SAMX7X
|
||||
mcu:VALENTYUSB_EPTRI
|
||||
mcu:RAXXX
|
||||
family:broadcom_32bit
|
||||
family:broadcom_64bit
|
||||
|
@ -81,7 +81,7 @@
|
||||
#define configUSE_MUTEXES 1
|
||||
#define configUSE_RECURSIVE_MUTEXES 1
|
||||
#define configUSE_COUNTING_SEMAPHORES 1
|
||||
#define configQUEUE_REGISTRY_SIZE 2
|
||||
#define configQUEUE_REGISTRY_SIZE 4
|
||||
#define configUSE_QUEUE_SETS 0
|
||||
#define configUSE_TIME_SLICING 0
|
||||
#define configUSE_NEWLIB_REENTRANT 0
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "tusb.h"
|
||||
|
||||
#if TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
|
||||
@ -41,6 +41,7 @@
|
||||
|
||||
#define USBD_STACK_SIZE 4096
|
||||
#else
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "semphr.h"
|
||||
#include "queue.h"
|
||||
@ -54,7 +55,7 @@
|
||||
#define CDC_STACK_SZIE configMINIMAL_STACK_SIZE
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// MACRO CONSTANT TYPEDEF PROTYPES
|
||||
// MACRO CONSTANT TYPEDEF PROTOTYPES
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
/* Blink pattern
|
||||
@ -62,7 +63,7 @@
|
||||
* - 1000 ms : device mounted
|
||||
* - 2500 ms : device is suspended
|
||||
*/
|
||||
enum {
|
||||
enum {
|
||||
BLINK_NOT_MOUNTED = 250,
|
||||
BLINK_MOUNTED = 1000,
|
||||
BLINK_SUSPENDED = 2500,
|
||||
@ -81,16 +82,15 @@ StaticTask_t cdc_taskdef;
|
||||
|
||||
TimerHandle_t blinky_tm;
|
||||
|
||||
void led_blinky_cb(TimerHandle_t xTimer);
|
||||
void usb_device_task(void* param);
|
||||
void cdc_task(void* params);
|
||||
static void led_blinky_cb(TimerHandle_t xTimer);
|
||||
static void usb_device_task(void *param);
|
||||
void cdc_task(void *params);
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Main
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int main(void) {
|
||||
board_init();
|
||||
|
||||
#if configSUPPORT_STATIC_ALLOCATION
|
||||
@ -104,8 +104,8 @@ int main(void)
|
||||
xTaskCreateStatic(cdc_task, "cdc", CDC_STACK_SZIE, NULL, configMAX_PRIORITIES-2, cdc_stack, &cdc_taskdef);
|
||||
#else
|
||||
blinky_tm = xTimerCreate(NULL, pdMS_TO_TICKS(BLINK_NOT_MOUNTED), true, NULL, led_blinky_cb);
|
||||
xTaskCreate( usb_device_task, "usbd", USBD_STACK_SIZE, NULL, configMAX_PRIORITIES-1, NULL);
|
||||
xTaskCreate( cdc_task, "cdc", CDC_STACK_SZIE, NULL, configMAX_PRIORITIES-2, NULL);
|
||||
xTaskCreate(usb_device_task, "usbd", USBD_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL);
|
||||
xTaskCreate(cdc_task, "cdc", CDC_STACK_SZIE, NULL, configMAX_PRIORITIES - 2, NULL);
|
||||
#endif
|
||||
|
||||
xTimerStart(blinky_tm, 0);
|
||||
@ -119,16 +119,14 @@ int main(void)
|
||||
}
|
||||
|
||||
#if TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
|
||||
void app_main(void)
|
||||
{
|
||||
void app_main(void) {
|
||||
main();
|
||||
}
|
||||
#endif
|
||||
|
||||
// USB Device Driver task
|
||||
// This top level thread process all usb events and invoke callbacks
|
||||
void usb_device_task(void* param)
|
||||
{
|
||||
static void usb_device_task(void *param) {
|
||||
(void) param;
|
||||
|
||||
// init device stack on configured roothub port
|
||||
@ -136,9 +134,12 @@ void usb_device_task(void* param)
|
||||
// Otherwise it could cause kernel issue since USB IRQ handler does use RTOS queue API.
|
||||
tud_init(BOARD_TUD_RHPORT);
|
||||
|
||||
if (board_init_after_tusb) {
|
||||
board_init_after_tusb();
|
||||
}
|
||||
|
||||
// RTOS forever loop
|
||||
while (1)
|
||||
{
|
||||
while (1) {
|
||||
// put this thread to waiting state until there is new events
|
||||
tud_task();
|
||||
|
||||
@ -152,49 +153,46 @@ void usb_device_task(void* param)
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// Invoked when device is mounted
|
||||
void tud_mount_cb(void)
|
||||
{
|
||||
void tud_mount_cb(void) {
|
||||
xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_MOUNTED), 0);
|
||||
}
|
||||
|
||||
// Invoked when device is unmounted
|
||||
void tud_umount_cb(void)
|
||||
{
|
||||
void tud_umount_cb(void) {
|
||||
xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_NOT_MOUNTED), 0);
|
||||
}
|
||||
|
||||
// Invoked when usb bus is suspended
|
||||
// remote_wakeup_en : if host allow us to perform remote wakeup
|
||||
// Within 7ms, device must draw an average of current less than 2.5 mA from bus
|
||||
void tud_suspend_cb(bool remote_wakeup_en)
|
||||
{
|
||||
void tud_suspend_cb(bool remote_wakeup_en) {
|
||||
(void) remote_wakeup_en;
|
||||
xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_SUSPENDED), 0);
|
||||
}
|
||||
|
||||
// Invoked when usb bus is resumed
|
||||
void tud_resume_cb(void)
|
||||
{
|
||||
xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_MOUNTED), 0);
|
||||
void tud_resume_cb(void) {
|
||||
if (tud_mounted()) {
|
||||
xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_MOUNTED), 0);
|
||||
} else {
|
||||
xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_NOT_MOUNTED), 0);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB CDC
|
||||
//--------------------------------------------------------------------+
|
||||
void cdc_task(void* params)
|
||||
{
|
||||
void cdc_task(void *params) {
|
||||
(void) params;
|
||||
|
||||
// RTOS forever loop
|
||||
while ( 1 )
|
||||
{
|
||||
while (1) {
|
||||
// connected() check for DTR bit
|
||||
// Most but not all terminal client set this when making connection
|
||||
// if ( tud_cdc_connected() )
|
||||
{
|
||||
// There are data available
|
||||
while ( tud_cdc_available() )
|
||||
{
|
||||
while (tud_cdc_available()) {
|
||||
uint8_t buf[64];
|
||||
|
||||
// read and echo back
|
||||
@ -217,32 +215,27 @@ void cdc_task(void* params)
|
||||
}
|
||||
|
||||
// Invoked when cdc when line state changed e.g connected/disconnected
|
||||
void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts)
|
||||
{
|
||||
void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts) {
|
||||
(void) itf;
|
||||
(void) rts;
|
||||
|
||||
// TODO set some indicator
|
||||
if ( dtr )
|
||||
{
|
||||
if (dtr) {
|
||||
// Terminal connected
|
||||
}else
|
||||
{
|
||||
} else {
|
||||
// Terminal disconnected
|
||||
}
|
||||
}
|
||||
|
||||
// Invoked when CDC interface received data from host
|
||||
void tud_cdc_rx_cb(uint8_t itf)
|
||||
{
|
||||
void tud_cdc_rx_cb(uint8_t itf) {
|
||||
(void) itf;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLINKING TASK
|
||||
//--------------------------------------------------------------------+
|
||||
void led_blinky_cb(TimerHandle_t xTimer)
|
||||
{
|
||||
static void led_blinky_cb(TimerHandle_t xTimer) {
|
||||
(void) xTimer;
|
||||
static bool led_state = false;
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "tusb.h"
|
||||
|
||||
#if CFG_TUD_MSC
|
||||
|
@ -23,6 +23,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "bsp/board_api.h"
|
||||
#include "tusb.h"
|
||||
|
||||
/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
|
||||
@ -212,53 +213,65 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
|
||||
// String Descriptors
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// String Descriptor Index
|
||||
enum {
|
||||
STRID_LANGID = 0,
|
||||
STRID_MANUFACTURER,
|
||||
STRID_PRODUCT,
|
||||
STRID_SERIAL,
|
||||
};
|
||||
|
||||
// array of pointer to string descriptors
|
||||
char const* string_desc_arr [] =
|
||||
char const *string_desc_arr[] =
|
||||
{
|
||||
(const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
|
||||
"TinyUSB", // 1: Manufacturer
|
||||
"TinyUSB Device", // 2: Product
|
||||
"123456789012", // 3: Serials, should use chip ID
|
||||
NULL, // 3: Serials will use unique ID if possible
|
||||
"TinyUSB CDC", // 4: CDC Interface
|
||||
"TinyUSB MSC", // 5: MSC Interface
|
||||
};
|
||||
|
||||
static uint16_t _desc_str[32];
|
||||
static uint16_t _desc_str[32 + 1];
|
||||
|
||||
// Invoked when received GET STRING DESCRIPTOR request
|
||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
|
||||
{
|
||||
uint16_t const *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
|
||||
(void) langid;
|
||||
size_t chr_count;
|
||||
|
||||
uint8_t chr_count;
|
||||
switch ( index ) {
|
||||
case STRID_LANGID:
|
||||
memcpy(&_desc_str[1], string_desc_arr[0], 2);
|
||||
chr_count = 1;
|
||||
break;
|
||||
|
||||
if ( index == 0)
|
||||
{
|
||||
memcpy(&_desc_str[1], string_desc_arr[0], 2);
|
||||
chr_count = 1;
|
||||
}else
|
||||
{
|
||||
// Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
|
||||
// https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
|
||||
case STRID_SERIAL:
|
||||
chr_count = board_usb_get_serial(_desc_str + 1, 32);
|
||||
break;
|
||||
|
||||
if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
|
||||
default:
|
||||
// Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
|
||||
// https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
|
||||
|
||||
const char* str = string_desc_arr[index];
|
||||
if ( !(index < sizeof(string_desc_arr) / sizeof(string_desc_arr[0])) ) return NULL;
|
||||
|
||||
// Cap at max char
|
||||
chr_count = (uint8_t) strlen(str);
|
||||
if ( chr_count > 31 ) chr_count = 31;
|
||||
const char *str = string_desc_arr[index];
|
||||
|
||||
// Convert ASCII string into UTF-16
|
||||
for(uint8_t i=0; i<chr_count; i++)
|
||||
{
|
||||
_desc_str[1+i] = str[i];
|
||||
}
|
||||
// Cap at max char
|
||||
chr_count = strlen(str);
|
||||
size_t const max_count = sizeof(_desc_str) / sizeof(_desc_str[0]) - 1; // -1 for string type
|
||||
if ( chr_count > max_count ) chr_count = max_count;
|
||||
|
||||
// Convert ASCII string into UTF-16
|
||||
for ( size_t i = 0; i < chr_count; i++ ) {
|
||||
_desc_str[1 + i] = str[i];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// first byte is length (including header), second byte is string type
|
||||
_desc_str[0] = (uint16_t) ((TUSB_DESC_STRING << 8 ) | (2*chr_count + 2));
|
||||
_desc_str[0] = (uint16_t) ((TUSB_DESC_STRING << 8) | (2 * chr_count + 2));
|
||||
|
||||
return _desc_str;
|
||||
}
|
||||
|
38
examples/device/cdc_uac2/CMakeLists.txt
Normal file
38
examples/device/cdc_uac2/CMakeLists.txt
Normal file
@ -0,0 +1,38 @@
|
||||
cmake_minimum_required(VERSION 3.17)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||
|
||||
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
project(${PROJECT} C CXX ASM)
|
||||
|
||||
# Checks this example is valid for the family and initializes the project
|
||||
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
# Espressif has its own cmake build system
|
||||
if(FAMILY STREQUAL "espressif")
|
||||
return()
|
||||
endif()
|
||||
|
||||
add_executable(${PROJECT})
|
||||
|
||||
# Example source
|
||||
target_sources(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/cdc_app.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/uac2_app.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||
)
|
||||
|
||||
# Example include
|
||||
target_include_directories(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
# Configure compilation flags and libraries for the example... see the corresponding function
|
||||
# in hw/bsp/FAMILY/family.cmake for details.
|
||||
family_configure_device_example(${PROJECT} noos)
|
||||
|
||||
# Uncomment me to enable UART based debugging
|
||||
# pico_enable_stdio_uart(${PROJECT} 1)
|
16
examples/device/cdc_uac2/Makefile
Normal file
16
examples/device/cdc_uac2/Makefile
Normal file
@ -0,0 +1,16 @@
|
||||
include ../../build_system/make/make.mk
|
||||
|
||||
INC += \
|
||||
src \
|
||||
$(TOP)/hw \
|
||||
|
||||
# Example source
|
||||
EXAMPLE_SOURCE += \
|
||||
src/cdc_app.c \
|
||||
src/main.c \
|
||||
src/uac2_app.c \
|
||||
src/usb_descriptors.c \
|
||||
|
||||
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
|
||||
|
||||
include ../../build_system/make/rules.mk
|
52
examples/device/cdc_uac2/README.md
Normal file
52
examples/device/cdc_uac2/README.md
Normal file
@ -0,0 +1,52 @@
|
||||
#### Composite CDC + UAC2 on Pico
|
||||
|
||||
This example provides a composite CDC + UAC2 device on top of a Raspberry Pi
|
||||
Pico board.
|
||||
|
||||
|
||||
#### Use Cases
|
||||
|
||||
- The CDC + UAC2 composite device happens to be important, especially in the
|
||||
amateur radio community.
|
||||
|
||||
Modern radios (`rigs`) like Icom IC-7300 + IC-705 expose a sound card and a
|
||||
serial device (`composite device`) to the computer over a single USB cable.
|
||||
This allows for Audio I/O and CAT control over a single USB cable which is
|
||||
very convenient.
|
||||
|
||||
By including and maintaining this example in TinyUSB repository, we enable
|
||||
the amateur radio community to build (`homebrew`) radios with similar
|
||||
functionality as the (expensive) commercial rigs.
|
||||
|
||||
This PR is important in bridging this specific gap between the commercial
|
||||
rigs and homebrew equipment.
|
||||
|
||||
- https://digirig.net/digirig-mobile-rev-1-9/ is a digital interface for
|
||||
interfacing radios (that lack an inbuilt digital interface) with computers.
|
||||
Digirig Mobile works brilliantly (is OSS!) and is a big improvement over
|
||||
traditional digital interfaces (like the SignaLink USB Interface). By using a
|
||||
Raspberry Pi Pico powered CDC + UAC2 composite device, we can simplify the
|
||||
Digirig Mobile schematic, drastically reduce the manufacturing cost, and
|
||||
(again) enable the homebrewers community to homebrew a modern digital interface
|
||||
with ease themselves.
|
||||
|
||||
|
||||
#### Build Steps
|
||||
|
||||
```
|
||||
cd examples/device/cdc_uac2
|
||||
|
||||
export PICO_SDK_PATH=$HOME/pico-sdk
|
||||
|
||||
cmake -DFAMILY=rp2040 pico .
|
||||
|
||||
cmake -DFAMILY=rp2040 -DCMAKE_BUILD_TYPE=Debug # use this for debugging
|
||||
|
||||
make BOARD=raspberry_pi_pico all
|
||||
```
|
||||
|
||||
|
||||
#### Development Notes
|
||||
|
||||
Please try to keep this code synchronized with the `uac2_headset` example
|
||||
included in this repository.
|
72
examples/device/cdc_uac2/src/cdc_app.c
Normal file
72
examples/device/cdc_uac2/src/cdc_app.c
Normal file
@ -0,0 +1,72 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2019 Ha Thach (tinyusb.org)
|
||||
* Copyright (c) 2022 Angel Molina (angelmolinu@gmail.com)
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "bsp/board_api.h"
|
||||
#include "tusb.h"
|
||||
#include "common.h"
|
||||
|
||||
// Invoked when cdc when line state changed e.g connected/disconnected
|
||||
void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts)
|
||||
{
|
||||
(void) itf;
|
||||
(void) rts;
|
||||
|
||||
if (dtr)
|
||||
{
|
||||
// Terminal connected
|
||||
}
|
||||
else
|
||||
{
|
||||
// Terminal disconnected
|
||||
}
|
||||
}
|
||||
|
||||
// Invoked when CDC interface received data from host
|
||||
void tud_cdc_rx_cb(uint8_t itf)
|
||||
{
|
||||
uint8_t buf[64];
|
||||
uint32_t count;
|
||||
|
||||
// connected() check for DTR bit
|
||||
// Most but not all terminal client set this when making connection
|
||||
if (tud_cdc_connected())
|
||||
{
|
||||
if (tud_cdc_available()) // data is available
|
||||
{
|
||||
count = tud_cdc_n_read(itf, buf, sizeof(buf));
|
||||
(void) count;
|
||||
|
||||
tud_cdc_n_write(itf, buf, count);
|
||||
tud_cdc_n_write_flush(itf);
|
||||
// dummy code to check that cdc serial is responding
|
||||
board_led_write(0);
|
||||
board_delay(50);
|
||||
board_led_write(1);
|
||||
board_delay(50);
|
||||
board_led_write(0);
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user