ESP32-C3-Zero compilation error

Home Forums esp32 ESP32-C3-Zero compilation error

Viewing 4 reply threads
  • Author
    Posts
    • #31806
      Elkez
      Participant
        #include "esp_sleep.h"
        
        void setup() {
        //Set GPIO 0 for wakeup HIGH (1)
        esp_sleep_enable_ext0_wakeup(GPIO_NUM_0, 1);
        
        // Go to sleep
        esp_deep_sleep_start();
        }
        
        void loop() {
        // Code here no
        }
        

        ESP32-C3-Zero – an error appears and the program cannot be compiled.

        E:\ESP32_pgm\wakeUp_ESP32-C3-Zero\wakeUp_ESP32-C3-Zero.ino: In function 'void setup()':
        E:\ESP32_pgm\wakeUp_ESP32-C3-Zero\wakeUp_ESP32-C3-Zero.ino:5:3: error: 'esp_sleep_enable_ext0_wakeup' was not declared in this scope; did you mean 'esp_sleep_enable_bt_wakeup'?
        5 | void setup() {
        | ^~~~~~~~~~~~
        | esp_sleep_enable_bt_wakeup
        
        exit status 1
        
        Compilation error: 'esp_sleep_enable_ext0_wakeup' was not declared in this scope; did you mean 'esp_sleep_enable_bt_wakeup'?

        When I change the board to “ESP32-WROOM-DA Module”, the compilation goes without error.

        Where can the error be?

      • #31824
        Renzo Mischianti
        Keymaster

          Hi Elkez,
          you must import esp_sleep.h lib.

          
          #include <esp_sleep.h>
          

          Bye Renzo

        • #31831
          Elkez
          Participant

            That didn’t help, Zero doesn’t support this command.
            It is necessary to use the command:
            esp_deep_sleep_enable_gpio_wakeup(1 << INTERRUPT_PIN, ESP_GPIO_WAKEUP_GPIO_HIGH);

          • #32015
            JamieSue
            Participant

              Encountering compilation errors with the ESP32-C3 Zero can be challenging. Ensure your development environment is up-to-date, including the latest board definitions and libraries. If issues persist, consider exploring alternative microcontrollers like the STM32L152RBT6, an ultra-low-power ARM Cortex-M3 MCU with 128 KB Flash memory and advanced peripherals, suitable for various applications. This might better align with your project’s requirements and provide a more stable development experience.

            • #32058
              LillianSkye
              Participant

                Thank you so much for the info.

                • This reply was modified 9 months, 1 week ago by LillianSkye.
                • This reply was modified 9 months, 1 week ago by LillianSkye.
            Viewing 4 reply threads
            • You must be logged in to reply to this topic.
            Exit mobile version