ESP32C3 wakeup from deepsleep and quickly capture data pulses on a GPIO
Posted: Thu Apr 30, 2026 11:49 am
Hi,
I'm designing an RFID decoder and it all works well in the standard run mode. As this is aimed to be a battery powered device, I'd like to get the MCU to wake up from deepsleep (when it detects the first pulse on the RFID GPIO1) and then in an interrupt routine take measurements as to the timing of the RFID pulses. The transmission lasts 120ms and is similar to how infrared receiver devices work.
Due to the bootloader taking 100ms or so to jump to the main firmware code, when the code gets to execute in the main firmware, all of the RFID transmission is already completed and the data completely missed.
To work around this, I'm thinking of modifying the bootloader to set an interrupt routine in the bootloader code, however I can't find much documentation on how to configure a GPIO an input and set up an interrupt routine in the bootloader code so that it gets called while the bootloader is running.
Are there any examples on how this can implemented in the esp-idf bootloader code for ESP32C3?
Thanks!
I'm designing an RFID decoder and it all works well in the standard run mode. As this is aimed to be a battery powered device, I'd like to get the MCU to wake up from deepsleep (when it detects the first pulse on the RFID GPIO1) and then in an interrupt routine take measurements as to the timing of the RFID pulses. The transmission lasts 120ms and is similar to how infrared receiver devices work.
Due to the bootloader taking 100ms or so to jump to the main firmware code, when the code gets to execute in the main firmware, all of the RFID transmission is already completed and the data completely missed.
To work around this, I'm thinking of modifying the bootloader to set an interrupt routine in the bootloader code, however I can't find much documentation on how to configure a GPIO an input and set up an interrupt routine in the bootloader code so that it gets called while the bootloader is running.
Are there any examples on how this can implemented in the esp-idf bootloader code for ESP32C3?
Thanks!