Commit Graph

2702 Commits

Author SHA1 Message Date
gaoyichuan 3846d5f38c hid: add configurable report size for fido 2022-10-15 19:22:21 +08:00
gaoyichuan 2a520fb921 hid: add fido hid descriptor templates 2022-10-15 19:07:07 +08:00
Ha Thach 154821acc0
Merge pull request #1646 from battlesnake/feedback-prototype-fix
audio_device: prototype added for function referenced before use
2022-10-14 16:28:26 +07:00
tswan-quasi 2c1ff2673b (void) rhport for unused parameter 2022-10-13 11:48:30 -04:00
LynnL4 4238467b2d Add support for STM32U5 mcu 2022-10-13 17:39:42 +08:00
tswan-quasi 930c68278c double cast of pointer to remove error 2022-10-12 11:16:35 -04:00
kkitayam 53dc9d55b5 Fix pointer type to calculate streaming parameter 2022-10-12 20:41:03 +09:00
tswan-quasi 16f1554a03 lpc55s69 isochronous, dummy address for endpoint buffers to prevent accidental writes 2022-10-11 09:59:28 -04:00
Ha Thach a95fb36f72
Merge pull request #1623 from SudoMaker/master
Initial PIC32MM/MX & PIC24 support
2022-10-10 20:18:01 +07:00
kkitayam 4be7ffd63f Fix max payload size to clip at 1023 2022-10-07 21:30:03 +09:00
ReimuNotMoe 8096afc6de Microchip PIC24/dsPIC33 device mode support 2022-10-06 03:45:51 +08:00
mingpepe 988eeb50c6
Fix typo for log in dcd_rp2040.c 2022-10-05 21:26:22 +08:00
kkitayam ee832e4e37 Fix descriptor searching 2022-10-03 21:41:58 +09:00
Mark K Cowan 6c3c2df823 audio_device: prototype added for function referenced before use 2022-09-17 21:27:04 +03:00
kkitayam 1debf62707 Fix compile errors 2022-09-13 21:22:02 +09:00
kkitayam e80714740c Change images to MJPEG 2022-09-13 21:22:02 +09:00
Ha Thach 111515a29c
Merge pull request #1629 from jmark1m/master
Fix bug #1628 by preventing shared irq slots for filling up
2022-09-13 15:08:12 +07:00
Jerzy Kasenberg 3133cacc6a nrf5x: Fix reception of large ISO packets
ISO packet size is up to 1023 for full speed device.
Upon completion of ISO reception, reported length of incoming packet
was truncated to one byte only.
This results in incorrect data stream for higher bit rates
48 samples * 4 bytes per sample * 2 channels = 384 bytes of data
and 128 was reported.

There is no change in logic extending xact_len to uint16_t fixes the issue.
2022-09-13 08:11:56 +02:00
hathach 7a48b1f0d1 re-added code in pr 1438 to fix compile with h7 with 1 usb otg 2022-09-13 11:04:48 +07:00
jmark1m 0931b52b66 Fix bug #1628 by preventing shared irq slots for filling up 2022-09-07 15:10:44 -05:00
ReimuNotMoe c5992edc7d Initial PIC32MM/MX & PIC24 support 2022-09-03 05:19:50 +08:00
Jerzy Kasenberg 5e3cfe7b57 nrf5x: Fix endpoint internal state when closed
Field started (regardind transfer) was only cleaed when transfer
was finished.
For audio devices set interface is called many times.
When there is no audio (silence) set interface requests zero
lenght bandwithd that in turn calls dcd_edpt_close().

When endpoint is closed due to set interface request transfer
should not longer be started since it will block next start transfer
with assert.

This just sets 'started' to false when endpoint is closed.
2022-08-26 08:10:15 +02:00
Ha Thach f6c1ce5b1c
Merge pull request #1569 from hathach/release-0.14.0
increase version to 0.14.0 for release
2022-08-19 21:13:09 +07:00
Ha Thach 792b2fb956
Merge pull request #1603 from Ryzee119/hub_improv
Host hub clear port and device interrupts
2022-08-17 15:03:48 +07:00
Ryzee119 2b2354d302 Hub: Clear other port feature changes 2022-08-16 18:25:46 +09:30
Ryzee119 3c7b5dcaff Hub: Handle hub device status change interrupt 2022-08-16 18:25:43 +09:30
Ha Thach 585f37a797
Merge pull request #1489 from kasjer/kasjer/fix-nrf5x-dma-access
nrf5x: Fix DMA access
2022-08-15 21:30:39 +07:00
Ryzee119 aafea8ef5d Hub: Rename port status callback to be more generic 2022-08-15 17:43:04 +09:30
Ryzee119 5efef4393c Hub: Expand hub helpers to handle device events 2022-08-15 17:42:56 +09:30
Jerzy Kasenberg c7469ce986 dfu: Allow DFU coexistence with other interfaces
dfu_moded_open() only works correct when its called on DFU interface
descriptor. It means that DFU is the only one interface in configuration
or driver is called after all others interface drivers were tried and
gave up.

