How to reset hub without power cycle? #2552
UKTailwind
started this conversation in
General
Replies: 2 comments
-
I'm looking for something like that too. Like re-init TinyUSB without unplugging my board. There is teardown function but it's commented out. |
Beta Was this translation helpful? Give feedback.
0 replies
-
For my use case |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've got multiple HID devices working nicely on a RP2040 through an un-powered hub. If I remove power from the RP2040 (and therefore the hub) and then power it up again all the devices re-connect as expected.
However, if I just reset the RP2040 then I don't see any calls to tuh_hid_mount_cb.
Presumably, the hub is holding some context and doesn't get reset by the normal call to tuh_init(BOARD_TUH_RHPORT);
I've tried forcing a USB bus reset with this code
void USB_bus_reset(void){ hw_set_bits(&usb_hw->phy_direct_override, USB_USBPHY_DIRECT_OVERRIDE_TX_DM_OE_OVERRIDE_EN_BITS | USB_USBPHY_DIRECT_OVERRIDE_TX_DM_OVERRIDE_EN_BITS | USB_USBPHY_DIRECT_OVERRIDE_TX_DP_OE_OVERRIDE_EN_BITS | USB_USBPHY_DIRECT_OVERRIDE_TX_DP_OVERRIDE_EN_BITS) ; hw_set_bits(&usb_hw->phy_direct, USB_USBPHY_DIRECT_TX_DM_OE_BITS | USB_USBPHY_DIRECT_TX_DP_OE_BITS); uint32_t save=usb_hw->phy_direct; hw_clear_bits(&usb_hw->phy_direct,USB_USBPHY_DIRECT_TX_DM_BITS |USB_USBPHY_DIRECT_TX_DP_BITS); uSec(10000); usb_hw->phy_direct=save; hw_clear_bits(&usb_hw->phy_direct_override, USB_USBPHY_DIRECT_OVERRIDE_TX_DM_OE_OVERRIDE_EN_BITS | USB_USBPHY_DIRECT_OVERRIDE_TX_DM_OVERRIDE_EN_BITS); }
but it makes no difference one way or the other. Is anyone aware of a way to force the hub to re-initialise?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions