-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Closed
Labels
Chip: ESP32-C3Issue is related to support of ESP32-C3 ChipIssue is related to support of ESP32-C3 ChipChip: ESP32-S3Issue is related to support of ESP32-S3 ChipIssue is related to support of ESP32-S3 ChipStatus: Needs investigationWe need to do some research before taking next steps on this issueWe need to do some research before taking next steps on this issueType: Bug 🐛All bugsAll bugs
Description
Board
ESP32-C3 / ESP32-S3
Device Description
Any ESP32-C3 or -S3 using HWCDC
Hardware Configuration
Any ESP32-C3 or -S3 board using HWCDC
Version
v2.0.9
IDE Name
PlatformIO
Operating System
Windows 11
Flash frequency
40MHz
PSRAM enabled
yes
Upload speed
115200
Description
HWCDC::end() does not reset the semaphore.
So after a call to end() and a new call to begin() the tx_lock semaphore is invalid.
Thus trying to write something to that port again will cause a crash.
arduino-esp32/cores/esp32/HWCDC.cpp
Lines 190 to 205 in 3ec5f4e
| void HWCDC::end() | |
| { | |
| //Disable tx/rx interrupt. | |
| usb_serial_jtag_ll_disable_intr_mask(USB_SERIAL_JTAG_LL_INTR_MASK); | |
| esp_intr_free(intr_handle); | |
| intr_handle = NULL; | |
| if(tx_lock != NULL) { | |
| vSemaphoreDelete(tx_lock); | |
| } | |
| setRxBufferSize(0); | |
| setTxBufferSize(0); | |
| if (arduino_hw_cdc_event_loop_handle) { | |
| esp_event_loop_delete(arduino_hw_cdc_event_loop_handle); | |
| arduino_hw_cdc_event_loop_handle = NULL; | |
| } | |
| } |
Sketch
-Debug Message
-
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
- I confirm I have checked existing issues, online documentation and Troubleshooting guide.
Metadata
Metadata
Assignees
Labels
Chip: ESP32-C3Issue is related to support of ESP32-C3 ChipIssue is related to support of ESP32-C3 ChipChip: ESP32-S3Issue is related to support of ESP32-S3 ChipIssue is related to support of ESP32-S3 ChipStatus: Needs investigationWe need to do some research before taking next steps on this issueWe need to do some research before taking next steps on this issueType: Bug 🐛All bugsAll bugs