-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Simultaneous USB CDC and MSC #11245
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
Comments
I have this issue too, and have spent almost 2 weeks trying to fix it. The real kicker for me, is it worked sometimes, but I couldn't figure out why. I will spare everyone the absolute nightmare of a journey I went on, and present what I believe is the heart of the problem, and a workaround: WorkaroundIt seems that there are two instances of the function The workaround is to comment out or remove the arduino-esp32/cores/esp32/esp32-hal-tinyusb.c Lines 469 to 471 in 543fad2
This leaves the Root CauseAs to when and why this happened, I can't figure out. It does explain the behavior where it would work correctly for me seemingly out of the blue sometimes, because it is dependent on the order in which files are passed to the linker. As long as It seems like it was likely previously working no matter what, with older versions of the compiler toolchain. Using godbolt.org I was able to build a small setup that narrowed down when the behavior in GCC changed between the versions 10.3 and 10.4, though I couldn't replicate the behavior exactly. You can see that the little program there outputs I think it has something to do with how the header is declaring the symbol with the weak attribute and "C" linkage, but then the actual definitions are in separate translation units (one being C, the other C++) This mimics how But this is the thing that really bakes my noodle: If the linker selects the wrong The definitions of the Suggested "Fix"?All of the bizarre linkage issues aside, it seems the real bugbear is just the presence of the extra definitions of the callback functions, despite being marked I can't believe I've lost so much time on the linker picking the wrong function. 🙃 In conclusion, my head hurts and I would like a nap. |
Board
sensebox_mcu_esp32s2
Device Description
schematics in case thats relevant
Hardware Configuration
no
Version
latest stable Release (if not listed below)
IDE Name
Arduino IDE 2.3.6
Operating System
Ubuntu
Flash frequency
80Mhz
PSRAM enabled
yes
Upload speed
921600
Description
In version 2.0.17 of arduino-esp32 we used to be able to use both MSC and CDC. Since version 3.0.0 or newer we have issues with that.
If only either MSC or CDC are enabled they each work fine.
However, when both CDC and MSC are enabled:
Do we need to change anything in our boards.txt definition perhaps? Or could it be an issue with our TinyUF2?
Any insight appreciated. Thank you for this nice repo.
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: