@@ -134,18 +134,20 @@ static void hw_cdc_isr_handler(void *arg) {
134
134
connected = false ;
135
135
}
136
136
137
- if (usbjtag_intr_status & USB_SERIAL_JTAG_INTR_SOF) {
138
- usb_serial_jtag_ll_clr_intsts_mask (USB_SERIAL_JTAG_INTR_SOF);
139
- lastSOF_ms = millis ();
140
- }
137
+ // SOF ISR is causing esptool to be unable to upload firmware to the board
138
+ // if (usbjtag_intr_status & USB_SERIAL_JTAG_INTR_SOF) {
139
+ // usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_INTR_SOF);
140
+ // lastSOF_ms = millis();
141
+ // }
141
142
142
143
if (xTaskWoken == pdTRUE) {
143
144
portYIELD_FROM_ISR ();
144
145
}
145
146
}
146
147
147
148
inline bool HWCDC::isPlugged (void ) {
148
- return (lastSOF_ms + SOF_TIMEOUT) >= millis ();
149
+ // SOF ISR is causing esptool to be unable to upload firmware to the board
150
+ return true ;// (lastSOF_ms + SOF_TIMEOUT) >= millis();
149
151
}
150
152
151
153
bool HWCDC::isCDC_Connected () {
@@ -309,8 +311,9 @@ void HWCDC::begin(unsigned long baud) {
309
311
}
310
312
311
313
// the HW Serial pins needs to be first deinited in order to allow `if(Serial)` to work :-(
312
- deinit (NULL );
313
- delay (10 ); // USB Host has to enumerate it again
314
+ // But this is also causing terminal to hang, so they are disabled
315
+ // deinit(NULL);
316
+ // delay(10); // USB Host has to enumerate it again
314
317
315
318
// Peripheral Manager setting for USB D+ D- pins
316
319
uint8_t pin = USB_DM_GPIO_NUM;
@@ -332,9 +335,11 @@ void HWCDC::begin(unsigned long baud) {
332
335
// Enable USB pad function
333
336
USB_SERIAL_JTAG.conf0 .usb_pad_enable = 1 ;
334
337
usb_serial_jtag_ll_disable_intr_mask (USB_SERIAL_JTAG_LL_INTR_MASK);
335
- usb_serial_jtag_ll_ena_intr_mask (
336
- USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY | USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT | USB_SERIAL_JTAG_INTR_BUS_RESET | USB_SERIAL_JTAG_INTR_SOF
337
- );
338
+ usb_serial_jtag_ll_ena_intr_mask (USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY | USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT | USB_SERIAL_JTAG_INTR_BUS_RESET);
339
+ // SOF ISR is causing esptool to be unable to upload firmware to the board
340
+ // usb_serial_jtag_ll_ena_intr_mask(
341
+ // USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY | USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT | USB_SERIAL_JTAG_INTR_BUS_RESET | USB_SERIAL_JTAG_INTR_SOF
342
+ // );
338
343
if (!intr_handle && esp_intr_alloc (ETS_USB_SERIAL_JTAG_INTR_SOURCE, 0 , hw_cdc_isr_handler, NULL , &intr_handle) != ESP_OK) {
339
344
isr_log_e (" HW USB CDC failed to init interrupts" );
340
345
end ();
0 commit comments