-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
ESP32-S3 GPIO19/20 after disabling USB CDC #11315
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
My workaround for now is to use PWM and set the duty cycle to 100% or 0% depending on whether I need it on or off. A bit unfortunate to waste 2 PWM channels here but might be fine for now.
Curious about what causes machine_pin_on to not work though. |
A duty cycle of 65535 return not exactly a continuous high level, at least at the last time I measured it. There is still a short low pulse at the output, duration 1/(f * 65535), minimum 12 ns, If just the average level is important, that's not a problem. But if the attached device responds to transitions, you may see unexpected behavior. |
Thanks Robert, that's great to know. Do you have any guesses as to what might be causing this behavior with the pin.value() function not working as expected? I added check_esp_err in the method that calls gpio_set_level link
Firmware file: But that didn't raise any errors either:
|
Actually not. Did you check:
|
Yes I checked with a multimeter to make sure the pins were indeed off. The voltage was ~0.3V for pin 19 and ~3.0V for pin 20. In input mode it reads the value correctly. 0 first and then 1 after I manually connect it to 3.3V
|
Wow I've found an even weirder workaround. If I declare the pin, initialize a PWM object using it, then reinitialize as a regular pin, it seems to work just fine.
This also works if I deinit the PWM channel.
|
FYI, I see similar issue where I cannot control GPIO19,GPIO20. However your workarounds do not seem to work for me. Did you ever find a solution? |
Did you modify modify
What board are you using? |
@JoeSc did you manage to solve that issue, having exactly the same problem right now :( |
Hi all, sorry I missed this issue until now. This is a limitation in the current firmware. There is a compile-time workaround described in #15769 that mostly works with the current MicroPython, but it should be easier to disable the USB pins both at runtime and at compile time. Issue #14217 has the most detail about this, so I'm going to close this issue in favour of that one. Please subscribe there to get updates on this. |
This solved my problem too! I had a similar issue with ESP32-C3, having disabled USB_SERIAL_JTAG PORT and compiled micropython 1.24. It let me use the pins 18,19 (reserved for USB) without errors, but nothing really happened. After initialising them as PWM I can confirm that I can use them as GPIO or UART, as my intended use was. I cannot thank you enough!! |
I've built for
BOARD=GENERIC_S3_SPIRAM
with the followingsdkconfig.usb
Firmware attached. This also has the fix from #11254 built-in.
firmware-no-usb-rmt-loop-ok.zip
However I can't actually set the values for pins 19 and 20 using micropython
I've confirmed no hardware issues using an arduino sketch and testing with a voltmeter, the pins are high/low when they are supposed to be.
The text was updated successfully, but these errors were encountered: