-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Unable to disable default usb UART on ESP32S3 #15769
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
There has been a lot of related discussion to this recently with this change just merged today: #15727 (review) The USB support for S2 and S3 is also looking to get updated in #15108 though I'm still not sure if that will neccesarily allow completely disabling the USB port, that hasn't been explicitely tested or added to date. |
Thanks for the detailed report, @fduxiao . There isn't functionality to disable the USB pins on S2 or S3 yet, but as discussed in #14217 it should be technically possible to do so both at compile time (with an easier build config option) and at runtime by simply assigning the pins to other functions. Assigning at runtime should work for most people. I'm hoping to work on this soon and implement it, but none of the PRs currently open are quite enough to fix this. In the meantime I'm going to close this as a duplicate of #14217, please follow that issue for updates. |
I encountered the same situation as you, and now I want to compile a temporary firmware. What should I do? #undef CONFIG_USB_OTG_SUPPORTED |
@jd3096-mpy Please give some logs or description about the error. |
@jd3096-mpy Try #define MICROPY_HW_USB_CDC (0) |
Port, board and/or hardware
esp32s3, self-made board
MicroPython version
MicroPython v1.22.0-preview.975.g1897fe622.dirty on 2024-09-02; AntiGM (esp32s3 spiram octal) with ESP32S3
The board is self-made, which uses pin 19, 20 (USB D+/D-) to drive an ST7796 screen (i8080 parallel). I use an extra usb2serial bridge for downloading. See here.
Reproduction
To disable USB, I removed
boards/sdkconfig.usb
fromSDKCONFIG_DEFAULTS
and added the following.But this results in a failure of
make BOARD=myboard
.Expected behaviour
You should be able to compile a firmware for esp32s3 with USB disabled.
Observed behaviour
usb.c
complains that some symbols are missing, e.g., the following.Additional Information
I first tested this on lv_micropython and succeeded in making a usable firmware which can drive the screen. Since lv_micropython is a very old fork of micropython and is based on esp-idf v4.4, I decided to try micropython directly in case someday esp-idf v4 is no longer supported. Then came this issue, as is also encountered by others: #15290, #11315.
I noticed a change in
usb.c
. In this commit, you changedCONFIG_USB_ENABLED
toCONFIG_USB_OTG_SUPPORTED
. However, this is always set to yes as long as yourIDF_TARGET
is set to esp32s3. Try this simple CMakeLists.txt.Then
cat sdkconfig|grep USB_OTG
will show you:Thus, you are unable to change it by
sdkconfig.board
because it only defines the default values. This explains #15290.So my solution to this is to undef CONFIG_USB_OTG_SUPPORTED in
usb.h
I guess you have to go back to a configurable variant name.
Code of Conduct
Yes, I agree
The text was updated successfully, but these errors were encountered: