Commit Graph

8999 Commits

Author SHA1 Message Date
hathach
c1d23a0a92 osal_spin skipping lock/unlock when executed in isr 2025-05-21 11:19:07 +07:00
hathach
a4875fefea rename osal_critcal to osal_spinlock
add spinlock implementation for most rtos
2025-05-20 17:01:31 +07:00
hathach
bb1d348eb3 implement osal critical for none/freertos/pico-sdk 2025-05-19 22:51:40 +07:00
hathach
bffe5d97cc limit hil-hfp iar build to 4 parallel jobs 2025-05-19 20:22:29 +07:00
hathach
9aea7751f2 dwc2 only enter critical in isr with multiple core CPUs 2025-05-19 20:04:20 +07:00
hathach
72ee742761 add osal_critical API() for use with dwc2 2025-05-19 20:04:19 +07:00
Tomas Rezucha
c8baba10f9 fix(dcd): Fixed race condition on device disconnect
TinyUSB does not provide any locking means to protect the DCD variables.
This can lead to race conditions when the user is trying to submit
a transfer while the device is being disconnected. This can cause
the device to be in an inconsistent state, leading to a crash or
undefined behavior.

This commit adds a spin-lock to protect the DCD variables during
device disconnect.

Closes https://github.com/espressif/esp-idf/issues/9691
Also reported in https://github.com/espressif/esp-usb/pull/131
2025-05-19 20:04:16 +07:00
Ha Thach
3024bff12f Merge pull request #3123 from hathach/follow-up-pr3118
follow up to pr3118, interface also end with IAD. Add more checks
2025-05-16 21:10:02 +07:00
hathach
67389f37f2 follow up to pr3118, interface also end with IAD. Add more checks 2025-05-16 16:39:53 +07:00
HiFiPhile
531fb69531 Merge pull request #3118 from ZakDanger/vendor_device_fix
vendor device open fix for descriptor parsing
2025-05-16 10:25:28 +02:00
Ha Thach
9548d51c7e Merge pull request #3121 from hathach/bump-gcc14
Bump gcc14
2025-05-15 21:46:55 +07:00
hathach
38e5a67461 bump up pio-usb and codeql version 2025-05-15 10:27:00 +07:00
hathach
0ebc91ec97 update stm32wb linker to match new startup 2025-05-14 15:41:57 +07:00
hathach
fe4446090e fix dual example for rp2350 conflict printf and cdc_printf 2025-05-13 16:27:26 +07:00
hathach
ed087b9ed8 pump up pico-pio-usb and cmsis_device_wb 2025-05-13 16:13:50 +07:00
hathach
baf67539fc fix warnings, minor clean up 2025-05-13 12:16:22 +07:00
hathach
228b2dec1c bump ci to gcc 14 2025-05-12 15:40:58 +07:00
HiFiPhile
a2117d5d0f simplify vendord_open parsing loop
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-05-09 16:43:19 +02:00
ZakDanger
6b30a61bdb revert 'end fix' 2025-05-09 20:44:11 +10:00
ZakDanger
ae8c00f5d7 revert 'end fix' 2025-05-09 20:42:19 +10:00
ZakDanger
f5944d35b0 vendor device open fix for descriptor parsing 2025-05-09 18:17:07 +10:00
Ha Thach
542e5b4550 Merge pull request #3114 from hathach/fix-sigma-mouse-multiple-attach
Fix sigma mouse multiple attach
2025-05-06 21:40:23 +07:00
hathach
a05fc50461 clean up ci 2025-05-06 18:41:12 +07:00
hathach
fb2214dea6 move hil into build workflow 2025-05-06 16:30:34 +07:00
hathach
809af3e74c chore(usbh): change removing_hubs to array instead of bitmask 2025-05-06 15:58:07 +07:00
hathach
bc37ed6e3e usbh: force removed device in the same bus info, before setting address.
usbh: move code around
hub: queue status endpoint for detach/remove event
2025-05-06 15:23:23 +07:00
Ha Thach
1a783b3573 Merge pull request #3104 from hathach/usbh-attach-debounce
Usbh attach debounce
2025-04-29 21:36:18 +07:00
hathach
2abd3c54c4 define hcd_devtree_info_t forr backward compatible 2025-04-29 20:49:47 +07:00
hathach
e7d4b5c9e7 add enum for set addr recovery 2025-04-29 20:16:50 +07:00
hathach
fc43eeddf2 attach debouncing fixed issue with port1 highspeed on imxrt 2025-04-29 10:11:20 +07:00
hathach
42d4f7c81e remove the old attach duplicated logic, debouncing skip should take care of it. 2025-04-28 15:10:03 +07:00
hathach
2c1414b4c1 usbh: add roothub debounncing flag to ignore attach/remove event on the roothub that is currently doing debouncing delay 2025-04-28 14:59:32 +07:00
Ha Thach
a22e45b816 Merge pull request #3100 from wavenumber-eng/get_deps_fix
Fixed broken deps on a fresh clone
2025-04-28 10:36:29 +07:00
Eli Hughes
0937a2b2d3 using get-deps from tinyuf2 2025-04-27 09:38:18 -04:00
Ha Thach
b5d4d0f623 Merge pull request #3096 from hathach/usbh-improve-hub
Usbh improve hub
2025-04-24 23:02:18 +07:00
hathach
b5b7a4be60 hub check status before get 1st device descriptor 2025-04-24 22:21:38 +07:00
hathach
093720f60b fix build 2025-04-24 18:08:00 +07:00
hathach
0f784e8a07 refactor hub driver and move port reset on connection change to usbh.
hub: add hub_port_get_status_local(), ignore resp in hub_port_get_status(pot != 0)
usbh properly deboucning with hub/rootport accordingly to usb specs, also add 10ms of reset recovery
2025-04-24 17:59:45 +07:00
Ha Thach
1afe8a0039 Merge pull request #3095 from fenugrec/ex_cmake_CM0
examples cmake: fix gcc flag -mcpu=cortex=m0
2025-04-24 10:46:14 +07:00
hathach
89f8d0cffb add tuh_address_set() API
minor rename and move code around
2025-04-24 10:41:00 +07:00
fenugrec
736b1d50bc examples cmake: fix gcc flag -mcpu=cortex-m0 2025-04-23 16:04:42 -04:00
Ha Thach
8b3c558881 Merge pull request #3093 from hathach/refactor-usbh-bus-info
refactor(usbh) improve the usage of bus info
2025-04-23 20:08:38 +07:00
hathach
9a1f690ec4 move usbh ctrl_xfer into usbh_data 2025-04-23 16:50:58 +07:00
hathach
a2da575793 rename and expose tuh_bus_info_get() to application 2025-04-23 16:03:40 +07:00
hathach
741cb3cf02 rename hcd_devtree_info_t to tuh_bus_info_t, hcd_devtree_get_info to hcd_bus_info_get
streamline bus info to usbh_devies, also replace dev0 (renamed to dev0_bus)
2025-04-23 12:35:32 +07:00
Ha Thach
b632686f54 Merge pull request #3080 from HiFiPhile/enum_racing
host: fix enumerate racing
2025-04-23 10:41:14 +07:00
HiFiPhile
b6170c965f Compile fix.
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-04-22 21:14:04 +02:00
hathach
8f9ef7dfbe reduce ENUM_DEBOUNCING_DELAY_MS to 200ms
replace dev0.enumerating by enumerating_daddr for better clean up on unplugging while enumerating
move controller_id & enumerating_daddr into _usbh_data struct
2025-04-22 22:09:06 +07:00
hathach
940fe43e68 move removing dev0 to process_removing_device() 2025-04-22 17:33:37 +07:00
HiFiPhile
7ba63a6302 Also cleanup unaddressed device.
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-04-22 16:58:13 +07:00