espressif / esp-idf

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

undefined reference to `xTaskNotify (IDFGH-6025) #7711

Closed yusufk closed 2 years ago

yusufk commented 2 years ago

Environment

Problem Description

Build fails for https://github.com/espressif/esp-va-sdk/tree/master/examples/google_voice_assistant with an error:

[100%] Built target __idf_main
[100%] Generating ld/sections.ld
[100%] Built target __ldgen_output_sections.ld
[100%] Building C object CMakeFiles/gva.elf.dir/Users/yusuf/esp/esp-va-sdk/components/gva-proto/proto-c/annotations.pb-c.c.obj
[100%] Building C object CMakeFiles/gva.elf.dir/Users/yusuf/esp/esp-va-sdk/components/gva-proto/proto-c/http.pb-c.c.obj
[100%] Building C object CMakeFiles/gva.elf.dir/project_elf_src_esp32.c.obj
[100%] Building C object CMakeFiles/gva.elf.dir/Users/yusuf/esp/esp-va-sdk/components/gva-proto/proto-c/descriptor.pb-c.c.obj
[100%] Building C object CMakeFiles/gva.elf.dir/Users/yusuf/esp/esp-va-sdk/components/gva-proto/proto-c/embedded_assistant.pb-c.c.obj
[100%] Building C object CMakeFiles/gva.elf.dir/Users/yusuf/esp/esp-va-sdk/components/gva-proto/proto-c/latlng.pb-c.c.obj
[100%] Linking CXX executable gva.elf
/Users/yusuf/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /Users/yusuf/esp/esp-va-sdk/components/voice_assistant/lib/libgva.a(dialog.c.obj):(.literal.dialog_sm_thread+0x30): undefined reference to xTaskNotify
/Users/yusuf/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /Users/yusuf/esp/esp-va-sdk/components/voice_assistant/lib/libgva.a(dialog.c.obj):(.text.dialog_sm_thread+0xae): undefined reference to xTaskNotify
collect2: error: ld returned 1 exit status
make[3]: *** [gva.elf] Error 1
make[2]: *** [CMakeFiles/gva.elf.dir/all] Error 2
make[1]: *** [CMakeFiles/flash.dir/rule] Error 2
make: *** [flash] Error 2
make failed with exit code 2

Expected Behavior

Build succeeded

Actual Behavior

make failed with exit code 2`

Steps to reproduce

  1. Follow steps here: https://github.com/espressif/esp-adf/
  2. cd ~/esp/esp-va-sdk/examples/google_voice_assistant
  3. idf.py build

Debug Logs

