Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
467 commits
Select commit Hold shift + click to select a range
3682b6c
fix pre-commit, remove svd file since they are heavy and should be in…
hathach Jul 28, 2025
b531f43
add ci build for at32: f402_405, f403a_407, f423
hathach Jul 28, 2025
9c1115e
Add reconnect m
raldone01 Jul 29, 2025
b67e008
add ci build for all at32, use linker and startup from mcu cmsis inst…
hathach Jul 31, 2025
e0f2343
clean up
hathach Jul 31, 2025
a16c7a2
Merge pull request #3191 from hathach/at32
hathach Aug 1, 2025
9290788
add at32 to README.rst, rename at32 board to lower case, correct name…
hathach Aug 1, 2025
f5974b0
add bufsize to tud_msc_inquiry2_cb()
hathach Aug 1, 2025
dce5880
Merge pull request #3194 from hathach/at32-doc
hathach Aug 1, 2025
f66f98f
Update examples/device/msc_dual_lun/src/msc_disk_dual.c
hathach Aug 1, 2025
60f075d
Merge pull request #3195 from hathach/update-inquiry2
hathach Aug 2, 2025
12a1d0e
use tu_desc_in_bounds() for descriptor loop
hathach Aug 2, 2025
8f46021
Merge pull request #3183 from rppicomidi/fix_3159
hathach Aug 2, 2025
87d9e05
Merge pull request #3091 from raldone01/fix/web_serial
hathach Aug 2, 2025
d9aa4c6
fix tud_audio_set_itf_close_EP_cb() typo
hathach Aug 2, 2025
5153312
Merge pull request #3197 from hathach/fix-audio-typo
hathach Aug 5, 2025
2298c2f
Fix AT32F405xx missing USB HS definition
peppapighs Aug 5, 2025
4bfba6b
fix rp2 iso transfer: reset state before notify stack. since new audi…
hathach Aug 5, 2025
a014df9
Merge pull request #3200 from peppapighs/at32f405-usb-hs
hathach Aug 5, 2025
f6bec10
Merge pull request #3203 from hathach/fix-rp2-audio-iso-transfer
hathach Aug 5, 2025
283b06b
Add MTP class device
nbmaurizio Mar 12, 2025
5b9908a
update at32f405 dwc2 info and phy width selection
hathach Aug 7, 2025
5fb3c09
Merge pull request #3187 from s09289728096/fix_dhcp
hathach Aug 7, 2025
7142818
Fix STM32L4 GPIOD clock enable for variants without GPIOD
martijnvdwoude Aug 9, 2025
836f887
Add weact blackpill support
rhgndf Aug 10, 2025
4a78e4c
Add to boards.rst file
rhgndf Aug 10, 2025
24e596b
Fix file
rhgndf Aug 10, 2025
ddb8f0f
Add ESP32-C5 and ESP32-C61 definitions
tannewt Aug 15, 2025
b73a46b
added support for stm32l496nucleo
adam-embedded Aug 18, 2025
a75daaf
fixed typo in l496 make file
adam-embedded Aug 18, 2025
e1cd4aa
add some consumer page configs
ohmdelta Aug 20, 2025
bd9dd75
Small cleanups.
verylowfreq Aug 24, 2025
522a34e
Insert small delay for LowSpeed device
verylowfreq Aug 24, 2025
a3bb7a9
Improve retry operation at NAK response.
verylowfreq Aug 24, 2025
a6b4ed9
STM32N6570-DK board is added. Build with DEBUG=1 (make BOARD=stm32n65…
armusin Aug 24, 2025
eda5c3a
STM32N6570-DK gets listed in boards.rst
armusin Aug 24, 2025
6f2b5fc
Remove dynamic memory allocation
verylowfreq Aug 24, 2025
12ee78d
Fix osal_spin_unlock for mynewt
kasjer Aug 24, 2025
e36dab3
Merge pull request #3227 from kasjer/kasjer/mynwet-spin-lock-fix
HiFiPhile Aug 26, 2025
edf1882
Merge pull request #3217 from tannewt/esp32c5_c61
hathach Aug 27, 2025
38f41f5
fix(dcd/dwc2): Fix reset procedure for versions >=4.20a
tore-espressif Aug 28, 2025
8c5d052
Merge pull request #3228 from espressif/feat/dcd_dwc_v4.30a
tannewt Aug 28, 2025
f5d0483
use tusb_time_millis_api() instead of board_millis()
hathach Sep 3, 2025
bcff638
Merge pull request #3210 from martijnvdwoude/fix/stm32l4-gpiod-condit…
hathach Sep 3, 2025
5a50159
Merge pull request #3211 from rhgndf/at32f403a_weact_blackpill
hathach Sep 3, 2025
61761b9
Merge pull request #3225 from verylowfreq/pr-ch32v-usbfs-host
hathach Sep 3, 2025
c5a3909
add at32f415 dwc2 info
hathach Sep 3, 2025
08f3971
Initial plan
Copilot Sep 3, 2025
da9284e
Fix obsolete cnt assignment in _tu_fifo_peek() overflow check
Copilot Sep 3, 2025
f69d894
fix pre-commit and fix READONLY linker keyword with clang
hathach Sep 3, 2025
047b856
Merge pull request #3206 from hathach/update-at32f405-phywidth-sel
hathach Sep 3, 2025
a96ee81
remove duplicated enum
hathach Sep 4, 2025
2c0e360
Merge pull request #3221 from ohmdelta/master
hathach Sep 4, 2025
93487de
Merge pull request #3230 from hathach/copilot/fix-3218
hathach Sep 4, 2025
02e5c95
Initial plan
Copilot Sep 4, 2025
fe42b3a
Update STM32 CMSIS dependencies to fix HSITRIM register bug
Copilot Sep 4, 2025
640f57d
Remove accidentally committed dependency directories
Copilot Sep 4, 2025
f6ca80a
modified the bsp files of at32 to make them work better
Sep 4, 2025
7625b86
Update all STM32 HAL driver dependencies to latest versions
Copilot Sep 4, 2025
d69d41a
fix linker h745 issue with clang
hathach Sep 4, 2025
4b716ec
fix linker h745 issue with clang
hathach Sep 4, 2025
78ab527
Update all STM32 CMSIS device dependencies to latest versions
Copilot Sep 4, 2025
4ec81ba
Merge pull request #3235 from hathach/copilot/fix-3209
hathach Sep 4, 2025
90080d4
update pio-usb
hathach Sep 4, 2025
b2cdea9
Merge pull request #3237 from hathach/update-pio-usb
hathach Sep 4, 2025
89f8fbc
Create comprehensive GitHub Copilot instructions and fix pre-commit c…
Copilot Sep 4, 2025
3b983cb
the family name error of at32 has been corrected
Sep 5, 2025
a379efc
fix pre-commit
hathach Sep 5, 2025
8304587
Merge pull request #3236 from ning3270455369/master
hathach Sep 5, 2025
0263cfc
fix #3239: discard poorly formed packets
rppicomidi Sep 6, 2025
0592369
Merge pull request #3226 from armusin/stm32n6570-dk
hathach Sep 8, 2025
4a8b822
Merge pull request #3240 from rppicomidi/fix_3239
hathach Sep 8, 2025
d70d404
use tusb_time_delay_ms_api for delay, also move tusb_time api to comm…
hathach Sep 10, 2025
b6b2209
Merge pull request #3126 from salkinium/fix/phyc_pll
hathach Sep 10, 2025
19f67ff
Initial STM32WBARI eval support
danduril-netizen Sep 9, 2025
48f6b95
Incorporate upstream changes to dwc2_common.c
danduril-netizen Sep 9, 2025
2e9ae5a
STM32WBARI eval CMake build support
danduril-netizen Sep 10, 2025
c9527bc
Bring up to date with master
danduril-netizen Sep 10, 2025
9cde80f
fix pre-commit
hathach Sep 11, 2025
5e661ea
Revert "Incorporate upstream changes to dwc2_common.c"
hathach Sep 11, 2025
040d1b4
Make get_deps.py WBA definition consistent with upstream and other defs
danduril-netizen Sep 11, 2025
af7310b
Revert fsdev_stm32.h changes
danduril-netizen Sep 11, 2025
a20252a
Merge branch 'master' of github.com:Dolphindalt/tinyusb
danduril-netizen Sep 11, 2025
e09a2d8
Change CMSIS patch to match update path in family.mk for WBA
danduril-netizen Sep 11, 2025
9135977
rename stm32wba eval to nucleo
hathach Sep 12, 2025
ba36df6
fix warnings, update docs
hathach Sep 12, 2025
9f055f1
missing cmsis5 for wba
hathach Sep 12, 2025
2027ac2
Merge pull request #3245 from Dolphindalt/master
hathach Sep 12, 2025
d3ab48b
Fix IAR build
HiFiPhile Sep 12, 2025
5755afa
Fix some IAR warnings
HiFiPhile Sep 12, 2025
802819d
add all constant from MTP specs appendix, rename some e.g OPEC to OP,…
hathach Sep 12, 2025
3b4884f
Move BOARD_ConfigMPU into board specific init
HiFiPhile Sep 12, 2025
4db2bda
echi: fix NXP USBPHY disconnection detection
HiFiPhile Sep 12, 2025
99bee6a
ehci: fix removed qhd get reused
HiFiPhile Sep 12, 2025
fad3dc4
Merge branch 'master' into sb-ep
HiFiPhile Sep 12, 2025
7810b58
exclude stm32l0538 due to size limit
HiFiPhile Sep 12, 2025
8515e47
Update comment
HiFiPhile Sep 12, 2025
841cac6
Merge pull request #3152 from Milek7/sb-ep
HiFiPhile Sep 12, 2025
cf6cbf0
Fix AT32 compile after #3152
HiFiPhile Sep 12, 2025
c484aae
Merge pull request #3247 from hathach/fsdev_fix
hathach Sep 13, 2025
f674561
Merge pull request #3246 from HiFiPhile/nxp_host
hathach Sep 13, 2025
cc19c02
dwc2: wait for ahb idle before core reset
hathach Sep 15, 2025
6522067
fix imxrt build
hathach Sep 15, 2025
6f06eff
add nrf54 to dwc2 info
hathach Sep 15, 2025
feef534
Merge pull request #3251 from hathach/fix-dwc2-reseet
hathach Sep 15, 2025
8e34ba9
Merge branch 'master' into fork/ennebi/mtp
hathach Sep 15, 2025
4ef99ec
fix copying readme.txt contents
hathach Sep 15, 2025
5fb8c57
merge context into interface and refactor, reformat
hathach Sep 16, 2025
10298f0
refactor generic container to use EPBUF declaration
hathach Sep 16, 2025
4182342
Add ESP32-H4 as a supported MCU in TinyUSB and wire it into build/run…
igi540 Sep 16, 2025
d9ad09a
Merge pull request #3252 from espressif/feat/esp32h4_support
hathach Sep 16, 2025
541c62c
refactor mtp xfer callback
hathach Sep 16, 2025
aea56dc
remove mtp context
hathach Sep 16, 2025
f18b750
use existing overloadable Pico SDK section macro instead of creating …
majbthrd Sep 17, 2025
369a1ff
Update weak callbacks to new syntax
HiFiPhile Sep 17, 2025
73f3900
Replace old delay functions by tusb_time_delay_ms_api
HiFiPhile Sep 17, 2025
50949eb
Fix board_get_unique_id
HiFiPhile Sep 17, 2025
be9409b
Fix board_init_after_tusb
HiFiPhile Sep 17, 2025
47bb79a
Fix board_reset_to_bootloader
HiFiPhile Sep 17, 2025
ce41292
Fix address translation functions
HiFiPhile Sep 17, 2025
be618ba
Fix RPI build
HiFiPhile Sep 17, 2025
9d13c8f
Potential fix for code scanning alert no. 914: Commented-out code
HiFiPhile Sep 17, 2025
fd2cd3f
Merge pull request #3255 from majbthrd/enoughwheels
hathach Sep 18, 2025
b4cc5af
Fix ESP32 build
HiFiPhile Sep 18, 2025
e621f2f
set driver count to 0
HiFiPhile Sep 18, 2025
0961e06
Add usbd_edpt_xfer_fifo stub
HiFiPhile Sep 18, 2025
0655f98
Merge branch 'weak_cb' of https://github.com/hathach/tinyusb into wea…
HiFiPhile Sep 18, 2025
f99f203
reworking MTP API, adding callback, getting GetDeviceInfo working
hathach Sep 19, 2025
e76d09b
rework get storageIDs and get storage info
hathach Sep 19, 2025
57c5e55
rework get storageIDs and get storage info
hathach Sep 19, 2025
b70804b
implement get device properties value
hathach Sep 19, 2025
d9c6dfb
implement get device properties describer and device properties value
hathach Sep 20, 2025
7463705
Fix table display issue in README.rst
Isoheptane Sep 20, 2025
ff00470
Merge pull request #3258 from Isoheptane/patch-1
HiFiPhile Sep 20, 2025
f5a3f25
implement get objection handles
hathach Sep 21, 2025
4c81899
implement get object info
hathach Sep 21, 2025
6fa5268
implement get object, close session
hathach Sep 22, 2025
7162cae
Fix erroneous documentation of TU_ASSERT/TU_VERIFY
terjr Sep 22, 2025
5b200c4
Merge pull request #3259 from terjr/fix-tusb-verify-documentation
HiFiPhile Sep 22, 2025
1ab45bc
try to add logo png to mtp example
hathach Sep 23, 2025
3c39f60
refactor API
hathach Sep 23, 2025
6317730
unify callback argument. support multiple packet get object
hathach Sep 24, 2025
b8126d9
clean up
hathach Sep 24, 2025
f36b63a
Add HID Usage Page and Table for Power Devices (0x84 - 0x85)
ludoux Sep 24, 2025
f4a3c1a
Fix incorrect comments
ludoux Sep 25, 2025
f839771
implement MTP_OP_SEND_OBJECT_INFO, refactor fs example
hathach Sep 25, 2025
c9a8330
implement send object command, able to create new file
hathach Sep 25, 2025
879f02f
implement delete object
hathach Sep 25, 2025
34be38d
clean up, wrap up bulk command supported
hathach Sep 25, 2025
1f9c415
Merge pull request #3265 from ludoux/hid-power-devices
HiFiPhile Sep 25, 2025
e4f7fcf
fix compile warnings
hathach Sep 26, 2025
e92262e
fix more ci build
hathach Sep 26, 2025
5c630ee
skip mtp for cynthion_d11
hathach Sep 26, 2025
f9d4bc7
implement tud_mtp_mounted() and tud_mtp_event_send()
hathach Sep 26, 2025
cb21ca1
implement control request
hathach Sep 27, 2025
adce3bb
implement serial for MTP
hathach Sep 27, 2025
bc688cc
add edpt claim for public API
hathach Sep 27, 2025
a09c65c
make command container more consistent
hathach Sep 27, 2025
152d25e
Merge pull request #3256 from hathach/weak_cb
hathach Sep 27, 2025
8952838
audio: simplify alt settings management
HiFiPhile Sep 27, 2025
5130850
Merge pull request #3266 from hathach/uac_simplify
hathach Sep 29, 2025
4f3a5f9
refactor mtp examples, add phase and session id to callback data
hathach Sep 29, 2025
bdd557c
Merge branch 'master' into fork/ennebi/mtp
hathach Sep 29, 2025
ff492dc
fix ci
hathach Sep 29, 2025
ec5436b
bsp: Add STM32U083C-DK board
HiFiPhile Sep 29, 2025
bd35dd1
Fix PMA size for U0
HiFiPhile Sep 29, 2025
4cf7e95
Refresh board presets
HiFiPhile Sep 29, 2025
30f8a9d
Disable SBUF_ISO for U0
HiFiPhile Sep 29, 2025
7281bfb
Fix warning
HiFiPhile Sep 29, 2025
387c28a
Add u0 to ci
HiFiPhile Sep 29, 2025
2f9f5c6
Fix ci
HiFiPhile Sep 29, 2025
94b03e2
examples: make: fix LOGGER=rtt
karlp Sep 29, 2025
c33fd3e
Increase stack size to 2kB
HiFiPhile Sep 30, 2025
8206002
update docs
HiFiPhile Sep 30, 2025
732d4a8
fix serial, try to test mtp with hil
hathach Sep 30, 2025
43a7663
Merge pull request #3268 from HiFiPhile/stm32u083cdk
hathach Oct 1, 2025
43e6c9d
Merge pull request #3269 from karlp/pr/fix-rtt
hathach Oct 1, 2025
4e4e2be
test mtp with hil
hathach Oct 1, 2025
13c2401
minor update
hathach Oct 1, 2025
eceb281
Merge branch 'master' into fork/ennebi/mtp
hathach Oct 1, 2025
2693958
hil tinyusb always checkoutt/download artifacts
hathach Oct 1, 2025
acf2b8c
"Claude PR Assistant workflow"
hathach Oct 1, 2025
9da1113
"Claude Code Review workflow"
hathach Oct 1, 2025
6d32256
HIL add timeout for opening mtp device
hathach Oct 1, 2025
3c108b2
add CLAUDE.md and fix pre-commit build
hathach Oct 2, 2025
4a0613c
fix mtp serial
hathach Oct 2, 2025
3d71177
Merge pull request #3272 from hathach/add-claude-github-actions-17593…
hathach Oct 2, 2025
981dc98
mtp example work with highspeed device
hathach Oct 2, 2025
dbc2086
remove claude-code-review.yml
hathach Oct 2, 2025
f655d21
Merge pull request #3274 from hathach/remove-claude-code-review
hathach Oct 2, 2025
3773d60
fix typos
hathach Oct 2, 2025
9cd5fb6
skip mtp for now
hathach Oct 2, 2025
610f353
use cache to store skip board in hil ci
hathach Oct 2, 2025
c1bf19e
Merge pull request #3023 from ennebi/mtp
hathach Oct 2, 2025
e2dbf2b
remove claude code workflow
hathach Oct 3, 2025
3b00724
fix iar build
hathach Oct 3, 2025
f0670fd
fix make build
hathach Oct 3, 2025
c3f6c20
fix make stm32u0
hathach Oct 3, 2025
f3f6046
hil simplify skip board from previous run
hathach Oct 3, 2025
6ce46da
Merge pull request #3277 from hathach/remove-claude-code
hathach Oct 3, 2025
b18a8fb
update for release 0.19.0
hathach Oct 2, 2025
8832d22
update docs
hathach Oct 3, 2025
8d7e8a1
update docs
hathach Oct 4, 2025
afdfb08
Fix HIS stylus descriptor and hid_composite example
HiFiPhile Oct 5, 2025
331c263
Merge pull request #3276 from hathach/release-0.19.0
hathach Oct 6, 2025
f272d87
remove dcd_esp32sx which is replaced by dwc2
hathach Oct 6, 2025
f8ef71d
Merge pull request #3282 from hathach/remove-dcd_esp32sx
hathach Oct 6, 2025
e72a9eb
Merge pull request #3280 from HiFiPhile/hid_stylus
hathach Oct 6, 2025
044512c
fix typo
hathach Oct 6, 2025
7a96291
Merge pull request #3283 from hathach/fix-typo
hathach Oct 6, 2025
54fffd0
Fix preset with espressif
HiFiPhile Oct 6, 2025
5ac0bed
dcd/dwc2: fix enumration when EP0 size=8
HiFiPhile Oct 6, 2025
fedcdef
Merge remote-tracking branch 'tinyusb/master' into dwc2_ep0
HiFiPhile Oct 6, 2025
16dd749
dcd/dwc2: cleanup previous pending EP0 IN transfer if a SETUP packet …
HiFiPhile Oct 7, 2025
bf69c49
fix incorrect MTP xact_len calculation
RigoLigoRLC Oct 7, 2025
21ed72b
Merge pull request #3284 from RigoLigoRLC/upstream-contrib-mtp-xact
HiFiPhile Oct 8, 2025
e976a80
stm32h7rs: fix typo in makefile
HiFiPhile Oct 8, 2025
87523f2
Merge pull request #3288 from hathach/h7rs_typo
hathach Oct 9, 2025
2f90d7b
added AGENTS.md
hathach Oct 9, 2025
97f814a
Update AGENTS.md
hathach Oct 9, 2025
5cc9ade
Merge pull request #3289 from hathach/add-agents-md
hathach Oct 9, 2025
0587419
Initial plan
Copilot Oct 9, 2025
5a82112
docs: fix .rst links to use Sphinx :doc: role for proper HTML generation
Copilot Oct 9, 2025
20c8e92
Merge pull request #3290 from hathach/copilot/fix-dependency-link-in-…
hathach Oct 9, 2025
a97da37
Fix dcd_int_enable when remapping the USB interrupt
tangpipi Oct 9, 2025
0fab57b
Merge pull request #3279 from HiFiPhile/dwc2_ep0
hathach Oct 9, 2025
8f2e3ed
Merge pull request #3292 from tangpipi/fix_at32_remap
hathach Oct 9, 2025
aa0fc2e
successfully
poornadharshan13-rgb Oct 10, 2025
b5faf4f
increase timeout for mtp hil test
hathach Oct 11, 2025
33b6954
Merge pull request #3297 from hathach/hil-increase-timeout-for-mtp
hathach Oct 11, 2025
2e29d1c
Merge pull request #3293
hathach Oct 11, 2025
b19d863
Merge branch 'master' into fork/adam-embedded/with-stm32l496nucleo
hathach Oct 11, 2025
10e86b0
correct l496zg variant, fix build warning
hathach Oct 11, 2025
97741a5
Merge pull request #3220 from adam-embedded/with-stm32l496nucleo
hathach Oct 12, 2025
ee7a7c5
get cmake build with 54h20 not tested on actual hw, probably not running
hathach Oct 13, 2025
dacbe8e
update make build system rename pca10095 to nrf5340dk
hathach Oct 13, 2025
84f0cda
rename pca10056 to nrf52840dk, pca10059 to nrf52840dongle
hathach Oct 13, 2025
e0ee32c
fix build with west zephyr
hathach Oct 13, 2025
8242ffd
Add qodana.yaml file
qodana-bot Oct 13, 2025
23fc90a
Add github workflow file
qodana-bot Oct 13, 2025
77e0d06
Merge pull request #3300 from hathach/qodana-automation-241005150
hathach Oct 13, 2025
92d3414
Revert "Add qodana CI checks"
hathach Oct 13, 2025
7ccda4d
Merge pull request #3302 from hathach/revert-3300-qodana-automation-2…
hathach Oct 13, 2025
0c3631c
add tools that provided freely to develop project
hathach Oct 13, 2025
9a25b9e
Update README.rst
hathach Oct 14, 2025
9fd9fc6
Merge pull request #3304 from hathach/add-tool-for-oss
hathach Oct 14, 2025
38255ff
Merge pull request #3299 from hathach/initial-nrf54h20
hathach Oct 14, 2025
862eabd
Merge release 0.19.0 into alif
BogdanKokotenko-AlifSemi Oct 14, 2025
f35a105
Alif: Implement isochronous transfer
YevhenBobovskyi-AlifSemi Oct 16, 2025
3591a2c
Merge pull request #3 from AlifSemi-Sirin/alif_isoc
BogdanKokotenko-AlifSemi Oct 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 6 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,20 @@ jobs:
echo "MATRIX_JSON=$MATRIX_JSON"

BUILDSYSTEM_TOOLCHAIN=(
"cmake aarch64-gcc"
"cmake arm-clang"
"cmake arm-gcc"
"cmake esp-idf"
"make aarch64-gcc"
"make arm-gcc"
"make msp430-gcc"
"make riscv-gcc"
"make rx-gcc"
"cmake msp430-gcc"
"cmake riscv-gcc"
)

# only build IAR if not forked PR, since IAR token is not shared
if [ -z $CIRCLE_PR_USERNAME ]; then
BUILDSYSTEM_TOOLCHAIN+=("cmake arm-iar")
fi

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

gen_build_entry() {
local build_system="$1"
Expand Down Expand Up @@ -67,7 +66,7 @@ jobs:
FAMILY_LARGE=$(jq -n --argjson family "$FAMILY" --argjson resource "$RESOURCE_LARGE" '$family | map(select(IN($resource[])))')
FAMILY=$(jq -n --argjson family "$FAMILY" --argjson resource "$RESOURCE_LARGE" '$family | map(select(IN($resource[]) | not))')

if [[ $toolchain == esp-idf ]]; then
if [[ $toolchain == esp-idf || $toolchain == arm-iar ]]; then
gen_build_entry "$build_system" "$toolchain" "$FAMILY" "large"
else
gen_build_entry "$build_system" "$toolchain" "$FAMILY" "medium+"
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ body:

- type: checkboxes
attributes:
label: I have checked existing issues, dicussion and documentation
label: I have checked existing issues, discussion and documentation
description: You agree to check all the resources above before opening a new issue.
options:
- label: I confirm I have checked existing issues, dicussion and documentation.
- label: I confirm I have checked existing issues, discussion and documentation.
required: true
190 changes: 190 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
# TinyUSB
TinyUSB is an open-source cross-platform USB Host/Device stack for embedded systems, designed to be memory-safe with no dynamic allocation and thread-safe with all interrupt events deferred to non-ISR task functions.

Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.

## Working Effectively

### Bootstrap and Build Setup
- Install ARM GCC toolchain: `sudo apt-get update && sudo apt-get install -y gcc-arm-none-eabi`
- Fetch core dependencies: `python3 tools/get_deps.py` -- takes <1 second. NEVER CANCEL.
- For specific board families: `python3 tools/get_deps.py FAMILY_NAME` (e.g., rp2040, stm32f4)
- Dependencies are cached in `lib/` and `hw/mcu/` directories

### Build Examples
Choose ONE of these approaches:

**Option 1: Individual Example with CMake (RECOMMENDED)**
```bash
cd examples/device/cdc_msc
mkdir -p build && cd build
cmake -DBOARD=raspberry_pi_pico -DCMAKE_BUILD_TYPE=MinSizeRel ..
cmake --build . -j4
```
-- takes 1-2 seconds. NEVER CANCEL. Set timeout to 5+ minutes.

**CMake with Ninja (Alternative)**
```bash
cd examples/device/cdc_msc
mkdir build && cd build
cmake -G Ninja -DBOARD=raspberry_pi_pico ..
ninja
```

**Option 2: Individual Example with Make**
```bash
cd examples/device/cdc_msc
make BOARD=raspberry_pi_pico all
```
-- takes 2-3 seconds. NEVER CANCEL. Set timeout to 5+ minutes.

**Option 3: All Examples for a Board**
```bash
python3 tools/build.py -b BOARD_NAME
```
-- takes 15-20 seconds, may have some objcopy failures that are non-critical. NEVER CANCEL. Set timeout to 30+ minutes.

### Build Options
- **Debug build**:
- CMake: `-DCMAKE_BUILD_TYPE=Debug`
- Make: `DEBUG=1`
- **With logging**:
- CMake: `-DLOG=2`
- Make: `LOG=2`
- **With RTT logger**:
- CMake: `-DLOG=2 -DLOGGER=rtt`
- Make: `LOG=2 LOGGER=rtt`
- **RootHub port selection**:
- CMake: `-DRHPORT_DEVICE=1`
- Make: `RHPORT_DEVICE=1`
- **Port speed**:
- CMake: `-DRHPORT_DEVICE_SPEED=OPT_MODE_FULL_SPEED`
- Make: `RHPORT_DEVICE_SPEED=OPT_MODE_FULL_SPEED`

### Flashing and Deploymen
- **Flash with JLink**:1
- CMake: `ninja cdc_msc-jlink`
- Make: `make BOARD=raspberry_pi_pico flash-jlink`
- **Flash with OpenOCD**:
- CMake: `ninja cdc_msc-openocd`
- Make: `make BOARD=raspberry_pi_pico flash-openocd`
- **Generate UF2**:
- CMake: `ninja cdc_msc-uf2`
- Make: `make BOARD=raspberry_pi_pico all uf2`
- **List all targets** (CMake/Ninja): `ninja -t targets`

### Unit Testing
- Install Ceedling: `sudo gem install ceedling`
- Run all unit tests: `cd test/unit-test && ceedling` or `cd test/unit-test && ceedling test:all` -- takes 4 seconds. NEVER CANCEL. Set timeout to 10+ minutes.
- Run specific test: `cd test/unit-test && ceedling test:test_fifo`
- Tests use Unity framework with CMock for mocking

### Documentation
- Install requirements: `pip install -r docs/requirements.txt`
- Build docs: `cd docs && sphinx-build -b html . _build` -- takes 2-3 seconds. NEVER CANCEL. Set timeout to 10+ minutes.

### Code Quality and Validation
- Format code: `clang-format -i path/to/file.c` (uses `.clang-format` config)
- Check spelling: `pip install codespell && codespell` (uses `.codespellrc` config)
- Pre-commit hooks validate unit tests and code quality automatically

## Validation

### ALWAYS Run These After Making Changes
1. **Pre-commit validation** (RECOMMENDED): `pre-commit run --all-files`
- Install pre-commit: `pip install pre-commit && pre-commit install`
- Runs all quality checks, unit tests, spell checking, and formatting
- Takes 10-15 seconds. NEVER CANCEL. Set timeout to 15+ minutes.
2. **Build validation**: Build at least one example that exercises your changes
```bash
cd examples/device/cdc_msc
make BOARD=raspberry_pi_pico all
```

### Manual Testing Scenarios
- **Device examples**: Cannot be fully tested without real hardware, but must build successfully
- **Unit tests**: Exercise core stack functionality - ALL tests must pass
- **Build system**: Must be able to build examples for multiple board families

### Board Selection for Testing
- **STM32F4**: `stm32f407disco` - no external SDK required, good for testing
- **RP2040**: `raspberry_pi_pico` - requires Pico SDK, commonly used
- **Other families**: Check `hw/bsp/FAMILY/boards/` for available boards

## Common Tasks and Time Expectations

### Repository Structure Quick Reference
```
├── src/ # Core TinyUSB stack
│ ├── class/ # USB device classes (CDC, HID, MSC, Audio, etc.)
│ ├── portable/ # MCU-specific drivers (organized by vendor)
│ ├── device/ # USB device stack core
│ ├── host/ # USB host stack core
│ └── common/ # Shared utilities (FIFO, etc.)
├── examples/ # Example applications
│ ├── device/ # Device examples (cdc_msc, hid_generic, etc.)
│ ├── host/ # Host examples
│ └── dual/ # Dual-role examples
├── hw/bsp/ # Board Support Packages
│ └── FAMILY/boards/ # Board-specific configurations
├── test/unit-test/ # Unit tests using Ceedling
├── tools/ # Build and utility scripts
└── docs/ # Sphinx documentation
```

### Build Time Reference
- **Dependency fetch**: <1 second
- **Single example build**: 1-3 seconds
- **Unit tests**: ~4 seconds
- **Documentation build**: ~2.5 seconds
- **Full board examples**: 15-20 seconds
- **Toolchain installation**: 2-5 minutes (one-time)

### Key Files to Know
- `tools/get_deps.py`: Manages dependencies for MCU families
- `tools/build.py`: Builds multiple examples, supports make/cmake
- `src/tusb.h`: Main TinyUSB header file
- `src/tusb_config.h`: Configuration template
- `examples/device/cdc_msc/`: Most commonly used example for testing
- `test/unit-test/project.yml`: Ceedling test configuration

### Debugging Build Issues
- **Missing compiler**: Install `gcc-arm-none-eabi` package
- **Missing dependencies**: Run `python3 tools/get_deps.py FAMILY`
- **Board not found**: Check `hw/bsp/FAMILY/boards/` for valid board names
- **objcopy errors**: Often non-critical in full builds, try individual example builds

### Working with USB Device Classes
- **CDC (Serial)**: `src/class/cdc/` - Virtual serial port
- **HID**: `src/class/hid/` - Human Interface Device (keyboard, mouse, etc.)
- **MSC**: `src/class/msc/` - Mass Storage Class (USB drive)
- **Audio**: `src/class/audio/` - USB Audio Class
- Each class has device (`*_device.c`) and host (`*_host.c`) implementations

### MCU Family Support
- **STM32**: Largest support (F0, F1, F2, F3, F4, F7, G0, G4, H7, L4, U5, etc.)
- **Raspberry Pi**: RP2040, RP2350 with PIO-USB host support
- **NXP**: iMXRT, Kinetis, LPC families
- **Microchip**: SAM D/E/G/L families
- Check `hw/bsp/` for complete list and `docs/reference/boards.rst` for details

## Code Style Guidelines

### General Coding Standards
- Use C99 standard
- Memory-safe: no dynamic allocation
- Thread-safe: defer all interrupt events to non-ISR task functions
- 2-space indentation, no tabs
- Use snake_case for variables/functions
- Use UPPER_CASE for macros and constants
- Follow existing variable naming patterns in files you're modifying
- Include proper header comments with MIT license
- Add descriptive comments for non-obvious functions

### Best Practices
- When including headers, group in order: C stdlib, tusb common, drivers, classes
- Always check return values from functions that can fail
- Use TU_ASSERT() for error checking with return statements
- Follow the existing code patterns in the files you're modifying

Remember: TinyUSB is designed for embedded systems - builds are fast, tests are focused, and the codebase is optimized for resource-constrained environments.
Loading