Buzzer makes sound during GPIO config if it was used in a wake up stub

snutw_
Posts: 16
Joined: Wed Aug 21, 2024 1:48 pm

Buzzer makes sound during GPIO config if it was used in a wake up stub

Postby snutw_ » Tue Oct 01, 2024 4:20 pm

Does someone know why when I turn on a buzzer in a wake up stub, then in the main program when I only enable output on this GPIO, it already makes one sound again?
I tried to disable GPIO at the end of wake stub or keeping the GPIO initialited so I would not need to do it again, but it did not work.
I tried to delay the buzzer's GPIO initialization until the actual moment when I wanted the sound to happen, so that side effect would not be noticable, but even enabling pull down resistor on that GPIO at the start up triggers the buzzer (I have done that pull down so that the PIN would not float generating buzzing).

If I do the GPIO configuration without wake up stub it generates no sound.

void RTC_IRAM_ATTR wake_stub_buzzer(void)
{
esp_default_wake_deep_sleep();
REG_SET_BIT(GPIO_ENABLE1_W1TS_REG, BIT_N);
REG_SET_BIT(GPIO_OUT1_W1TS_REG, BIT_N);
uint64_t time = rtc_cntl_ll_get_rtc_time();
while(time + 50000 > rtc_cntl_ll_get_rtc_time());
REG_SET_BIT(GPIO_OUT1_W1TC_REG, BIT_N);
}

ESP32S3, IDF 5.2.2

snutw_
Posts: 16
Joined: Wed Aug 21, 2024 1:48 pm

Re: Buzzer makes sound during GPIO config if it was used in a wake up stub

Postby snutw_ » Tue Oct 01, 2024 4:33 pm

Does the ESP have to make some GPIO reset on start up? Can it be disabled?

Who is online

Users browsing this forum: Mitchel and 58 guests