Commit Graph

2262 Commits

Author SHA1 Message Date
kkitayam a15c354329 Fix typo 2021-09-29 21:23:18 +09:00
kkitayam f7bbdea0b8 Refactor application API parameters 2021-09-29 21:23:17 +09:00
kkitayam 0d6496886c Change frame buffer management 2021-09-29 21:23:17 +09:00
kkitayam d88cc23ca5 Refactor packet handling 2021-09-29 21:23:17 +09:00
kkitayam cd3f6eac2f Fix streaming payload handling 2021-09-29 21:23:16 +09:00
kkitayam 3cb4bb391d Separate a handling resource into controller and streaming 2021-09-29 21:23:16 +09:00
kkitayam 2b4e02f192 Implement some mandatory requests on streaming interface 2021-09-29 21:23:16 +09:00
kkitayam 4995d9cbd2 Fix handling for set_interface 2021-09-29 21:23:15 +09:00
kkitayam 20572a6ed2 Fix regarding standard video stream request 2021-09-29 21:23:15 +09:00
kkitayam d026f17457 fix: configuration descriptor has incorrectly sizes
update some descriptors
2021-09-29 21:23:15 +09:00
kkitayam 019c1ab09e add tentative example 2021-09-29 21:23:14 +09:00
kkitayam 033d6b28ff moved ISO attributes from audio to common 2021-09-29 21:23:14 +09:00
kkitayam e8de411322 cleanup open() 2021-09-29 21:23:14 +09:00
kkitayam 97d5d1e491 add files for video class device 2021-09-29 21:23:14 +09:00
hathach 1d5bdf7d39
add same7x to board list 2021-09-29 16:29:15 +07:00
hathach 0b31c40b9f Merge branch 'master' into enhance 2021-09-29 16:18:17 +07:00
hathach 2f2fb3d8d9
clean up 2021-09-29 16:18:11 +07:00
hathach f3c1b2a60d
clean up 2021-09-29 15:31:03 +07:00
hathach 103309b88b
Merge branch 'master' of github.com:hathach/tinyusb into zhangslice-master
examples/device/hid_composite_freertos/src/FreeRTOSConfig/FreeRTOSConfig.h
2021-09-29 15:27:41 +07:00
szymonh db862ae725 Assure msc device block size is not zero 2021-09-27 21:11:44 +02:00
Peter Lawrence 03d7988df3 add NCM driver in a compatible manner : hathach/tinyusb#550 2021-09-25 17:05:58 -05:00
Ha Thach 958cf2cfba
Merge pull request #1102 from kasjer/kasjer/usbd-small-ep0-enumeration-workaround
usbd: Workaround for non standard device descriptor request
2021-09-25 18:37:24 +07:00
hathach 73872a5df0 add CFG_TUSB_OS_INC_PATH for os include path
useful for freertos/ prefix with esp IDF
2021-09-25 16:16:55 +07:00
Scott Shawcroft 0a6ca65e3f
MMU works 2021-09-24 16:14:01 -07:00
Ha Thach 1c17cb1c45
Merge pull request #1103 from kasjer/kasjer/da146xx-close-cleanup
dcd_da146xx: Remove registers pointer from xfer_ctl_t
2021-09-24 20:55:16 +07:00
Ha Thach cd865f896b
Merge pull request #1096 from kasjer/kasjer/da146xx-close-all
dcd_da146xx: Implement dcd_edpt_close_all()
2021-09-24 20:53:06 +07:00
Jerzy Kasenberg c62c1433e7 usbd: Workaround for non standard device descriptor request
Windows and Linux host during enumeration requests device
descriptor with request size set to 64 bytes when device
was in default state (no address).
Those systems do not want 64 bytes though since usb descriptors is
only 18 bytes long so they silently expect that only one packet
will be received possibly 18 bytes for EPS > 16 or 8 or 16 bytes
for smaller EP0.

