Skip to content

Commit

Permalink
fix: Update USB reset sequence
Browse files Browse the repository at this point in the history
This commit fixes the USB reset sequence for the ESP32 USB CDC ACM port.
loader_port_reset_target() function kept the target in reset state so it
was not be possible to use it standalone. This commit also makes the
entering the bootloader to go through state where BOOT and RESET are
both set.
  • Loading branch information
Dzarda7 committed Dec 13, 2024
1 parent 58480f9 commit f64cf7c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion port/esp32_usb_cdc_acm_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ static void usb_serial_jtag_reset_target(void)
xStreamBufferReset(s_rx_stream_buffer);
cdc_acm_host_set_control_line_state(s_acm_device, false, true);
loader_port_delay_ms(SERIAL_FLASHER_RESET_HOLD_TIME_MS);
cdc_acm_host_set_control_line_state(s_acm_device, false, false);
}

static void usb_serial_jtag_enter_booloader(void)
Expand All @@ -96,10 +97,10 @@ static void usb_serial_jtag_enter_booloader(void)

loader_port_delay_ms(SERIAL_FLASHER_BOOT_HOLD_TIME_MS);

cdc_acm_host_set_control_line_state(s_acm_device, true, true);
usb_serial_jtag_reset_target();
}


static void usb_serial_converter_reset_target(void)
{
xStreamBufferReset(s_rx_stream_buffer);
Expand Down

0 comments on commit f64cf7c

Please sign in to comment.