ULP equivalent for rtc_gpio_init() ? [solved]

User avatar
joba-1
Posts: 9
Joined: Mon Jan 28, 2019 12:26 am

ULP equivalent for rtc_gpio_init() ? [solved]

Postby joba-1 » Mon Jan 28, 2019 1:06 am

Hi ESP32 ULP friends,

I wrote a simple ULP blink programm, and it basically works.

But my goal was to use the main core just for loading and starting the ULP code, nothing else.
Unfortunately the led at GPIO2 stays off if I don't do a rtc_gpio_init(2) in the main core first.
Is it not possible to do the equivalent from within the ULP copro?

Here is what I tried, maybe you see the error?

main.c: https://github.com/joba-1/Blink-ULP/blo ... main.c#L16
blink.S: https://github.com/joba-1/Blink-ULP/blo ... link.S#L18

Code: Select all

// This tries to mimic rtc_gpio_init(GPIO_NUM_2), but does not work yet :(
WRITE_RTC_REG(RTC_IO_TOUCH_PAD2_REG, RTC_IO_TOUCH_PAD2_MUX_SEL_M, 1, 1)
WRITE_RTC_REG(RTC_IO_TOUCH_PAD2_REG, RTC_IO_TOUCH_PAD2_FUN_SEL_M, 1, 0)
Regards, Joachim
Last edited by joba-1 on Tue Jan 29, 2019 11:42 pm, edited 1 time in total.

User avatar
joba-1
Posts: 9
Joined: Mon Jan 28, 2019 12:26 am

Re: ULP equivalent for rtc_gpio_init() ?

Postby joba-1 » Tue Jan 29, 2019 11:29 pm

This finally did the trick:

Code: Select all

WRITE_RTC_REG(RTC_IO_TOUCH_PAD2_REG, RTC_IO_TOUCH_PAD2_MUX_SEL_S, 1, 1)
Puzzle solved, on to the next level...

Who is online

Users browsing this forum: MSN [Bot] and 25 guests