hugobloem / esp-ha-speech

Local speech recognition on an ESP32 for Home Assistant
141 stars 10 forks source link

Building the project complains about spi_flash_*. #1

Closed justinhunt1223 closed 1 year ago

justinhunt1223 commented 1 year ago

I cloned the repo on my Win10 machine and I'm getting this error when trying to build it. I get the same issue if I use the VSCode method as you suggested in the readme and using idf.py from the CLI.

There's a bunch of errors about spi_flash functions, this is just one of them. I am using ESP-IDF v5.0.1, v4 complained about one of the dependencies requiring v5, so not sure which one I should be using or if it matters. I am new to ESP-IDF, so if this is a simple fix, please let me know.

screenshot

C:/Users/justin/Documents/GitHub/esp-ha-speech/managed_components/espressif__esp-sr/src/model_path.c:307:9: error: implicit declaration of function 'spi_flash_munmap' [-Werror=implicit-function-declaration] 307 | spi_flash_munmap(models->mmap_handle); | ^~~~~~~~~~~~~~~~ cc1.exe: some warnings being treated as errors [7/100] Linking C static library esp-idf\espressif__led_strip\libespressif__led_strip.a [8/100] Building C object esp-idf/espressif__qrcode/CMakeFiles/__idf_espressif__qrcode.dir/qrcodegen.c.obj [9/100] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/gui/image/mute_off.c.obj [10/100] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/gui/image/mute_on.c.obj [11/100] Building C object esp-idf/espressif__qrcode/CMakeFiles/__idf_espressif__qrcode.dir/esp_qrcode_wrapper.c.obj ninja: build stopped: subcommand failed. HINT: Please check that the function name is correct. Also it is possible that you've forgot to import spi_flash_munmap library(s) in header file or add the necessary REQURIES component. Try to add missing libraries to your project header file or check idf_component_register(REQUIRES ...) section in your component CmakeList.txt file. For more information run 'idf.py docs -sp api-guides/build-system.html'. Also, please check if the function has been removed, renamed or replaced by an alternative function - refer to the migration guide for more information. HINT: The issue is better to resolve by replacing format specifiers to 'PRI'-family macros (include <inttypes.h> header file).

dshafik commented 1 year ago

I have this same issue on macOS (Monterey, 12.6)

justinhunt1223 commented 1 year ago

I think the issue is from one of the managed components, ESP SR. I got it to compile by specifying the version for it to 1.2.0. 1.2.1 is the recent version and it appears to have some issues.

Open main/idf_components.yml and change espressif/esp-sr: ^1 to espressif/esp-sr: "1.2.0"

dshafik commented 1 year ago

@justinhunt1223 yes, that fixed the build. Having some issues writing it to the device, but working through it now.

justinhunt1223 commented 1 year ago

I have gotten it flashed to the device but now I'm dealing with it having checksum mismatch and rebooting every 10 seconds or so. One day this will work.

hugobloem commented 1 year ago

I think the issue is from one of the managed components, ESP SR. I got it to compile by specifying the version for it to 1.2.0. 1.2.1 is the recent version and it appears to have some issues.

Open main/idf_components.yml and change espressif/esp-sr: ^1 to espressif/esp-sr: "1.2.0"

Thanks for solving this I will update the requirements file to reflect this.

I am currently away so can only do it next week.

hugobloem commented 1 year ago

Fixed in #6 Thank you!