$ idf.py build                                                                                                                 [19:17:40]
Executing action: all (aliases: build)
Running make in directory /Users/yusuf/esp/esp-va-sdk/examples/google_voice_assistant/build
Executing "make -j 10 all"...
[  0%] Built target custom_bundle
[  0%] Built target _project_elf_src
[  1%] Built target memory_ld
[  1%] Built target partition_table_bin
Consolidate compiler generated dependencies of target __idf_ulp
[  1%] Performing build step for 'bootloader'
[  1%] Built target __idf_ulp
Consolidate compiler generated dependencies of target __idf_esp_serial_slave_link
[  1%] Built target __idf_esp_serial_slave_link
[  1%] Built target _project_elf_src
[  5%] Built target __idf_log
Consolidate compiler generated dependencies of target __idf_sdmmc
[  1%] Built target __idf_sdmmc
[ 11%] Built target __idf_esp_rom
Consolidate compiler generated dependencies of target __idf_esp_https_ota
[ 13%] Built target __idf_esp_common
[  1%] Built target __idf_esp_https_ota
Consolidate compiler generated dependencies of target __idf_esp_http_server
[ 16%] Built target __idf_xtensa
[  2%] Built target __idf_esp_http_server
[ 27%] Built target __idf_esp_hw_support
Consolidate compiler generated dependencies of target __idf_esp_http_client
[  2%] Built target __idf_esp_http_client
[ 29%] Built target __idf_esp_system
Consolidate compiler generated dependencies of target __idf_tcp_transport
[ 38%] Built target __idf_efuse
[  2%] Built target __idf_tcp_transport
Consolidate compiler generated dependencies of target __idf_esp-tls
[ 62%] Built target __idf_bootloader_support
[  2%] Built target __idf_esp-tls
Consolidate compiler generated dependencies of target __idf_nghttp
[ 64%] Built target __idf_spi_flash
[  4%] Built target __idf_nghttp
[ 67%] Built target __idf_micro-ecc
Consolidate compiler generated dependencies of target __idf_app_trace
[  4%] Built target __idf_app_trace
[ 89%] Built target __idf_soc
Consolidate compiler generated dependencies of target __idf_cxx
[ 93%] Built target __idf_hal
[  5%] Built target __idf_cxx
Consolidate compiler generated dependencies of target __idf_newlib
[ 95%] Built target __idf_main
[  6%] Built target __idf_newlib
[ 98%] Built target bootloader.elf
Consolidate compiler generated dependencies of target __idf_freertos
[100%] Built target gen_project_binary
[  7%] Built target __idf_freertos
Consolidate compiler generated dependencies of target __idf_esp_timer
[  8%] Built target __idf_esp_timer
Bootloader binary size 0x6a20 bytes. 0x5e0 bytes (5%) free.
[100%] Built target bootloader_check_size
Consolidate compiler generated dependencies of target __idf_esp_common
[  9%] Built target __idf_esp_common
[100%] Built target app
Consolidate compiler generated dependencies of target __idf_xtensa
[  9%] No install step for 'bootloader'
[  9%] Built target __idf_xtensa
[  9%] Completed 'bootloader'
Consolidate compiler generated dependencies of target __idf_esp_hw_support
[ 10%] Built target bootloader
[ 12%] Built target __idf_esp_hw_support
Consolidate compiler generated dependencies of target __idf_soc
[ 14%] Built target __idf_soc
Consolidate compiler generated dependencies of target __idf_heap
[ 14%] Built target __idf_heap
Consolidate compiler generated dependencies of target __idf_log
[ 15%] Built target __idf_log
Consolidate compiler generated dependencies of target __idf_lwip
[ 21%] Built target __idf_lwip
Consolidate compiler generated dependencies of target __idf_esp_wifi
[ 22%] Built target __idf_esp_wifi
Consolidate compiler generated dependencies of target __idf_wpa_supplicant
[ 27%] Built target __idf_wpa_supplicant
Consolidate compiler generated dependencies of target __idf_esp_event
[ 28%] Built target __idf_esp_event
Consolidate compiler generated dependencies of target __idf_esp_netif
[ 29%] Built target __idf_esp_netif
Consolidate compiler generated dependencies of target __idf_tcpip_adapter
[ 29%] Built target __idf_tcpip_adapter
Consolidate compiler generated dependencies of target __idf_esp_eth
[ 29%] Built target __idf_esp_eth
Consolidate compiler generated dependencies of target __idf_vfs
[ 29%] Built target __idf_vfs
Consolidate compiler generated dependencies of target __idf_hal
[ 32%] Built target __idf_hal
Consolidate compiler generated dependencies of target __idf_esp_rom
[ 32%] Built target __idf_esp_rom
Consolidate compiler generated dependencies of target __idf_esp_system
[ 34%] Built target __idf_esp_system
Consolidate compiler generated dependencies of target __idf_esp_phy
[ 34%] Built target __idf_esp_phy
Consolidate compiler generated dependencies of target __idf_espcoredump
[ 34%] Built target __idf_espcoredump
Consolidate compiler generated dependencies of target __idf_esp_gdbstub
[ 34%] Built target __idf_esp_gdbstub
Consolidate compiler generated dependencies of target __idf_pthread
[ 34%] Built target __idf_pthread
Consolidate compiler generated dependencies of target __idf_nvs_flash
[ 35%] Built target __idf_nvs_flash
Consolidate compiler generated dependencies of target __idf_spi_flash
[ 36%] Built target __idf_spi_flash
Consolidate compiler generated dependencies of target __idf_bootloader_support
[ 37%] Built target __idf_bootloader_support
Consolidate compiler generated dependencies of target __idf_app_update
[ 37%] Built target __idf_app_update
Consolidate compiler generated dependencies of target mbedtls
[ 38%] Built target mbedtls
Consolidate compiler generated dependencies of target mbedx509
[ 38%] Built target mbedx509
Consolidate compiler generated dependencies of target mbedcrypto
[ 44%] Built target mbedcrypto
Consolidate compiler generated dependencies of target __idf_mbedtls
[ 44%] Built target __idf_mbedtls
Consolidate compiler generated dependencies of target __idf_esp_pm
[ 45%] Built target __idf_esp_pm
Consolidate compiler generated dependencies of target __idf_driver
[ 47%] Built target __idf_driver
Consolidate compiler generated dependencies of target __idf_esp_ipc
[ 47%] Built target __idf_esp_ipc
Consolidate compiler generated dependencies of target __idf_efuse
[ 48%] Built target __idf_efuse
Consolidate compiler generated dependencies of target __idf_esp_ringbuf
[ 48%] Built target __idf_esp_ringbuf
Consolidate compiler generated dependencies of target __idf_jsmn
Consolidate compiler generated dependencies of target __idf_esp_websocket_client
Consolidate compiler generated dependencies of target __idf_json
Consolidate compiler generated dependencies of target __idf_expat
Consolidate compiler generated dependencies of target __idf_wear_levelling
Consolidate compiler generated dependencies of target __idf_perfmon
Consolidate compiler generated dependencies of target __idf_mqtt
Consolidate compiler generated dependencies of target __idf_openssl
[ 48%] Built target __idf_jsmn
[ 48%] Built target __idf_json
[ 48%] Built target __idf_esp_websocket_client
[ 49%] Built target __idf_expat
[ 49%] Built target __idf_perfmon
[ 50%] Built target __idf_wear_levelling
Consolidate compiler generated dependencies of target __idf_freemodbus
[ 50%] Built target __idf_mqtt
[ 51%] Built target __idf_openssl
Consolidate compiler generated dependencies of target __idf_console
Consolidate compiler generated dependencies of target __idf_spiffs
Consolidate compiler generated dependencies of target __idf_protobuf-c
Consolidate compiler generated dependencies of target __idf_libsodium
Consolidate compiler generated dependencies of target __idf_httpc
Consolidate compiler generated dependencies of target __idf_esp_httpd_ota
Consolidate compiler generated dependencies of target __idf_json_parser
Consolidate compiler generated dependencies of target __idf_led_pattern
[ 51%] Built target __idf_protobuf-c
[ 53%] Built target __idf_console
[ 54%] Built target __idf_json_parser
[ 54%] Built target __idf_esp_httpd_ota
[ 54%] Built target __idf_spiffs
[ 54%] Built target __idf_led_pattern
[ 54%] Built target __idf_httpc
Consolidate compiler generated dependencies of target __idf_esp_adc_cal
Consolidate compiler generated dependencies of target __idf_multipart_parser
Consolidate compiler generated dependencies of target __idf_qrcode
Consolidate compiler generated dependencies of target __idf_sh2lib
Consolidate compiler generated dependencies of target __idf_asio
Consolidate compiler generated dependencies of target __idf_cbor
Consolidate compiler generated dependencies of target __idf_unity
[ 54%] Built target __idf_esp_adc_cal
[ 55%] Built target __idf_qrcode
[ 55%] Built target __idf_multipart_parser
[ 56%] Built target __idf_unity
[ 56%] Built target __idf_sh2lib
[ 58%] Built target __idf_cbor
[ 60%] Built target __idf_freemodbus
[ 60%] Built target __idf_asio
Consolidate compiler generated dependencies of target __idf_esp_lcd
Consolidate compiler generated dependencies of target __idf_fatfs
[ 67%] Built target __idf_libsodium
Consolidate compiler generated dependencies of target __idf_cmock
Consolidate compiler generated dependencies of target __idf_mdns
Consolidate compiler generated dependencies of target __idf_coap
[ 67%] Built target __idf_cmock
[ 67%] Built target __idf_mdns
[ 68%] Built target __idf_esp_lcd
[ 69%] Built target __idf_fatfs
Consolidate compiler generated dependencies of target __idf_audio_hal
[ 70%] Built target __idf_audio_hal
[ 72%] Built target __idf_coap
Consolidate compiler generated dependencies of target __idf_esp_codec
[ 72%] Built target __idf_esp_codec
Consolidate compiler generated dependencies of target __idf_media_hal
Consolidate compiler generated dependencies of target __idf_bt
[ 72%] Built target __idf_media_hal
Consolidate compiler generated dependencies of target __idf_audio_utils
[ 73%] Built target __idf_audio_utils
Consolidate compiler generated dependencies of target __idf_streams
[ 74%] Built target __idf_streams
Consolidate compiler generated dependencies of target __idf_audio_pipeline
Consolidate compiler generated dependencies of target __idf_sys_playback
Consolidate compiler generated dependencies of target __idf_basic_recorder
Consolidate compiler generated dependencies of target __idf_uuid-gen
Consolidate compiler generated dependencies of target __idf_led_driver
Consolidate compiler generated dependencies of target __idf_button_driver
Consolidate compiler generated dependencies of target __idf_common_dsp
[ 74%] Built target __idf_audio_pipeline
[ 74%] Built target __idf_uuid-gen
[ 74%] Built target __idf_led_driver
[ 74%] Built target __idf_sys_playback
[ 74%] Built target __idf_basic_recorder
[ 74%] Built target __idf_button_driver
[ 74%] Built target __idf_common_dsp
Consolidate compiler generated dependencies of target __idf_basic_player
Consolidate compiler generated dependencies of target __idf_dsp_driver
[ 74%] Built target __idf_basic_player
[ 74%] Built target __idf_dsp_driver
Consolidate compiler generated dependencies of target __idf_audio_board
[ 74%] Built target __idf_audio_board
[ 94%] Built target __idf_bt
Consolidate compiler generated dependencies of target __idf_protocomm
Consolidate compiler generated dependencies of target __idf_esp_hid
[ 95%] Built target __idf_protocomm
[ 96%] Built target __idf_esp_hid
Consolidate compiler generated dependencies of target __idf_esp_local_ctrl
Consolidate compiler generated dependencies of target __idf_wifi_provisioning
[ 96%] Built target __idf_esp_local_ctrl
[ 97%] Built target __idf_wifi_provisioning
Consolidate compiler generated dependencies of target __idf_misc
[ 99%] Built target __idf_misc
Consolidate compiler generated dependencies of target __idf_main
[100%] Built target __idf_main
[100%] Built target __ldgen_output_sections.ld
Consolidate compiler generated dependencies of target gva.elf
[100%] Linking CXX executable gva.elf
/Users/yusuf/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /Users/yusuf/esp/esp-va-sdk/components/voice_assistant/lib/libgva.a(dialog.c.obj):(.literal.dialog_sm_thread+0x30): undefined reference to `xTaskNotify'
/Users/yusuf/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /Users/yusuf/esp/esp-va-sdk/components/voice_assistant/lib/libgva.a(dialog.c.obj):(.text.dialog_sm_thread+0xae): undefined reference to `xTaskNotify'
collect2: error: ld returned 1 exit status
make[2]: *** [gva.elf] Error 1
make[1]: *** [CMakeFiles/gva.elf.dir/all] Error 2
make: *** [all] Error 2
make failed with exit code 2

Other items if possible

Dazza0 commented 2 years ago

@yusufk Looks like a missing #include "freertos/task.h or missing dependency in the ESP-VA-SDK library itself. Would you mind opening this issue at the ESP-VA-SDK repo instead?

yusufk commented 2 years ago

Ok, will open there: https://github.com/espressif/esp-va-sdk/issues/160

Alvin1Zhang commented 2 years ago

Thanks for reporting, let us track in https://github.com/espressif/esp-va-sdk/issues/160, feel free to reopen.