If other interface is supported and but driver for DFU is called first
(this is the case for BTH and RNDIS).
Code after while loop (that was not entered) has an TU_ASSERT that will
make set_configuration to fail.

Now TU_VERIFY is called first to make sure open code is called for DFU
only and not other interface descriptors like in other drivers.
2022-08-09 10:42:30 +02:00
hathach a219ba86ea
fix issue with TUD_OPT_HIGH_SPEED 2022-08-01 14:52:29 +07:00
Ha Thach fd5bb6e5db
Merge pull request #1514 from maddyaby/audiod_typo
Fix typo in audiod_rx_done_cb in audio_device.c
2022-07-19 17:10:45 +07:00
hathach b0b155c949
increase version for release
along with minor doc update
2022-07-19 12:28:52 +07:00
Ha Thach ed2e587ace
Merge pull request #1568 from hathach/revert-hid-callback-len-temporarily
temporarily revert len back to uint8_t in tud_hid_report_complete_cb() 0.14.0 release
2022-07-19 12:16:32 +07:00
Ha Thach 2110e27678
Merge pull request #1531 from pigrew/usbtmc_highspeed
USBTMC: Fixes and support for high-speed USB
2022-07-18 22:20:43 +07:00
hathach b495d6f8ec
temporarily revert len back to uint8_t in tud_hid_report_complete_cb() for up coming release 2022-07-17 22:56:07 +07:00
hathach 7e4c0f64cd
abtract attribute fallthrough 2022-07-14 18:39:47 +07:00
graham sanderson 4bd47bcb99 disable bad gcc 6 warning 2022-07-12 13:29:47 -05:00
graham sanderson fc1a27b6c9 RP@040: rework CMake for compiler warnings 2022-07-12 12:58:30 -05:00
hathach 345558307d fix incorrect null-dereference warnings when compiling with gcc7 2022-07-12 00:50:52 +07:00
Ha Thach 0bfb9d62de
Merge pull request #1543 from robert-hh/1170_0.13.0
mimxrt: Change the definitions for MIMXRT boards.
2022-07-11 15:53:24 +07:00
hathach 19768936ae
bump up mcux-sdk for rt11xx, add back OPT_MCU_MIMXRT11XX 2022-07-11 14:01:18 +07:00
NConrad 54250d7dd5 USBTMC: explicit type conversions fix 2022-07-09 17:50:17 -04:00
robert-hh ec6f56768a mimxrt: Change OPT_MCU_MIMXRT1xXX to OPT_MCU_MIMXRT.
Which fits both MIMXRT10XX and MIMXRT11XX.
2022-07-01 09:04:36 +02:00
robert-hh 60c1750a9b mimxrt: Add/change definitions for MIMXRT11XX boards.
These are mostly identical to the MIMXRT10XX, with one tiny difference.
2022-06-30 22:21:31 +02:00
hathach 9ec92ff97b
rp2040 enable SOF as resumed signal when remote wakeup 2022-06-30 15:45:04 +07:00
Ha Thach 19956f070d
Merge pull request #1539 from hathach/improve-ci
Improve ci
2022-06-29 16:27:17 +07:00
hathach 8fe9022a6e fix buid_board.py script 2022-06-29 14:06:44 +07:00
graham sanderson b12863d27c Fix actual compiler warning on gcc 10.3.1 2022-06-29 07:28:35 +01:00
robert-hh bc4da2047b samd: Fix a lock-up situation at high traffic.
This PR fixes a transmit lock-up, which happens, when data is received
and sent at the sime time at moderate to high speeds, like code
which just echoes incoming data.

