espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.63k stars 7.28k forks source link

ESP32H2 deep_sleep and deep_sleep_wake_stub example fails to compile (IDFGH-11189) #12356

Closed abu-matterize closed 1 year ago

abu-matterize commented 1 year ago

Answers checklist.

General issue report

Hello there,

When tried to compile the deep_sleep and deep_sleep_wake_stub example target for ESP32H2, it fails at linking,

${PATH_TO_ESP}/.espressif-v5.1.1/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: esp-idf/esp_hw_support/libesp_hw_support.a(sleep_modes.c.obj): in function `esp_deep_sleep_start':
${PATH_TO_ESP}/esp/esp-idf-v5.1.1/components/esp_hw_support/sleep_modes.c:790: undefined reference to `esp_get_deep_sleep_wake_stub'
${PATH_TO_ESP}/.espressif-v5.1.1/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: {PATH_TO_ESP}/esp/esp-idf-v5.1.1/components/esp_hw_support/sleep_modes.c:877: undefined reference to `esp_wake_deep_sleep'
${PATH_TO_ESP}/.espressif-v5.1.1/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: {PATH_TO_ESP}/esp/esp-idf-v5.1.1/components/esp_hw_support/sleep_modes.c:877: undefined reference to `esp_wake_deep_sleep'
${PATH_TO_ESP}/.espressif-v5.1.1/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: {PATH_TO_ESP}/esp/esp-idf-v5.1.1/components/esp_hw_support/sleep_modes.c:877: undefined reference to `esp_set_deep_sleep_wake_stub'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the {PATH_TO_ESP}/esp/esp-idf-v5.1.1/examples/system/deep_sleep/build/log/idf_py_stderr_output_133785 and {PATH_TO_ESP}/esp/esp-idf-v5.1.1/examples/system/deep_sleep/build/log/idf_py_stdout_output_133785

Tried light_sleep example and it works as described.

Note: For ESP32C6 target both deep_sleep and deep_sleep_wake_stub works as described as well.

KonstantinKondrashov commented 1 year ago

Hi @absoluteabutaj! I have tried to build the following examples for master (v5.2-dev-3220-gaa3b9df), they are built without any errors.

Please check your IDF version to which chip it supports https://github.com/espressif/esp-idf#esp-idf-release-and-soc-compatibility. Probably you need to update your IDF barch to get it.

abu-matterize commented 1 year ago

Hey @KonstantinKondrashov - Thanks for sharing.

Switching to the master branch did the trick. Would you mind sharing the diff for tag v5.1.1 and master branch if possible, specific to this issue?

KonstantinKondrashov commented 1 year ago

@absoluteabutaj For your branch tag v5.1.1, it is not supported, please check the page - https://github.com/espressif/esp-idf/tree/v5.1.1/examples/system/deep_sleep, there is no ESP32-H2 mark (see the picture below). However the release/v5.1 branch has it. You can try switching to this branch then.

image

abu-matterize commented 1 year ago

@KonstantinKondrashov - Thanks for clarifying this.