Page 1 of 1

[RESOLVED] RTC GPIO handling in STUB fonction

Posted: Sun Nov 20, 2022 4:01 pm
by QuentinTrying
Hello,

I want to manipulate (input, output) the RTC PINS of my ESP32C3 in the stub function. But I start to doubt the ability of the esp32c3 to do this....

Indeed, in a functional stub, I have tried the following approaches without success:
Classic functions
Example:

Code: Select all

gpio_set_level()
but the esp leaves the stub and restarts.

RTC pin function
Example:

Code: Select all

rtc_gpio_set_level()
but these cannot be used with esp32c3 as SOC_RTCIO_INPUT_OUTPUT_SUPPORTED is not defined for esp32c3 in the soc_caps.h file.

Register manipulation
Example :

Code: Select all

REG_WRITE(RTC_GPIO_ENABLE_W1TS_REG, BIT(RTC_GPIO_ENABLE_W1TS_S + GPIO_NUM_0))
But I can't find the necessary registers, especially because the file rtc_io_reg.h is only available for the esp32 S series. And the file rtc_cntl_reg.h contains only the registers to be wake up by pin rtc.

Can you confirm that the esp32c3 cannot manipulate the RTC pins but only hold them or get woken up?
Or can you tell me how to do it?


Thanks a lot !

Re: RTC GPIO handling in STUB fonction

Posted: Sat Dec 10, 2022 3:43 pm
by QuentinTrying
Finally I found the solution : Using the GPIO function of this file : "esp32c3/rom/gpio.h"

Re: [RESOLVED] RTC GPIO handling in STUB fonction

Posted: Thu Jan 19, 2023 7:20 pm
by setrin
Hello,

I'm having the same issue with my ESP32 C3.
I'm using deep sleep and after which I cannot set INPUT_PULLUP. IT doesn't do anything.

Could you please elaborate on how did you solve the issue?
I'm using Arduino IDE.

Thx in advance

Re: [RESOLVED] RTC GPIO handling in STUB fonction

Posted: Sat Jan 21, 2023 3:10 pm
by setrin
Nevermind, I found the solution.
It was to use

Code: Select all

gpio_pad_unhold
before initializing INPUT_PULLUP pin.
But thanks for giving me hope that it's solvable and to push through.