Commit Graph

459 Commits

Author SHA1 Message Date
hathach
76c43a5bdc Merge branch 'master' into add-max3421-esp32 2023-09-27 17:52:18 +07:00
hathach
3b0ffd0f48 change hcd_int_handler(rhport, in_isr) signature: add in_isr
change tuh_int_handler() to take in_isr as optional parameter (default =
true)
2023-09-27 15:51:03 +07:00
hathach
2f6592de7f update max3421 to have hcd_int_handler_ext() 2023-09-27 11:30:18 +07:00
hathach
f6ca86c3dd tested cdc_msc_hid_freertos with samd51
add -Wno-error=format for espressif
wrap up cdc_msc_hid_freertos
2023-09-26 19:09:36 +07:00
hathach
a7c136c03f adding host/cdc_msc_hid_freertos example 2023-09-25 16:53:11 +07:00
hathach
21ab40bab2 - wrap up hcd max3421, work well with nrf52840
- also add usbh_defer_func()
2023-09-07 12:38:18 +07:00
hathach
1b9108ea0d minor debug clean up 2023-09-06 17:11:35 +07:00
hathach
3b7d5aa042 improve connection & disconnection detection. But there is still issue when CONDETIRQ occurs but we are disabled interrupt (for osal queue access). 2023-08-31 16:52:09 +07:00
hathach
502b1bdda6 more update to transaction 2023-08-27 23:45:34 +07:00
hathach
e3f3179924 able to get 8 byte descriptor, but read(RCVBC) always return 0
- rename max3421e to max3421
- fix incorrect bitmask for HCTL, fix initial device connect
- fix bus reset cause connect IRQ
2023-08-23 15:08:12 +07:00
hathach
274578ff46 able to send setup packet 2023-08-22 23:17:12 +07:00
hathach
9257a0f562 - update nrf52 bsp for cmake
- add empty tuh_int_handler/tud_int_handler if corresponidng stack not enabled
- add hcd_template.c
2023-08-18 12:48:12 +07:00
hathach
0109ffbdcb fix abort transfer does not release endpoint, also reset state if it is control transfer 2023-08-16 14:31:14 +07:00
hathach
67a374d932 more rename 2023-08-15 22:57:05 +07:00
hathach
1b33a31536 more minor clean up
- also rename usbh_classdriver.h to usbh_pvt.h to consitent with usbd
2023-08-15 22:54:07 +07:00
rppicomidi
9d94296741 fix issue 2188: support usbh_app_driver_get_cb() 2023-08-14 15:38:48 -07:00
hathach
1f95a417f2 Add tuh_rhport_is_active() and tuh_rhport_reset_bus()
- also improve ehci bus reset
- seperate bus reset delay and contact debouncing delay in enumeration
2023-08-07 20:48:07 +07:00
hathach
979bf32266 default class driver log level to CFG_TUH/TUD_LOG_LEVEL allow application to selectively disable usbd/usbh or driver log 2023-08-02 15:34:18 +07:00
Ha Thach
ce54984556 Merge pull request #2093 from abakosh/no_osal_delay
osal_none: make it possible to override the task delay function
2023-07-31 17:12:28 +07:00
Ha Thach
db59494b1b Merge pull request #2179 from hathach/enhance-ehci
Enhance EHCI
2023-07-27 16:15:43 +07:00
hathach
10575c1b38 mising ehci 2023-07-26 20:48:18 +07:00
hathach
c37a957174 correct hcd_edpt_clear_stall() API signature 2023-07-26 19:56:48 +07:00
hathach
dc74e634f9 fix unaligned hub status_change 2023-07-25 12:35:40 +07:00
Ha Thach
fda92fd34a Merge branch 'master' into hcd-abort-xfer 2023-07-24 21:38:46 +07:00
hathach
fd29fd923a clean up 2023-07-24 20:53:44 +07:00
hathach
d254256047 change dcache clean/invalidate return type to bool
add tu_assert() check for aligned 32byte address for imxrt
2023-07-24 17:54:24 +07:00
hathach
c122e9df73 implement hcd_edpt_abort_xfer() for EHCI, also move thing around a bit 2023-07-21 19:06:36 +07:00
hathach
1cc7c5d030 add hcd_edpt_abort_xfer() API 2023-07-21 12:43:48 +07:00
hathach
16ad918d96 prefer application callback over built-in driver 2023-07-20 17:37:06 +07:00
hathach
77495cf119 improve logging, allow easier to turn off usbd, driver logging
can be useful when focusing on let's say usbh
2023-07-20 17:12:00 +07:00
Aladdin Bakosh
3fdd2a40b2 osal_none: make it possible to override the task delay function 2023-07-18 14:14:23 +02:00
Aladdin Bakosh
1923b1845d fix(RA_hcd): STALL status can be also 3 not only 2 2023-07-17 11:54:09 +02:00
hathach
65d6acdbfa fix build warnings 2023-06-16 12:02:42 +07:00
hathach
9593ab7acc fix usbh issue when device genreate multiple attach/detach/attach when plugging in 2023-06-13 16:40:29 +07:00
hathach
9b7dee563e able to response with good crc 2023-06-07 18:57:48 +07:00
Dave Nadler
70a92291fe Fix diagnostic format string (missing %u) 2023-06-01 10:58:03 -04:00
hathach
20ef6c4ef7 slightly clean up 2023-05-29 13:29:11 +07:00
hathach
5c428d35a6 check status_change is not zero first 2023-05-29 13:27:20 +07:00
Ivo Popov
8ad024e51b Even when we get an empty "status change" interrupt from the hub, schedule another interrupt poll.
During enumeration, when there are multiple devices attached to the
hub as it's plugged into the Pi Pico, enumeration hangs, because we
get a "status change" callback with value zero. With this patch, we
retry several times on "zero" status change callbacks, until
eventually we succeed.