In my case, an issue was reported here:
https://github.com/micropython/micropython/issues/8521
2022-06-27 20:31:44 +02:00
hathach 25580b4fe9 use forloop to avoid -Warray-bounds with host setup packet 2022-06-27 21:05:41 +07:00
hathach 9c56f70111 suppress error with net example 2022-06-27 20:30:47 +07:00
hathach a0ef489890 fix all warnings with host rp2040 2022-06-27 17:11:24 +07:00
hathach 6522a8150e fix all device examples warnings 2022-06-27 13:48:47 +07:00
hathach 1a1f633922 Merge branch 'master' into add-more-warnings 2022-06-27 12:50:50 +07:00
hathach 556b5d5044 change report len in hid API from uint8_t to uint16_t
since HS interrupt endpoint can be up to 1024, 8-bit is not enough.
affected APIs are:
- tud_hid_n_report() / tud_hid_report()
- tud_hid_report_complete_cb()
2022-06-27 12:22:36 +07:00
hathach 0b3503cb33 clean up usbd log level 2022-06-27 11:56:48 +07:00
hathach b9dc9dbd78
fix most warnings with rp2040 -wconversion 2022-06-27 11:50:17 +07:00
NConrad c675debfb2 USBTMC: Handle busy interrupt in. 2022-06-26 14:34:34 -04:00
NConrad 239b5d5279 USBTMC: Manually stall and unstall EP when clear(ENDPOINT_HALT) is received. 2022-06-24 23:06:32 -04:00
hathach 0042eccb3b
fix redundant-decls warnings by usbd/usbh 2022-06-24 22:52:11 +07:00
hathach 4f6e770eda
add more warning option, also fix -Wconversion with rp2040
-Wuninitialized, -Wunused,  -Wredundant-decls
2022-06-24 19:46:19 +07:00
NConrad e9c29e6a2d Update USBTMC driver to support dynamic packet sizes (based on descriptor). 2022-06-21 21:27:52 -04:00
Ha Thach 070382d599
Merge pull request #1509 from liamfraser/rp2040_hcd_improvements
RP2040 HCD Improvements (Hub + Keyboard + Mouse working)
2022-06-21 15:55:02 +07:00
Ha Thach ae8b8f0c93
Merge pull request #1515 from maddyaby/dcd_edpt_close
Stub out dcd_edpt_close for samd
2022-06-18 12:40:39 +07:00
Ha Thach b4e62d1cda
Merge pull request #1518 from mingpepe/master
Fix typo for log format
2022-06-18 12:39:16 +07:00
maddyaby 2cc2a90215 Allow more endpoint packet sizes for SAMD
Tested on SAMD51 - we can allow more packet sizes by checking that the set size value is greater than the requested packet size instead of exactly the same.
2022-06-17 16:07:32 -07:00
graham sanderson c45118dacf rp2040: use shared IRQ handlers, so user can also hook the USB IRQ 2022-06-17 09:13:40 -05:00
mingpepe 1001d2da40
Fix typo for log format 2022-06-17 16:50:24 +08:00
hathach 905a0b2457 correct bulk size for highspeed endpoint in dynamic_configuration and usbtmc exmaples 2022-06-17 14:37:35 +07:00
maddyaby 05fc2fa7a6 Stub out dcd_edpt_close for samd
Not having this prevents the device from finishing the mounting process.

Tested on a SAMD51 and didn't seem to need to actually do anything in the close function.
2022-06-16 16:57:20 -07:00
Maddy e9089b993f Fix typo in audiod_rx_done_cb in audio_device.c 2022-06-16 16:22:55 -07:00
graham sanderson c5ba4af25b rp2040: make moving 1K of code into RAM optional - and off by default 2022-06-16 11:04:48 -05:00
Ha Thach d7b579a978
Merge pull request #1480 from Ryzee119/multihub_rebase
Host: Add support for multi-level usb hubs
2022-06-16 16:33:48 +07:00
hathach f4a7b5b80c add note for recursive calls of process_device_unplugged() in case of hub 2022-06-16 14:37:57 +07:00
Liam Fraser 19d054f789 hcd_rp2040 improvements:
- Stall now has priority over other interrupt responses
 - Delete eunused hcd_edpt_busy
 - Assert !ep->active when trying to start a new xfer
 - Assert !ep->active when handling buff_status bits
 - Set ep->xferred_len to 8 once a setup packet is finished so the data
structure is accurate
2022-06-13 16:19:11 +01:00
hathach 040ef0640d more dynamic controller for host 2022-06-10 14:53:03 +07:00
hathach 8451d05c50 revert sof_isr driver rename since it cause issue with existing code
also removed commented tud_sof_isr_set() API
2022-06-10 01:45:48 +07:00
hathach dd035b0eb2 make all hcd/dcd function used in isr into ram with __no_inline_not_in_flash_func() for faster irq handling
result is 1KB of code moved from rom -> ram
2022-06-08 16:08:53 +07:00
hathach 8cbc34de11 add tuh_configure() for port/dynamic host behavior config 2022-06-08 01:17:01 +07:00
hathach 06392247eb add TU_ATTR_FAST_FUNC for audio sof isr call chain 2022-06-07 11:50:50 +07:00
Ha Thach a03a03d74e
Merge pull request #1495 from hathach/enhance-tusb-config
Better support multiple controllers configuration
2022-06-07 01:13:08 +07:00
hathach 7c8278303b update all host examples 2022-06-06 23:16:49 +07:00
Ha Thach afd9b1883d
Merge pull request #1481 from cr1901/msp430-misopt-fix
msp430x5xx: Add fix for possible bug in msp430-elf-gcc 9.3.0.
2022-06-06 15:37:45 +07:00
hathach 1b08672945 more ci fix 2022-06-06 13:25:48 +07:00
hathach 7187cd9a85 fix ci, remove use of CFG_TUSB_RHPORT0_MODE in bsp 2022-06-06 12:51:10 +07:00
hathach f626916a57 update all dwc2 ports to support new dynamic controller support 2022-06-04 23:52:12 +07:00
Ryzee119 7df7590f7f Hub: Remove multi-level hub bypass 2022-06-04 18:58:20 +09:30
hathach 31134f41a1 make dwc2 stm32 rhport support dynamic 2022-06-03 17:24:28 +07:00
hathach 2571211957 remove static port defined for device/host 2022-06-03 11:32:09 +07:00
Jerzy Kasenberg 8b37aa1579 nrf5x: Fix DMA access
There were two problems:
- dma_running flag could be checked in USB interrupt (not set yet) then higher priority
  interrupt could start transfer, check dma_running (not set yet) set it to true start
  DMA; then when USB interrupt continues it starts another DMA that is not allowed
- when DMA is started some registers can't be safely accessed, read can yield invalid
  values (SIZE.EPOUT, SIZE.EPISO)
  current implementation could start DMA for one OUT endpoint then check that another
  endpoint also has data and while DMA was not started right away, SIZE.EPOUT was copied
  already to MAXCNT register. Later on when DMA was started not all data was read from
  endpoint due to incorrect DMA size previously set.

To prevent both cases dma_running is changed in atomic way.
Only code that actually set this value to true starts DMA, code that tried and
had dma_running flag already set simply defers DMA start to USB task.
This eliminates also need to have mutex that was there to limit access to dma_running flag
to one task only.
transfer also now has started flag that is set only after dcd_edpt_xfer() sets up total_len
and actua_len. Previously USB interrupt was disabled when total_len and actual_len were
setup to prevent race condition when data arrived to ednpoint before transfer was setup
was finished.
2022-06-02 17:23:35 +02:00
hathach 8b9cf152a0 rhport argument in usbd_ API() is not used (always use the initialized port)
remove the usage of TUD_OPT_RHPORT in class driver
2022-06-02 16:51:17 +07:00
hathach 99c1585ed2 rename board specific macro for example
- BOARD_DEVICE/HOST_RHPORT_NUM to  BOARD_TUD/H_RHPORT
- BOARD_DEVICE/HOST_RHPORT_SPEED to  BOARD_TUD/H_MAX_SPEED
2022-06-01 23:53:40 +07:00
tfx2001 54d7790e8b
fix compile error 2022-06-01 21:37:26 +08:00
Ha Thach fd8afc7e3b
Merge pull request #1454 from Iktek/bugfix_1453
overwrite grstctl on edpt_disable
2022-06-01 14:36:36 +07:00
hathach 6e7cd220dc grstctl set fifo + flush in one assign 2022-06-01 13:18:24 +07:00
Ha Thach 9352f75220
Merge pull request #1438 from Nikitarc/master
Update dwc2_stm32.h
2022-06-01 12:23:32 +07:00
Ha Thach fdeac8508b
Merge pull request #1381 from hathach/add-sof-isr
Add SOF IRQ Handler
2022-05-31 22:25:14 +07:00
hathach e384d16d57 clean up tud_audio_set_itf_cb() invocation 2022-05-31 21:52:54 +07:00
hathach f2926670cc comment out fifo count method for now 2022-05-31 20:26:37 +07:00