For devices with CFG_TUD_ENDPOINT0_SIZE size 8 or 16 there was
workaround that reduced request size to CFG_TUD_ENDPOINT0_SIZE
and that was enough to satisfy Windows and Linux hosts.

However USBCV testing application also requests device descriptor
but with size set to 18 bytes. Workaround for Window/Linux
prevented USBVC to tests devices with 8 bytes EP0 size since it
send only 8 bytes while application did wanted 18 bytes.

Solution that satisfies both cases it to check if in default state device
descriptor request wants more bytes than descriptor size (18).
If so host is expecting to receive less bytes then requested
and workaround would be applied since Linux/Windows only try
to read one packet.
If 18 bytes was requested as is the case for USBCV, core returns
descriptor in 2 or 3 packets as application expects.
2021-09-24 14:19:04 +02:00
Jerzy Kasenberg fbac58e3e4 dcd_da146xx: Implement dcd_edpt_close_all()
Unconditionally disables all endpoints except EP0.
2021-09-24 10:46:16 +02:00
Jerzy Kasenberg 1503955860 dcd_da146xx: Clear transfer data on dcd_edpt_close
Closing endpoint clears data in affected xfer_ctl_t
2021-09-24 09:28:51 +02:00
Jerzy Kasenberg f172c5ee13 dcd_da146xx: Remove registers pointer from xfer_ctl_t
Note: this commit does not change any logic.

xfer_ctl_t structure keeps all dynamic data connected with transfer.
It used to have pointer to register set that was constant and was there
for convenience only.
Removing register pointer from structure makes cleanup easier as whole
structure can be erased with memset like function.

In many cases functions were using local variable regs and xfer->regs which
were same, that could be confusing so this part is unified.

Few macros were added for easy conversion between epnum, xfer, and regs.
2021-09-24 09:28:51 +02:00
Jerzy Kasenberg 428eedcd04 dcd_da146xx: Update bus handling
So far bus reset was handled (with some holes in it).
Sleep and remote wakeup were not really tested and did not work.

With this change:
- bus reset is reworked
- remote wakeup works
- bus signal sleep is handled
2021-09-23 14:12:50 +02:00
Jerzy Kasenberg c427712449 dcd_da146xx: Handle only enabled interrupts
Not much of an improvement but handle only interrupts
that were enabled and are expected.
2021-09-23 14:12:50 +02:00
Ha Thach 4766e7f348
Merge pull request #1093 from szymonh/master
Enforced buffer boundaries for hid devices
2021-09-23 13:31:46 +07:00
Ha Thach 3e569f8e79
Merge pull request #1094 from kasjer/kasjer/da146xx-vbus-handling
dcd_da146xx: Add VBUS handling
2021-09-18 23:12:40 +07:00
hathach ea595d3161 update dcd attr for mm32 2021-09-18 16:53:16 +07:00
hathach 3333703d25 Merge branch 'master' into zhangslice-master 2021-09-18 13:35:26 +07:00
Scott Shawcroft 2499c9382d
rpi start. doesn't work 2021-09-17 16:51:34 -07:00
Jerzy Kasenberg 6d8677a78a dcd_da146xx: Add VBUS handling
DA146xx are Bluetooth devices that may be battery
powered and when not connected to USB host there
is no need for USB peripheral to be running.

This change allows to enable USB peripheral when
VBUS is present otherwise USB is down reducing
power consumption.

tud_vsub_changed() function must be called
whenever VBUS change was detected.
For bus-powered devices this function should be called
at startup since VBUS must be present while device
is working.
2021-09-17 12:10:17 +02:00
hathach b363afc091 minor clean up 2021-09-17 00:46:29 +07:00
hathach c65cc75c6b use correct resume detection for kl25z 2021-09-17 00:44:39 +07:00
hathach 8dfe0898e7 minor update to dcd khci 2021-09-17 00:43:10 +07:00
kkitayam fbe1bf375c Fix stall interrupt handling 2021-09-15 21:39:02 +09:00
hathach 93ed3034c0 merge master and minor clean up 2021-09-15 18:35:52 +07:00
hathach f39656b6d7 Merge branch 'master' of github.com:hathach/tinyusb into kkitayam-impl_close_all_for_khci 2021-09-15 18:29:28 +07:00
Ha Thach 03866ddf9b
Merge pull request #1062 from HiFiPhile/fifo_dcd_transdimension
Improvements for dcd_transdimension
2021-09-15 16:07:06 +07:00
MasterPhi 0ded1c5bac Reset EP flags on close. 2021-09-14 21:08:12 +02:00
hathach a23944035d correct assoc_itf_count for bth driver 2021-09-15 00:51:01 +07:00
hathach b474522245 make vendor driver more flexible
- skip additional custom descriptor between interface and endpoints
- can have up to 2 bulk endpoint ( 1 in & 1 out)
2021-09-14 21:30:38 +07:00
hathach 25ea8f9c9e update configuration parser 2021-09-14 21:02:38 +07:00
MasterPhi 3639168066 Fix warning. 2021-09-14 11:58:22 +02:00
hathach 5404d6d8ae usbd pre-compute total interface length without replying on driver open 2021-09-14 12:47:20 +07:00
Ha Thach 6d3fb7eb98
Merge pull request #1087 from HiFiPhile/nuc_wkp
NUC126: fix remote_wakeup
2021-09-14 11:40:55 +07:00
szymonh 2d6407e7a5 Enforced buffer boundaries for hid devices 2021-09-13 22:56:25 +02:00
Ha Thach 1c3215257e
Merge pull request #1091 from hathach/esp32sx-compliance
Esp32sx compliance
2021-09-13 21:26:29 +07:00
hathach cdc63459eb esp32sx implement dcd_remote_wakeup(), fully compliance to chapter9 test suite 2021-09-13 16:49:38 +07:00
hathach e64bfb9ff5 implement dcd_edpt_close_all(), pass chapter9 test suite (without remote wakeup) 2021-09-13 16:16:37 +07:00
szymonh 50e3c0054f Add size check to tud_bt_hci_cmd_cb call in bth_device.c 2021-09-13 10:23:03 +02:00
hathach 43e6555fd0 clean up 2021-09-13 13:09:38 +07:00
hathach ce5db06ba0 clear PID along with clear stall 2021-09-13 12:05:49 +07:00
hathach 6feda5ae8f Merge branch 'nuc_wkp' of https://github.com/HiFiPhile/tinyusb into HiFiPhile-nuc_wkp 2021-09-13 11:52:16 +07:00
szymonh d5f2c34eaa Prevent buffer overflow in bth_device.c 2021-09-12 20:24:54 +02:00
hathach 9bed4e2e21 refactor nxp TDI dcd_edpt_xfer_fifo 2021-09-13 00:45:15 +07:00
hathach 038ec341f8 Merge branch 'fifo_dcd_transdimension' of https://github.com/HiFiPhile/tinyusb 2021-09-12 17:39:32 +07:00
hathach dd60ce784c nxp tdi: implement dcd edpt close all 2021-09-11 21:29:04 +07:00
hathach 1f7ade2b75 nxp tdi: fix error td prevent further transfer 2021-09-11 19:27:37 +07:00
MasterPhi 22571ec98e reset PID to DATA0 on clear_stall. 2021-09-10 16:04:47 +02:00
MasterPhi 8886de0d8a Fix remote_wakeup 2021-09-10 13:05:15 +02:00
MasterPhi 580893b3fe Shorter expr. 2021-09-10 11:17:33 +02:00
kkitayam 2998f67eac Fix dcd_edpt_clear_stall to reset data toggle 2021-09-10 00:18:43 +09:00
Mengsk 283783c082 dcd_edpt_xfer_fifo: use qtd_init if restriction not met. 2021-09-09 16:45:18 +02:00
hathach ad8c0ee818
nxp tdi: enhance qhd using DCD_ATTR_ENDPOINT_MAX 2021-09-09 20:26:03 +07:00
hathach f948cbe471
nxp tdi implement remote wakeup
enhance bus reset, unplugged, suspend, resume detection
2021-09-09 17:04:04 +07:00
hathach 27800f7e4f
remove connected check for DCD_EVENT_UNPLUGGED since previous bus reset can clear this
implement unplugged detection for trans dimension dcd
2021-09-09 16:01:05 +07:00
hathach f81368174b
add other speed descriptor callback tud_descriptor_other_speed_configuration_cb()
example implement tud_descriptor_device_qualifier_cb() and
tud_descriptor_other_speed_configuration_cb() on high speed device to
fully compliant to usbcv
2021-09-09 15:17:19 +07:00
kkitayam 780852efb3 Fix stall handling 2021-09-09 00:55:02 +09:00
kkitayam 22b5b47045 Implement dcd_edpt_close_all for NXP khci 2021-09-08 21:52:27 +09:00
Ha Thach d66d817c38
Merge pull request #1080 from hathach/rx-msc-compliance
Renesas RX reset PID to DATA0 when open endpoint
2021-09-08 18:31:42 +07:00
Ha Thach 5f141a4c13
Merge pull request #1077 from hathach/st-synopsy-compliance
St synopsy compliance
2021-09-08 18:00:44 +07:00
hathach d077574097 reset PID to DATA0 when open endpoint 2021-09-08 17:56:22 +07:00
Ha Thach c5e6e87d13
Merge pull request #1076 from kkitayam/impl_close_all_for_rx
Implement dcd_edpt_close_all() for Renesas RX family
2021-09-08 17:53:42 +07:00
hathach 67e80f60e3 fix build with gd32vf103 2021-09-08 13:35:11 +07:00
hathach 4ac136d81d implement remote wakeup for stm synopsys 2021-09-08 00:57:07 +07:00
hathach a54a974fa5 make synopsys usbcv compliance
- implement dcd_edpt_close_all()
- reset dtoggle when open endpoint
- correct dev interrupt mask on bus reset
2021-09-07 23:02:57 +07:00
kkitayam f3da48d46a Implement dcd_edpt_close_all() for Renesas RX family 2021-09-07 23:28:54 +09:00
hathach f47e5402fa add msc workaround for cxd56 2021-09-07 13:30:51 +07:00
hathach fa030075c2 Revert "Fix for MSC during stage STATUS"
This reverts commit 2e23f3dd72.
2021-09-06 19:26:28 +07:00
Kamil Tomaszewski 2e23f3dd72 Fix for MSC during stage STATUS 2021-09-03 18:13:45 +02:00
Ha Thach 831a45f14b
Merge pull request #1065 from hathach/rp2040-compliance
Rp2040 compliance test
2021-09-01 20:18:01 +07:00
hathach d4c56c70a8
minor clean up 2021-09-01 20:01:40 +07:00
hathach d6e9fe38be
rp2040 implement dcd_edpt_close_all()
aslo rename reset_ep0_pid() and clean up. We only need to reset pid when
setup packet received
2021-09-01 19:44:12 +07:00
hathach 1398226bb5
only attempt to clear if stalled, and stall if cleared 2021-09-01 16:54:03 +07:00
hathach 15fa2f447b
add back edpt check before cbw, since bot reset can occurred any time 2021-09-01 16:53:12 +07:00
hathach fc889ece74
rp2040 correct ep set/clear stall
- stall will remove pending (not complete) transfer. Correct reset data
toggle when clear stall.
- remove buf ctrl debug code
2021-09-01 16:52:27 +07:00
hathach 90dc9bc289
revert previous changes, edpt stall also clear any pending (not complete) transfer 2021-09-01 12:42:45 +07:00
hathach ab0c3e8dd0
fix rp2040 chapter 9 TD 9.6 test 2021-08-31 17:41:08 +07:00
hathach d047b28aa2
remove set/clear busy flag in set/clear stall since they are different status
note: dcd should resume to prio-stalled queued transfer when unstall
2021-08-31 17:39:54 +07:00
MasterPhi e3bf4c069b UAC2: Add ring buffer support for dcd_transdimension.
Add ring buffer ON/OFF switch.
2021-08-31 12:29:22 +02:00
MasterPhi 16b802d50c add dcd_edpt_close and iso xfer. 2021-08-31 12:02:19 +02:00
Ha Thach e2175f6ed1
Merge pull request #1061 from hathach/samd-compliance
Update SAMD to pass USBCV
2021-08-31 17:00:42 +07:00
MasterPhi 864d8381a7 dcd_transmission xfer_fifo support. 2021-08-31 11:59:51 +02:00
hathach 76345ea3a1
clear stall and reset data toggle when open edpt
required to pass one of msc test.
2021-08-31 16:41:45 +07:00
MasterPhi 8305766afe fix HID_LOGICAL_MAX overflow. 2021-08-31 11:27:43 +02:00
Ha Thach 38f5aee9c3
Merge pull request #1058 from hathach/usbcv-compliant-test
nrf5x USB Compliance Verification Test suite
2021-08-30 17:31:50 +07:00
hathach 6fadf530e0 increase version and update changelog 2021-08-30 12:44:38 +07:00
hathach fdf1ff545f responding with status per-spec in test case 4 2021-08-29 15:44:27 +07:00
hathach 4e3ed8159e passed all USBCV bot complaince test 2021-08-29 13:34:47 +07:00
hathach ee18cc42f2 msc handle more test, passed Command Self Test compliant 2021-08-29 12:06:10 +07:00
hathach ad21b69277 fix nrf clear data toggle sequence when clearing stall 2021-08-29 12:05:34 +07:00
hathach 66c292e2ec fix a couple of nrf dcd issue
- limit out xact dma to prevent usbd overflow in certain situation after
stalled
- drained already acked data when stalling an OUT endpoint
2021-08-29 00:34:21 +07:00
hathach be98cd56c7 update msc to be more robuse
add more log, pass more complaint test
2021-08-29 00:29:29 +07:00
hathach 53ea1e1324 fix msc test case 8 and 10 2021-08-27 23:52:59 +07:00
hathach c6b9f8a530 fix msc case 3 complaint test 2021-08-27 23:33:11 +07:00
hathach 8bad0af849 explicitly clear stall and data toggle for edpoint upon open() 2021-08-27 22:31:08 +07:00
hathach 81c73c235f implement dcd_edpt_close_all() for nrf52840 2021-08-27 22:30:30 +07:00
hathach e01239ccc9 more msc refactoring 2021-08-27 20:05:56 +07:00
hathach 2667ce6981 fix BOT case 2 test compliant 2021-08-27 17:50:02 +07:00
hathach 893dceb198 refactor msc device 2021-08-27 17:30:02 +07:00
hathach 032770682e minor clean up 2021-08-27 13:18:51 +07:00
hathach 9394de6ae7 update msc driver to pass MSC BOT error recovery compliant test 2021-08-27 12:38:41 +07:00
Xu Chun Guang 2202845507 fix: bth stridx error 2021-08-27 10:58:38 +08:00
hathach 629da937f8
slightly change the keyboard descriptor template to pass usb compliant test 2021-08-26 17:55:31 +07:00
hathach 71e77e47fa
add dcd_edpt_close_all() for clear existing configured state
correctly responded to TD 9.13 Set Configuration Test
2021-08-26 17:07:03 +07:00
hathach 07adc26ce3
fix usbcv TD 9.4 Interface Descriptor test 2021-08-26 13:07:10 +07:00
Ha Thach 8d97f0e81f
Merge pull request #1041 from HiFiPhile/vdc
Fix vendor fifo deadlock, add tud_vendor_n_read_flush
2021-08-25 23:22:15 +07:00
hathach 3debeb637a
test hid controller with rp2040 2021-08-24 21:34:51 +07:00
hathach 3c0c051df1
add tuh_vid_pid_get()
complete Sony PS4 dualshock controller example
2021-08-24 19:10:23 +07:00
hathach 88bb8fac3d
rename host API to be consistent with naming on device stack
- tuh_device_get_speed() to tuh_speed_get()
- tuh_device_configured() to tuh_mounted()
- tuh_device_ready() to tuh_ready()
2021-08-24 12:37:04 +07:00
Ha Thach 9c3fdb8135
Merge pull request #1043 from hathach/more-host-improvement
More host improvement
2021-08-24 12:28:41 +07:00
hathach 5d152503ee fix dev0 out of bound array due to leftover 2021-08-24 12:16:23 +07:00
Greg Steiert 86201f77be initial commit of support for K32L2B 2021-08-23 16:17:57 -07:00
hathach 8dc16dd3a7 fix rp2040 build 2021-08-24 01:19:06 +07:00
hathach 353c070d00 exclude dev0 from usbh devices pool 2021-08-24 01:06:05 +07:00
hathach 3309425211 sepearate CFG_TUH_DEVICE_MAX and CFG_TUH_HUB
separate dev0 from _usbh_devices pool to save sram
2021-08-23 19:56:53 +07:00
hathach 75cd593b60 add hcd_devtree_get_info()
remove usbh_hcd.h
2021-08-23 17:00:41 +07:00
hathach a490a3fe61 add hcd attr, add note for ehci framelist on NXP derivative 2021-08-23 15:40:57 +07:00
hathach 4ca176c291 refactor ehci init api 2021-08-23 12:37:54 +07:00
hathach 6a16f6ccdd rename CFG_TUSB_HOST_DEVICE_MAX to CFG_TUH_DEVICE_MAX 2021-08-23 11:01:40 +07:00
hathach 800f85329e add tuh_hid_receive_report() for applicaiton to explicitly request report 2021-08-23 11:00:21 +07:00
MasterPhi 4941cde175 Fix vendor fifo deadlock, add tud_vendor_n_read_flush 2021-08-22 13:26:50 +02:00
MasterPhi 69e539fda4 Fix CI. 2021-08-21 12:11:35 +02:00
MasterPhi e20755442a nuc126: fix set_address & disable sof 2021-08-21 12:04:02 +02:00
hathach beb1a5c678 minor clean up 2021-08-20 19:39:33 +07:00
hathach 22a5b1608c change host driver open return type to bool
the descriptor len used by driver will be calculated by usbh
2021-08-20 19:31:38 +07:00
hathach 97703587d9 improve host configuration parsing
- remove driver class code binding
- fully support IAD
- auto calculate total length for interface descriptor for driver
2021-08-20 19:08:38 +07:00
hathach 62f2efbe8c hid host skip get report descriptor if too large instead of assert 2021-08-20 18:26:56 +07:00
hathach 1cef2b6a42 extra common edpt helper for device and host stack
tu_edpt_validate() and tu_edpt_bind_driver()
2021-08-20 18:01:10 +07:00
kkitayam ff59e98a6a Add compile switch to enable SOF during suspend only 2021-08-19 23:57:34 +09:00
kkitayam 351581537f Removes redundant SOF processing from the Renesas RX family.
The same logic regarding the resume signal was implemented by usbd.

See also: #1023
2021-08-19 22:51:10 +09:00
Ha Thach c4a9a04d67
Merge pull request #1025 from hathach/add-hid-boot-example
add hid_boot_interface example
2021-08-19 11:24:10 +07:00
Ha Thach 3a248951e2
Merge pull request #1024 from HiFiPhile/nuc
Fix nuc126 buffer copy with IAR
2021-08-18 19:14:03 +07:00