Cannot write to IOMUX conf register from ULP-FSM on ESP32-S2/S3 (IDFGH-10966) #12158
Closed
3 tasks done
Labels
Resolution: NA
Issue resolution is unavailable
Status: Done
Issue is done internally
Type: Bug
bugs in IDF
Answers checklist.
IDF version.
v5.0.3
Operating System used.
Linux
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
Development Kit.
Waveshare ESP32-S2 dev board and LILYGO T-Display-S3
Power Supply used.
USB
What is the expected behavior?
The following, when run from the ULP-FSM, should set the
SENS_IOMUX_CLK_GATE_EN
bit in theSENS_SAR_IO_MUX_CONF_REG
register.The above is for the ESP32-S2. On the ESP32-S3 the register is called
SENS_SAR_PERI_CLK_GATE_CONF_REG
and the fieldSENS_IOMUX_CLK_EN
so the assembly code for the ULP is:(Btw, the ESP-IDF has the exact code in an example (here), but that line has no effect. The example still works correctly, because the IOMUX clock gate was already enabled by
rtc_gpio_init
calls made from the main CPU before the ULP program was started)What is the actual behavior?
In both cases (S2 and S3) the register remains unchanged when written to from ULP code (confirmed by reading the register from the main CPU).
(Note, writing to the register from code running on the main CPU works correctly)
Steps to reproduce.
WRITE_RTC_FIELD(SENS_SAR_IO_MUX_CONF_REG, SENS_IOMUX_CLK_GATE_EN, 1)
(or equivalent for the S3).SENS_SAR_IO_MUX_CONF_REG
register.rtc_gpio_init
before doing this, to keep the IOMUX clock gate disabled as per default.SENS_SAR_IO_MUX_CONF_REG
register again.For comparison, try writing to the register from the main CPU:
SENS_SAR_IO_MUX_CONF_REG
register.WRITE_RTC_FIELD(SENS_SAR_IO_MUX_CONF_REG, SENS_IOMUX_CLK_GATE_EN, 1)
from the main app's code. (or alternatively useSENS.sar_io_mux_conf.iomux_clk_gate_en = 1;
which does the same thing)Debug Logs.
No response
More Information.
Writing to this register is needed to allow reading GPIO inputs from ULP code.
Normally with the IDF, one would
rtc_gpio_init
the necessary GPIO pins, which enabled the IOMUX clock gate correctly. However, I am using MicroPython, which does not expose thertc_gpio_init
function.This has so far not been a problem with the original ESP32, because all of what
rtc_gpio_init
does can be achieved by ULP code to set the right flags in the right registers (e.g. to put pin into RTC mode, to set pin direction, to set pullups/-downs, etc).However, on the S2 and S3 the IOMUX clock gate must also be enabled for GPIO input (output works fine without it). All other register writes (like setting pin direction, pull downs, etc) still work fine (confirmed by inspecting the registers and by the effect of the changes), it's only setting the IOMUX conf register that does not work.
Is this by design perhaps? Or is it a bug?
The text was updated successfully, but these errors were encountered: