-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
USB Serial JTAG Rx FiFo Interrupt Issue #9316
Comments
SuGlider
added
Type: Bug 🐛
All bugs
and removed
Status: Awaiting triage
Issue is waiting for triage
labels
Mar 1, 2024
@kiran-desilva - Thanks for the detailed issue report! Issue confirmed. The solution you have proposed is the right one. Please proceed with the PR. |
kiran-desilva
added a commit
to icl-rocketry/arduino-esp32
that referenced
this issue
Mar 2, 2024
Merged
kiran-desilva
added a commit
to icl-rocketry/arduino-esp32
that referenced
this issue
Mar 5, 2024
kiran-desilva
added a commit
to icl-rocketry/arduino-esp32
that referenced
this issue
Mar 5, 2024
…spressif#9316) (cherry picked from commit d70f57f)
me-no-dev
pushed a commit
that referenced
this issue
Mar 7, 2024
github-project-automation
bot
moved this from In Progress
to Done
in Arduino ESP32 Core Project Roadmap
Mar 7, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Board
ESP32-S3
Device Description
Any ESP32-S3
Hardware Configuration
Bare
Version
v2.0.6
IDE Name
PlatformIO
Operating System
Any
Flash frequency
40Mhz
PSRAM enabled
no
Upload speed
115200
Description
Hey, I think I have found a bug in the HWCDC library when using the USB Serial/Jtag interface. If any bytes are sent over serial before Serial.begin() gets called, the ESP will no longer respond over Serial, although the application will be running fine on the ESP. I believe this occurs due to how interrupts are handled specifically on the USB Serial/ JTAG hardware.
It appears that when data is sent to the ESP, the
USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT
interrupt flag will not be raised ifUSB_SERIAL_JTAG.ep1_conf.serial_out_ep_data_avail
is set. WhenHWCDC::begin(...)
is called, the interrupts are disabled, all the interrupt bits are cleared and then the three interrupts the isr handler is looking for are re-enabled. This results inUSB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT
being cleared, and never raised again until reset.The fix I currently have is removing the line where the interrupts are cleared (line 241 HWCDC.cpp on master) and am happy to submit a PR however I wanted to check if you guys see any direct issues with this fix.
I have attached a simple python program to recreate the bug in conjunction with the sketch attached below. The following build flags must also be passed inorder to enable USB Serial/JTAG.
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_MODE=1
Thanks!
serialbug.txt
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: