ESP32 + I2S Microphone create unknown compiling error

So I have been trying to upload my code, however I keep getting this error anyone have any ideas as to why this is happening?

For context I am trying to use an I2S microphone in conjunction with an ESP32 to get voice recognition. Thank you!

C:\Users\johnb\Downloads\esp32-speech-recognition-main\esp32-speech-recognition-main\main-program\main-program.ino:19:49: warning: ‘I2S_COMM_FORMAT_I2S’ is deprecated [-Wdeprecated-declarations]
.communication_format = i2s_comm_format_t(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB),
^~~~~~~~~~~~~~~~~~~
In file included from C:\Users\johnb\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0/tools/sdk/esp32/include/hal/esp32/include/hal/i2s_ll.h:30,
from C:\Users\johnb\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0/tools/sdk/esp32/include/hal/include/hal/i2s_hal.h:28,
from C:\Users\johnb\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0/tools/sdk/esp32/include/driver/include/driver/i2s.h:16,
from C:\Users\johnb\Downloads\esp32-speech-recognition-main\esp32-speech-recognition-main\main-program\main-program.ino:2:
C:\Users\johnb\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0/tools/sdk/esp32/include/hal/include/hal/i2s_types.h:70:5: note: declared here
I2S_COMM_FORMAT_I2S attribute((deprecated)) = 0x01, /!< I2S communication format I2S, correspond to I2S_COMM_FORMAT_STAND_I2S/
^~~~~~~~~~~~~~~~~~~
C:\Users\johnb\Downloads\esp32-speech-recognition-main\esp32-speech-recognition-main\main-program\main-program.ino:19:71: warning: ‘I2S_COMM_FORMAT_I2S_MSB’ is deprecated [-Wdeprecated-declarations]
.communication_format = i2s_comm_format_t(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB),
^~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\johnb\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0/tools/sdk/esp32/include/hal/esp32/include/hal/i2s_ll.h:30,
from C:\Users\johnb\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0/tools/sdk/esp32/include/hal/include/hal/i2s_hal.h:28,
from C:\Users\johnb\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0/tools/sdk/esp32/include/driver/include/driver/i2s.h:16,
from C:\Users\johnb\Downloads\esp32-speech-recognition-main\esp32-speech-recognition-main\main-program\main-program.ino:2:
C:\Users\johnb\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0/tools/sdk/esp32/include/hal/include/hal/i2s_types.h:71:5: note: declared here
I2S_COMM_FORMAT_I2S_MSB attribute((deprecated)) = 0x01, /!< I2S format MSB, (I2S_COMM_FORMAT_I2S |I2S_COMM_FORMAT_I2S_MSB) correspond to I2S_COMM_FORMAT_STAND_I2S/
^~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\johnb\Documents\Arduino\libraries\speech-recognition-grow-tech_inferencing\src/edge-impulse-sdk/dsp/speechpy/speechpy.hpp:27,
from C:\Users\johnb\Documents\Arduino\libraries\speech-recognition-grow-tech_inferencing\src/edge-impulse-sdk/classifier/ei_run_dsp.h:28,
from C:\Users\johnb\Documents\Arduino\libraries\speech-recognition-grow-tech_inferencing\src/edge-impulse-sdk/classifier/ei_run_classifier.h:31,
from C:\Users\johnb\Documents\Arduino\libraries\speech-recognition-grow-tech_inferencing\src/speech-recognition-grow-tech_inferencing.h:41,
from C:\Users\johnb\Downloads\esp32-speech-recognition-main\esp32-speech-recognition-main\main-program\main-program.ino:1:
C:\Users\johnb\Documents\Arduino\libraries\speech-recognition-grow-tech_inferencing\src/edge-impulse-sdk/dsp/speechpy/feature.hpp: In static member function ‘static int ei::speechpy::feature::mfe(ei::matrix_t*, ei::matrix_t*, ei::signal_t*, uint32_t, float, float, uint16_t, uint16_t, uint32_t, uint32_t, uint16_t)’:
C:\Users\johnb\Documents\Arduino\libraries\speech-recognition-grow-tech_inferencing\src/edge-impulse-sdk/dsp/speechpy/feature.hpp:323:5: error: insn does not satisfy its constraints:
}
^
(insn 2002 930 30 72 (set (reg:SF 20 f1 [orig:266 prephitmp_402 ] [266])
(mem/u/c:SF (symbol_ref/u:SI (“.LC71") [flags 0x2]) [0 S4 A32])) “C:\Users\johnb\Documents\Arduino\libraries\speech-recognition-grow-tech_inferencing\src/edge-impulse-sdk/dsp/speechpy/feature.hpp”:154 47 {movsf_internal}
(nil))
during RTL pass: postreload
C:\Users\johnb\Documents\Arduino\libraries\speech-recognition-grow-tech_inferencing\src/edge-impulse-sdk/dsp/speechpy/feature.hpp:323:5: internal compiler error: in extract_constrain_insn, at recog.c:2210
Please submit a full bug report,
with preprocessed source if appropriate.
See https://gcc.gnu.org/bugs/ for instructions.
exit status 1
Error compiling for board ESP32 Wrover Module.
C:\Users\johnb\Downloads\esp32-speech-recognition-main\esp32-speech-recognition-main\main-program\main-program.ino:19:49: warning: ‘I2S_COMM_FORMAT_I2S’ is deprecated [-Wdeprecated-declarations]
.communication_format = i2s_comm_format_t(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB),
^~~~~~~~~~~~~~~~~~~
In file included from C:\Users\johnb\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0/tools/sdk/esp32/include/hal/esp32/include/hal/i2s_ll.h:30,
from C:\Users\johnb\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0/tools/sdk/esp32/include/hal/include/hal/i2s_hal.h:28,
from C:\Users\johnb\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0/tools/sdk/esp32/include/driver/include/driver/i2s.h:16,
from C:\Users\johnb\Downloads\esp32-speech-recognition-main\esp32-speech-recognition-main\main-program\main-program.ino:2:
C:\Users\johnb\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0/tools/sdk/esp32/include/hal/include/hal/i2s_types.h:70:5: note: declared here
I2S_COMM_FORMAT_I2S attribute((deprecated)) = 0x01, /
!< I2S communication format I2S, correspond to I2S_COMM_FORMAT_STAND_I2S/
^~~~~~~~~~~~~~~~~~~
C:\Users\johnb\Downloads\esp32-speech-recognition-main\esp32-speech-recognition-main\main-program\main-program.ino:19:71: warning: ‘I2S_COMM_FORMAT_I2S_MSB’ is deprecated [-Wdeprecated-declarations]
.communication_format = i2s_comm_format_t(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB),
^~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\johnb\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0/tools/sdk/esp32/include/hal/esp32/include/hal/i2s_ll.h:30,
from C:\Users\johnb\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0/tools/sdk/esp32/include/hal/include/hal/i2s_hal.h:28,
from C:\Users\johnb\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0/tools/sdk/esp32/include/driver/include/driver/i2s.h:16,
from C:\Users\johnb\Downloads\esp32-speech-recognition-main\esp32-speech-recognition-main\main-program\main-program.ino:2:
C:\Users\johnb\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0/tools/sdk/esp32/include/hal/include/hal/i2s_types.h:71:5: note: declared here
I2S_COMM_FORMAT_I2S_MSB attribute((deprecated)) = 0x01, /
!< I2S format MSB, (I2S_COMM_FORMAT_I2S |I2S_COMM_FORMAT_I2S_MSB) correspond to I2S_COMM_FORMAT_STAND_I2S/
^~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\johnb\Documents\Arduino\libraries\speech-recognition-grow-tech_inferencing\src/edge-impulse-sdk/dsp/speechpy/speechpy.hpp:27,
from C:\Users\johnb\Documents\Arduino\libraries\speech-recognition-grow-tech_inferencing\src/edge-impulse-sdk/classifier/ei_run_dsp.h:28,
from C:\Users\johnb\Documents\Arduino\libraries\speech-recognition-grow-tech_inferencing\src/edge-impulse-sdk/classifier/ei_run_classifier.h:31,
from C:\Users\johnb\Documents\Arduino\libraries\speech-recognition-grow-tech_inferencing\src/speech-recognition-grow-tech_inferencing.h:41,
from C:\Users\johnb\Downloads\esp32-speech-recognition-main\esp32-speech-recognition-main\main-program\main-program.ino:1:
C:\Users\johnb\Documents\Arduino\libraries\speech-recognition-grow-tech_inferencing\src/edge-impulse-sdk/dsp/speechpy/feature.hpp: In static member function 'static int ei::speechpy::feature::mfe(ei::matrix_t
, ei::matrix_t*, ei::signal_t*, uint32_t, float, float, uint16_t, uint16_t, uint32_t, uint32_t, uint16_t)':
C:\Users\johnb\Documents\Arduino\libraries\speech-recognition-grow-tech_inferencing\src/edge-impulse-sdk/dsp/speechpy/feature.hpp:323:5: error: insn does not satisfy its constraints:
}
^
(insn 2002 930 30 72 (set (reg:SF 20 f1 [orig:266 prephitmp_402 ] [266])
(mem/u/c:SF (symbol_ref/u:SI (”*.LC71") [flags 0x2]) [0 S4 A32])) “C:\Users\johnb\Documents\Arduino\libraries\speech-recognition-grow-tech_inferencing\src/edge-impulse-sdk/dsp/speechpy/feature.hpp”:154 47 {movsf_internal}
(nil))
during RTL pass: postreload
C:\Users\johnb\Documents\Arduino\libraries\speech-recognition-grow-tech_inferencing\src/edge-impulse-sdk/dsp/speechpy/feature.hpp:323:5: internal compiler error: in extract_constrain_insn, at recog.c:2210
Please submit a full bug report,
with preprocessed source if appropriate.
See https://gcc.gnu.org/bugs/ for instructions.
exit status 1
Error compiling for board ESP32 Wrover Module.

Hi @JVanlla,

It seems that the Arduino library won’t work with the ESP32. You may need to port the library yourself using the C++ SDK. I recommend reading through this thread to see if helps, as the poster ran into a similar error message.

Thank you for getting back to me, I was able to follow the instructions from the other forum post and have expelled the other errors. Now I am left with only this error remaining:

c:/users/johnb/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld.exe: cannot open linker script file esp32.rom.redefined.ld: No such file or directory
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board ESP32 Wrover Module.

I would appreciate any insight as to how I can resolve this!

The code and library for the keyword recognition can be found here:

Hi @JVanlla,

This seems to be an issue with Arduino support of ESP32. What version of the Arduino IDE and which version of the ESP32 board package are you using? This post may offer some help.

Thank you for your help, I uninstalled and then reinstalled Arduino, ESP32, and all libraries and it compiled completely. Now I am trying to get my microphone (Adafruit I2S MEMS Microphone Breakout - SPH0645LM4H) to work with the code. I am not having much luck finding documented material and the only forum post has been this post however there does not seem to be a resolution to the underlying problem. If you have any ideas as to how I can potentially get started I would greatly appreciate it!

Hi @JVanlla,

I recommend trying to record some basic sounds with the I2S microphone first before integrating it into the keyword spotting system. You will need to write your own I2S driver or find an existing one to get started, as I do not think that Arduino has a built-in I2S driver for the ESP32. There is a potential bug in the I2S code for the ESP32: https://hackaday.io/project/162059-street-sense/log/160705-new-i2s-microphone

Here are some other resources that might help:

1 Like

Hello @JVanlla ,

For your information, we released the official support of the ESP32, which includes ESP-NN optimizations: https://www.edgeimpulse.com/blog/announcing-official-support-for-the-espressif-esp-eye-esp32