RTC IO interrupt while MCU is awake?

_mdma_
Posts: 4
Joined: Sat Aug 09, 2025 9:17 pm

RTC IO interrupt while MCU is awake?

Postby _mdma_ » Mon Sep 08, 2025 7:38 pm

Hello!

In my project, I'm using the ULP to perform sensor monitoring tasks every few seconds. Once the sensor buffer is full, it wakes up the high-power MCU using the IDF API ulp_riscv_wakeup_main_processor(). The MCU uses an early wake stub to process the data read by the ULP, via shared buffers in RTC SLOW RAM. This is working well.

As part of the product function and user-interaction, the MCU may spend a long time awake (say 20+ minutes) during which time the MCU wakeup from the ULP isn't applicable. So, I've used an RTC IO to signal from the ULP to the MCU that more data is available, with the intent that I could set up an interrupt in the MCU when awake, so that it's aware the sensor data needs reading from the buffer. I've not had any success getting the interrupt triggered.

So my question - is it possible to set up an interrupt while the MCU is awake triggered by an RTC IO going high?

My understanding is that RTC IO interrupts are only available for waking up the MCU from sleep, while regular GPIOs (via the driver) are used to trigger interrupts while the MCU is awake.

Is it possible for a given pin to be configured as an RTC IO for use by the ULP and also managed by the GPIO driver for MCU interrupts?

I have another unused pin available, which I could use in the solution. I have seen some details about being able to route the output of one pin to the input of another using the GPIO matrix, but the details are presently beyond my understanding.

Thank you for taking the time to read, and for any help.

Warm regards,
Mat.

ahsrabrifat
Posts: 201
Joined: Sat Jan 18, 2025 2:31 pm

Re: RTC IO interrupt while MCU is awake?

Postby ahsrabrifat » Tue Sep 09, 2025 5:31 pm

Pins in RTC IO (often GPIOs 0, 2, 4, 12-15, 25-27, 32-39 depending on the chip) can be accessed by the ULP, even while the main MCU is in deep sleep.

The RTC IO interrupt functionality is designed for waking the MCU from sleep, not for normal runtime interrupt handling while the MCU is awake. So you cannot reliably attach an RTC IO interrupt to the normal CPU while it’s awake — the IDF doesn’t expose such functionality.

boarchuz
Posts: 656
Joined: Tue Aug 21, 2018 5:28 am

Re: RTC IO interrupt while MCU is awake?

Postby boarchuz » Thu Sep 11, 2025 5:19 pm


Who is online

Users browsing this forum: No registered users and 7 guests