File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -115,9 +115,6 @@ static void usb_device_task(void *param) {
115
115
void TinyUSB_Port_InitDevice (uint8_t rhport) {
116
116
(void )rhport;
117
117
118
- REG_CLR_BIT (RTC_CNTL_USB_CONF_REG, RTC_CNTL_IO_MUX_RESET_DISABLE);
119
- REG_CLR_BIT (RTC_CNTL_USB_CONF_REG, RTC_CNTL_USB_RESET_DISABLE);
120
-
121
118
// Reset USB module
122
119
periph_module_reset (PERIPH_USB_MODULE);
123
120
periph_module_enable (PERIPH_USB_MODULE);
@@ -126,6 +123,10 @@ void TinyUSB_Port_InitDevice(uint8_t rhport) {
126
123
usb_hal_init (&hal);
127
124
configure_pins (&hal);
128
125
126
+ // reset core, should be in dcd_esp32sx.c (do that later with more proper testing)
127
+ USB0.grstctl |= USB_CSFTRST;
128
+ while ((USB0.grstctl & USB_CSFTRST) == USB_CSFTRST) {}
129
+
129
130
tusb_init ();
130
131
131
132
// Create a task for tinyusb device stack
@@ -136,8 +137,9 @@ void TinyUSB_Port_InitDevice(uint8_t rhport) {
136
137
void TinyUSB_Port_EnterDFU (void ) {
137
138
// Reset to Bootloader
138
139
139
- periph_module_reset (PERIPH_USB_MODULE);
140
- periph_module_enable (PERIPH_USB_MODULE);
140
+ // Reset USB Core
141
+ USB0.grstctl |= USB_CSFTRST;
142
+ while ((USB0.grstctl & USB_CSFTRST) == USB_CSFTRST) {}
141
143
142
144
REG_WRITE (RTC_CNTL_OPTION1_REG, RTC_CNTL_FORCE_DOWNLOAD_BOOT);
143
145
esp_restart ();
You can’t perform that action at this time.
0 commit comments