mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
fix(usb): reset ROM CDC descriptor on app startup
This commit is contained in:
committed by
Tomas Rezucha
parent
aed151a7d2
commit
6081ffba84
@@ -27,6 +27,7 @@
|
||||
#include "esp_rom_serial_output.h"
|
||||
#include "esp_rom_sys.h"
|
||||
#include "esp_rom_caps.h"
|
||||
#include "rom/usb/usb_common.h"
|
||||
#include "rom/usb/usb_dc.h"
|
||||
#include "rom/usb/cdc_acm.h"
|
||||
#include "rom/usb/usb_dfu.h"
|
||||
@@ -266,6 +267,11 @@ void esp_usb_console_before_restart(void)
|
||||
*/
|
||||
static void esp_usb_console_rom_cleanup(void)
|
||||
{
|
||||
#ifdef CONFIG_IDF_TARGET_ESP32S2
|
||||
/* Reset the descriptor pointer left by the second-stage bootloader before
|
||||
* its RAM image is reclaimed by the application heap. */
|
||||
rom_usb_cdc_set_descriptor_patch();
|
||||
#endif
|
||||
usb_dev_deinit();
|
||||
usb_dw_ctrl_deinit();
|
||||
uart_acm_dev = NULL;
|
||||
|
||||
Reference in New Issue
Block a user