summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2025-01-20 22:47:32 +0700
committerhathach <[email protected]>2025-01-20 22:47:32 +0700
commit5b32df5abd5667bce7541bed62658750d7f68232 (patch)
treecfb2793b5c92849e61d337d397c9ebc8f7fff02f
parent2109b801d400cf8b019bc38ed12a18dd84f0f337 (diff)
add s3 undefined speed note for racing issue with reset.
fix dcd_event_sof() with frame number
-rw-r--r--hw/bsp/espressif/boards/family.c12
-rw-r--r--src/portable/nxp/khci/dcd_khci.c2
2 files changed, 4 insertions, 10 deletions
diff --git a/hw/bsp/espressif/boards/family.c b/hw/bsp/espressif/boards/family.c
index 26e415d94..2f9ecfe4d 100644
--- a/hw/bsp/espressif/boards/family.c
+++ b/hw/bsp/espressif/boards/family.c
@@ -175,20 +175,14 @@ bool usb_init(void) {
// maybe we can use USB_OTG_MODE_DEFAULT and switch using dwc2 driver
#if CFG_TUD_ENABLED
.otg_mode = USB_OTG_MODE_DEVICE,
- .otg_speed = BOARD_TUD_RHPORT ? USB_PHY_SPEED_HIGH : USB_PHY_SPEED_FULL,
#elif CFG_TUH_ENABLED
.otg_mode = USB_OTG_MODE_HOST,
- .otg_speed= BOARD_TUH_RHPORT ? USB_PHY_SPEED_HIGH : USB_PHY_SPEED_FULL,
#endif
+ // https://github.com/hathach/tinyusb/issues/2943#issuecomment-2601888322
+ // Set speed to undefined (auto-detect) to avoid timinng/racing issue with S3 with host such as macOS
+ .otg_speed = USB_PHY_SPEED_UNDEFINED,
};
- // OTG IOs config
- // const usb_phy_otg_io_conf_t otg_io_conf = USB_PHY_SELF_POWERED_DEVICE(config->vbus_monitor_io);
- // if (config->self_powered) {
- // phy_conf.otg_io_conf = &otg_io_conf;
- // }
- // ESP_RETURN_ON_ERROR(usb_new_phy(&phy_conf, &phy_hdl), TAG, "Install USB PHY failed");
-
usb_new_phy(&phy_conf, &phy_hdl);
return true;
diff --git a/src/portable/nxp/khci/dcd_khci.c b/src/portable/nxp/khci/dcd_khci.c
index 8398b09bf..3d5e195a9 100644
--- a/src/portable/nxp/khci/dcd_khci.c
+++ b/src/portable/nxp/khci/dcd_khci.c
@@ -565,7 +565,7 @@ void dcd_int_handler(uint8_t rhport)
if (is & USB_ISTAT_SOFTOK_MASK) {
KHCI->ISTAT = USB_ISTAT_SOFTOK_MASK;
- dcd_event_bus_signal(rhport, DCD_EVENT_SOF, true);
+ dcd_event_sof(rhport, tu_u16(KHCI->FRMNUMH, KHCI->FRMNUML), true);
}
if (is & USB_ISTAT_STALL_MASK) {