|
1 | 1 | /* |
2 | | - * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD |
| 2 | + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD |
3 | 3 | * |
4 | 4 | * SPDX-License-Identifier: Apache-2.0 |
5 | 5 | */ |
@@ -383,10 +383,17 @@ static void _buffer_exec(pipe_t *pipe); |
383 | 383 | */ |
384 | 384 | static inline bool _buffer_check_done(pipe_t *pipe) |
385 | 385 | { |
| 386 | + // Only control transfers need to be continued |
386 | 387 | if (pipe->ep_char.type != USB_DWC_XFER_TYPE_CTRL) { |
387 | 388 | return true; |
388 | 389 | } |
389 | | - // Only control transfers need to be continued |
| 390 | +#if (CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3) |
| 391 | + // The HW can't handle two transactions with preamble in one frame. |
| 392 | + // TODO: IDF-15060 |
| 393 | + if (pipe->ep_char.ls_via_fs_hub) { |
| 394 | + esp_rom_delay_us(1000); |
| 395 | + } |
| 396 | +#endif // CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 |
390 | 397 | dma_buffer_block_t *buffer_inflight = pipe->buffers[pipe->multi_buffer_control.rd_idx]; |
391 | 398 | return (buffer_inflight->flags.ctrl.cur_stg == 2); |
392 | 399 | } |
@@ -1616,7 +1623,13 @@ static void pipe_set_ep_char(const hcd_pipe_config_t *pipe_config, usb_transfer_ |
1616 | 1623 | ep_char->mps = USB_EP_DESC_GET_MPS(pipe_config->ep_desc); |
1617 | 1624 | } |
1618 | 1625 | ep_char->dev_addr = pipe_config->dev_addr; |
1619 | | - ep_char->ls_via_fs_hub = (port_speed == USB_SPEED_FULL && pipe_config->dev_speed == USB_SPEED_LOW); |
| 1626 | + if (pipe_idx > 0) { |
| 1627 | + // TODO: remove warning after IDF-15060 |
| 1628 | + if (port_speed == USB_SPEED_FULL && pipe_config->dev_speed == USB_SPEED_LOW) { |
| 1629 | + ESP_LOGW(HCD_DWC_TAG, "Low-speed, extra delay will be applied in ISR"); |
| 1630 | + ep_char->ls_via_fs_hub = 1; |
| 1631 | + } |
| 1632 | + } |
1620 | 1633 | // Calculate the pipe's interval in terms of USB frames |
1621 | 1634 | // @see USB-OTG programming guide chapter 6.5 for more information |
1622 | 1635 | if (type == USB_TRANSFER_TYPE_INTR || type == USB_TRANSFER_TYPE_ISOCHRONOUS) { |
|
0 commit comments