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.
RTC IO interrupt while MCU is awake?
-
ahsrabrifat
- Posts: 201
- Joined: Sat Jan 18, 2025 2:31 pm
Re: RTC IO interrupt while MCU is awake?
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.
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.
Re: RTC IO interrupt while MCU is awake?
You can interrupt directly:
https://github.com/espressif/esp-idf/bl ... iscv.h#L59
https://github.com/espressif/esp-idf/bl ... iscv.h#L59
Who is online
Users browsing this forum: No registered users and 7 guests