Andrew Leech
5de4a23abe
Add USB NCM link state control support
...
This adds the ability to dynamically control the network link state
for NCM devices. The host OS will see the network interface as
connected/disconnected based on the link state.
New API:
- tud_network_link_state(rhport, is_up): Set link up/down state
Example updates:
- Added button control to toggle link state
- Fixed LWIP integration to properly handle link state changes
- Added printf to show correct protocol (NCM vs RNDIS/ECM)
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-05-29 09:36:38 +10:00
hathach
132c55aca0
add OPT_MCU_MAX32665
2025-05-28 08:38:26 +07:00
Ha Thach
8f077f9295
Merge pull request #3111 from hathach/ci_vbus
2025-05-23 21:50:00 +07:00
HiFiPhile
1a13bd8eba
Add comment about CFG_TUD_CI_HS_VBUS_CHARGE
...
Signed-off-by: HiFiPhile <admin@hifiphile.com >
2025-05-23 13:27:27 +02:00
hathach
e41a63c60d
add usbh_spin_lock/unlock() use spinlock instead of atomic flag for hcd max3421
2025-05-21 15:27:18 +07:00
hathach
58dfc126ac
remove unused dwc2_critical.h
2025-05-21 14:36:53 +07:00
hathach
5551a3e430
add usbd_spin_lock/unlock for driver usage
2025-05-21 11:41:06 +07:00
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
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
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
HiFiPhile
6346fbec16
Merge branch 'master' into h7rs
2025-05-15 21:40:36 +02:00
hathach
fe4446090e
fix dual example for rp2350 conflict printf and cdc_printf
2025-05-13 16:27:26 +07:00
hathach
baf67539fc
fix warnings, minor clean up
2025-05-13 12:16:22 +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
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
HiFiPhile
6a92b8efa4
dcd/ci_hs: add vbus charge option.
...
Signed-off-by: HiFiPhile <admin@hifiphile.com >
2025-05-04 15:10:17 +02: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
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
hathach
89f8d0cffb
add tuh_address_set() API
...
minor rename and move code around
2025-04-24 10:41:00 +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
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
HiFiPhile
3c4e6a779d
Move decouncing delay before USB reset.
...
Signed-off-by: HiFiPhile <admin@hifiphile.com >
2025-04-22 16:58:12 +07:00
HiFiPhile
9f096ac56b
host: fix enumerate racing
...
- if a previous enumeration failed _ctrl_xfer status could stuck, it needs to be cleared before next attempt.
- after _dev0.enumerating is reset in hcd_event_handler(), if an attach event arrived before _ctrl_xfer clean up in remove event, a racing condition will happen.
Signed-off-by: HiFiPhile <admin@hifiphile.com >
2025-04-22 16:58:10 +07:00
Ha Thach
18d7a993be
Merge pull request #3075 from maximevince/dwc2-proper-attach-debouncing
...
dwc2/host: attach debouncing fixes
2025-04-21 22:46:15 +07:00
hathach
5725d33121
improve usbh stability with failed setup send, prevent control stage locked out
2025-04-21 20:39:23 +07:00
Ha Thach
56ed51c8fb
Merge pull request #3088 from HiFiPhile/intv
...
Fix 1st nak retry one frame shorter.
2025-04-21 18:31:43 +07:00
HiFiPhile
b3a9b6e37f
enable SOF interrupt only if not already enabled
...
Signed-off-by: HiFiPhile <admin@hifiphile.com >
2025-04-19 11:43:28 +02:00
hathach
d51863d1a0
- correctly do_ping if received nyet as transfer complete e.g msc 31 byte command
...
- correctly carry out OUT transfer when PING is ack
2025-04-18 22:46:37 +07:00
HiFiPhile
b3d20442e2
Fix usbh racing later.
...
Signed-off-by: HiFiPhile <admin@hifiphile.com >
2025-04-18 14:57:53 +02:00
HiFiPhile
4c6736c277
Merge branch 'master' into dwc2-proper-attach-debouncing
...
Signed-off-by: HiFiPhile <admin@hifiphile.com >
2025-04-18 14:54:20 +02:00