This is the cheapo hub that exhibits this behavior, but I assume it's
not the only one: https://www.amazon.com/gp/product/B083RQMC7S.

While debugging this, I consulted the implementation in the Linux
kernel. There, hub setup explicitly checks each port individually,
before starting to depend on "status change" interrupts:
https://elixir.bootlin.com/linux/latest/source/drivers/usb/core/hub.c#L1133.
We probably should do something like that here, but it's a much bigger
change.
2023-05-29 13:18:16 +07:00
hathach
5dae5e1292 ehci fix dcache clean when control endpoint failed 2023-05-19 13:32:49 +07:00
hathach
49e2aabc81 EHCI more improvement
- more dcache clean/invalidate
- extract init_periodic_list()
- improve isr list handling
2023-05-18 13:45:38 +07:00
hathach
a3e017bfd2 EHCI adding dcahe support, passing enumertaion 2023-05-18 10:04:48 +07:00
hathach
eb89df4115 adding hcd_dcache_clean/hcd_dcache_invalidate 2023-05-17 16:14:35 +07:00
hathach
2c48050993 add various check for disconncted device, also fix #1511 un-roll recursive hub removal with usbh queue 2023-05-16 11:09:22 +07:00
hathach
1c4f22a54c EHCI: fix xfer failed with disconnected device as stalled
- change CFG_TUH_ENDPOINT_MAX to 16 (max endpoint pair per device) if
not defined
- change QHD_MAX for EHCI, should be user configurable and more
optimized in the future
2023-05-16 11:09:22 +07:00
hathach
206d63e038 correct EHCI reporting failed xfer (instead of stalled) when device is unplugged 2023-05-16 11:09:21 +07:00
hathach
0a43a7b418 improve host serial drivers
- tuh_control_xfer() update xfer result to user_data if complete
callback = NULL (sync/blocking)
- refactor host serial driver for acm/ftdi/cp210x
2023-04-28 19:13:25 +07:00
hathach
45169d833d hacky, but ftdi work with hard code baudrate = 9600 2023-04-26 22:36:17 +07:00
hathach
71fb6469d4 separate CFG_TUSB_MEM_SECTION and CFG_TUSB_MEM_ALIGN to
- CFG_TUD_MEM_SECTION and CFG_TUD_MEM_ALIGN
- CFG_TUH_MEM_SECTION and CFG_TUH_MEM_ALIGN
- fix missing mem section and align for host
2023-03-24 14:05:21 +07:00
hathach
f8a5cde3c7 add tuh_task_event_ready(), better implement blocking control transfer for rtos 2023-03-22 09:23:44 +07:00