Commit Graph

10663 Commits

Author SHA1 Message Date
044cd06f87 ci: address second codex/copilot review round
- claude.yml: drop the issues "assigned" trigger; its author_association
  gate keys on the issue author, not the assigner, so a maintainer
  assigning an outside contributor's issue would be wrongly skipped.
- claude-code-review.yml: issues: read -> write so use_sticky_comment can
  create/update its PR comment via the issues API.
- hil SKILL.md: make local/remote command blocks copy-pasteable (drop
  [-b BOARD_NAME] notation for concrete examples) and fix timeout
  (600000 ms is 10 min; use 1200000 ms for the stated 20 min).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 00:24:05 +07:00
1ea04f7fe6 ci: address codex/copilot review on claude workflows
- claude.yml: gate @claude on author_association (OWNER/MEMBER/COLLABORATOR)
  so the write-scoped token and OAuth secret are never issued for an
  untrusted commenter on this public repo (defense-in-depth).
- claude-code-review.yml: skip fork PRs in the job condition
  (head.repo.full_name == github.repository) since forks get no secrets
  and would only fail noisily; fix the misleading token comment; pass
  additional_permissions: actions: read so actions: read is effective.
- hil SKILL.md: reword hostname guidance, use full test/hil/* paths, and
  show an explicit CONFIG= assignment so the local command is runnable.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 00:16:54 +07:00
87f9cc01cf ci: re-enable Claude PR review and harden auth/permissions
- claude-code-review.yml: re-enable (drop `if: false`); switch from
    pull_request_target to pull_request so fork PRs never receive the
    OAuth token (avoids prompt-injection token leak). Auto-review on
    open/synchronize/reopen/ready_for_review, skip drafts, sticky comment.
  - claude.yml: grant contents/pull-requests/issues write so @claude can
    reply and push fixes; @claude is the on-demand path for fork PRs.
2026-06-01 23:51:41 +07:00
95d11a8a7a docs(hil): support running HIL locally on ci.lan
Update the hil skill so config selection is per-host: run `hostname`
  first, then htpc uses local.json and ci uses tinyusb.json. ci can now
  run HIL on its own large board pool locally instead of only via SSH
  from htpc. Remote (SSH) mode is htpc-only since ci cannot reach htpc.
  Also compact the skill for brevity.
2026-06-01 23:51:24 +07:00
bbdb41995d Merge pull request #3657 from hathach/usbh-add-control-queue
Add control transfer fifo for host stack
2026-06-01 12:42:03 +07:00
17185428df CFG_TUH_CONTROL_PENDING_QUEUE_SZ defefault to 4 if hub is eanbled, 2 if not 2026-06-01 10:58:36 +07:00
7e0fcaa41e ultrareview nits: keep xfer_result table in sync, hoist blinky loop
- src/tusb.c: extend tu_str_xfer_result[] with "ABORTED" and "INVALID"
  to match the new enum size. Not reachable today (no HCD posts those
  values through hcd_event_xfer_complete), but keeps the enum/table
  invariant intact so future HCDs that surface ABORTED don't index OOB.

- examples/dual/dynamic_switch/src/main.c: apply the same while(1)
  hoist already done for cdc_task / print_devinfo_task to
  led_blinking_task. On OS_NONE the loop returned mid-iteration, which
  on first call could fire multiple back-to-back toggles while
  start_ms (initially 0) caught up to uptime.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 10:05:17 +07:00
2c27ec9c89 Merge pull request #3620 from UMRnInside/fix-ch32v103-hardfault
Fix ch32v103 hardfault & Add CH32V103C8T6 Bluepill board
2026-05-30 17:05:01 +02:00
26724bfb13 Merge pull request #3658 from wjklimek1/mtp-out-transfer-fix
Fix premature MTP phase change after short MTP OUT transfer
2026-05-30 13:04:35 +02:00
d3ae3a02a9 Merge pull request #3634 from HKM-Messtechnik/fix/Dwc2Stm32U5
dwc2: preserve EP0 status completion before SETUP
2026-05-30 13:03:32 +02:00
08381d4421 esp32 build fixes
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-30 11:46:18 +02:00
a64eb336c4 dynamic_switch: hoist while(1) out for OS_NONE
Sonar flagged the loop body as executing only once on OS_NONE because
the OS_NONE branch returns inside the first iteration (main() drives
the task again). Make the while(1) conditional on RTOS so the OS_NONE
build is a straight-line function with no misleading loop.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-30 00:52:22 +07:00
fc933e341d midi2_host: silence IAR Pe550 for midi2_idx
The variable is set in mount/umount callbacks but not read elsewhere
in the example (rx_cb already receives idx as a parameter). IAR
treats Pe550 as an error under --warnings_are_errors. Tag it
TU_ATTR_UNUSED so the example still shows the pattern of tracking
the device index without erroring on unused-set.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-30 00:46:16 +07:00
0761df7420 midi2_host: drop unreachable return 0 for IAR Pe111
Same fix as midi2_device — IAR rejects the unreachable statement
after the while(1) superloop. Let int main fall off the end.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-30 00:42:14 +07:00
28beb0fe4d ci: fix IAR Pe111 and stm32h7s3 flash overflow
- examples/device/midi2_device/src/main.c: drop the unreachable
  `return 0;` after the `while(1)` superloop. IAR with
  --warnings_are_errors rejects Pe111 (statement is unreachable);
  C99 lets `int main` fall off the end, matching midi_test.

- examples/host/msc_file_explorer_freertos/skip.txt: skip
  stm32h7s3nucleo. The board has only 64 KB on-chip FLASH and the
  FreeRTOS + FatFS host MSC explorer now overflows by ~248 bytes
  after the async control queue refactor.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-30 00:11:19 +07:00
24700ea8ef midi2_device: gate -Wno-type-limits to GCC/Clang for IAR build
iccarm rejects -Wno-type-limits, breaking the hil-hfp-iar CI matrix
(stm32l412nucleo, stm32f746disco, lpcxpresso43s67). Apply the same
CMAKE_C_COMPILER_ID guard used in hw/bsp/family_support.cmake so IAR
builds skip the flag without losing the GCC warning suppression.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 23:59:15 +07:00
3be8226b18 Merge branch 'master' into usbh-add-control-queue 2026-05-29 23:55:25 +07:00
b4e7c25c1b dwc2: process IN EP before OUT
To avoid STATUS IN completion of previous control transfer treated as next DATA IN  when IRQ latency is high.

Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-29 11:42:47 +02:00
84e3347bad Handle OUT transfer completion in MTP
Handle OUT transfer differently from IN to not prematurely change MTP phase when host sends short packet that is not end of MTP data phase. Only reaching container length or ZLP should change phase.
2026-05-29 11:39:07 +02:00
d754c0697c Implement asynchronous control transfer queuing for USB host stack
- Added a pending FIFO queue for asynchronous control transfers when the active slot is busy.
- Introduced `control_xfer_dispatch_pending` to handle queued transfers on slot availability.
- Improved synchronization for blocking and non-blocking transfer modes, preventing deadlocks in RTOS.
- Refactored and renamed related functions for clarity and consistency.
- Enhanced error handling and callback invocation for failed or stale transfers.
2026-05-29 16:16:21 +07:00
33f151a43b bsp/stm32f4: enable flash cache
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-29 10:03:09 +02:00
d85ddd2f8a bsp/stm32f7: fix f746disco jlink device
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-29 00:39:19 +02:00
6e63910d2a Merge remote-tracking branch 'tinyusb/master' into fix/Dwc2Stm32U5 2026-05-29 00:23:46 +02:00
dafdc5c54f dwc2: move OUT transfer management into RXFLVL IRQ
- GRXSTSP register has internal FIFO, receiving events won't mix up (STATUS OUT & next SETUP)
- Improve efficiency, remove 2nd IRQ overhead

Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-29 00:05:44 +02:00
c5676382c7 abstract OS logic with CFG_TUSB_OS_HAS_SCHEDULER to simplify conditional checks 2026-05-28 18:23:46 +07:00
c954c8c4c7 remove sync() in tinyusb callback since it cause issue with RTOS when usbh task is blocking 2026-05-28 18:20:22 +07:00
616acfa732 osal add osal_task_get_current_handle() 2026-05-27 19:20:58 +07:00
4a131e1562 hil: replace pyfatfs with mtools, update host setup instructions
- Removed `pyfatfs` dependency in favor of `mtools` for reading FAT volumes, simplifying the block device read logic.
- Updated `requirements.txt` and added detailed host setup instructions for system packages.
- Switched to `cython-hidapi` for HID tests, replacing deprecated APIs with updated usage.
- Removed unnecessary warnings suppression and `fs` module.
2026-05-27 17:43:22 +07:00
a560281051 dwc2: fix EP0 DMA setup race condition
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-27 00:35:25 +02:00
e520cff090 dwc2: simplify EP0 ZLP handling
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-27 00:32:15 +02:00
6f59b79a6c Merge pull request #3651 from Phozer/cdc_msc_freertos_example-Typo_Fix
Fix typo in CDC stack size constant
2026-05-26 17:39:59 +02:00
0c84999046 Merge pull request #3652 from rhgndf/fix/ch32-usbhs-issues
ch32_usbhs: fix endpoint stall length index and clear-stall response
2026-05-26 17:30:44 +02:00
44a897bff0 Fix typo in CDC stack size constant here too 2026-05-26 17:25:10 +02:00
97d84e0fd5 Enable GPIOC for CH32V103 bluepill boards 2026-05-26 22:52:30 +08:00
4ba1c39a22 Fix typo in CDC stack size constant 2026-05-26 16:47:12 +02:00
d63a45509f ch32_usbhs: fix endpoint stall length index and clear-stall response
Fix issue in the stall handling:

- dcd_edpt_stall() for an IN endpoint cleared EP_TX_LEN(0) instead of
  EP_TX_LEN(ep_num), clobbering endpoint 0's transmit length register
  when stalling any other IN endpoint.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 21:00:31 +08:00
7b9f6eabd8 Merge pull request #3649 from hathach/hathach-funding
Set GitHub Sponsors username in FUNDING.yml
2026-05-25 13:09:11 +07:00
64915e6b40 Set GitHub Sponsors username in FUNDING.yml
Updated GitHub Sponsors username for funding.
2026-05-25 12:59:30 +07:00
e7d59fba35 Fix missing prototype in ch32v10x bsp 2026-05-24 10:21:41 +08:00
972670aed4 use vendor-specific CSR 0x800 to toggle IRQ 2026-05-24 10:00:06 +08:00
3adb63e62a Fix typo found by Copilot
chinese -> Chinese
manufactors -> manufacturers

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-24 09:27:32 +08:00
65fb8dfbad Merge pull request #3622 from mickabrig7/master
fix(dcd_ch32_usbfs): fix dropped bulk OUT packets by properly re-arming EP_RX_CTRL state
2026-05-23 21:12:30 +02:00
311fb46eb2 dcd/ch32x: optmize CTRL reg writing, basically revert e14b0e85
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-23 20:06:50 +02:00
420de14b50 dcd/ch32hs: refactor transfer flow
Refactor the driver to follow USBFS style for easier maintenance.
Replace the old packet/response helpers with explicit queue and update paths for IN and OUT transfers.
Introduce transfer validity tracking and per-endpoint data toggle state.
Reset toggle state on init, close-all, endpoint close, clear-stall, and bus reset.
Initialize endpoint controls consistently in NAK + TOG_0 mode.
Tighten EP0 setup/status handling and route transfer IRQ processing through the transfer-flag path.
Stop enabling ISO_ACT in INT_EN and clear unhandled interrupt flags explicitly.

Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-23 19:37:47 +02:00
1fc308fb87 tweak examples
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-23 19:37:47 +02:00
c6beac24ca dcd/ch32fs: do not set EP0 to ACK on status complete
It would casue race condition, SETUP packet is always acked.

Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-23 19:21:59 +02:00
08cd5c3270 dcd/ch32fs: clear INT flag after processing
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-23 17:45:16 +02:00
b66fc7e884 dcd/ch32x : code reformat
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-23 13:10:47 +02:00
e14b0e8514 dcd/ch32fs: set EP to NAK earlier to reduce spuroius transfer
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-23 13:02:53 +02:00
b3141bb259 set ch32v20x EP on supported audio examples
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-23 13:00:41 +02:00