ESP32 Exit Status 1 when building ESP_SR ->Basic example

Hi guys,

A real novice here. I was trying to build the example sketch "ESP_SR " -> Basic. I've stripped everything out of the sketch to try get it to work, and have only the #include "ESP_SR.h" and it still fails to build and gives "exit status 1" without much information. There are a couple of warnings but I wouldn't know how to fix them anyway, but not sure if that's the issue.

I have the ESP32 Board Manager 3.0.0-rc3 installed, which I know is not an official release but a beta version so maybe that is my issue...

I'm using Arduino IDE 2.3.2 and an ESP32S3 Dev Module as the board.

I've tried to upload a photo of the code and the Output logs, but it says new users can't upload stuff. But the code is below

#include "ESP_SR.h"

void setup(){
}

void loop(){
}

Anyway not sure if anyone can help?

These are the two warnings

C:\Users\CameronBray\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-442a798083/esp32s3/include/soc/esp32s3/include/soc/soc.h:57:14: warning: array subscript 0 is outside array bounds of 'volatile uint32_t [0]' [-Warray-bounds]
   57 |             (*(volatile uint32_t *)(_r));
C:\Users\CameronBray\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-rc3\cores\esp32\Esp.cpp:344:23: note: in expansion of macro 'REG_READ'
  344 |   uint32_t spi_ctrl = REG_READ(SPI_CTRL_REG(0));

These are the lase few lines before it fails to build

Linking everything together...
"C:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\xtensa-esp32s3-elf-gcc\\esp-12.2.0_20230208/bin/xtensa-esp32s3-elf-g++" "@C:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-442a798083/esp32s3/flags/ld_flags" "@C:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-442a798083/esp32s3/flags/ld_scripts" "-Wl,--Map=C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\9E9366E2ED779B4F3CCA29D2CFFD9756/Speech.ino.map" "-LC:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-442a798083/esp32s3/lib" "-LC:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-442a798083/esp32s3/ld" "-LC:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-442a798083/esp32s3/qio_qspi" -Wl,--wrap=esp_panic_handler -Wl,--start-group "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\9E9366E2ED779B4F3CCA29D2CFFD9756\\sketch\\Speech.ino.cpp.o" "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\9E9366E2ED779B4F3CCA29D2CFFD9756\\libraries\\ESP_SR\\ESP_SR.cpp.o" "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\9E9366E2ED779B4F3CCA29D2CFFD9756\\libraries\\ESP_SR\\esp32-hal-sr.c.o" "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\9E9366E2ED779B4F3CCA29D2CFFD9756\\libraries\\ESP_I2S\\ESP_I2S.cpp.o" "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\9E9366E2ED779B4F3CCA29D2CFFD9756\\core\\core.a" "@C:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-442a798083/esp32s3/flags/ld_libs" -Wl,--end-group -Wl,-EL -o "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\9E9366E2ED779B4F3CCA29D2CFFD9756/Speech.ino.elf"
"C:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esptool_py\\4.6/esptool.exe" --chip esp32s3 elf2image --flash_mode dio --flash_freq 80m --flash_size 4MB --elf-sha256-offset 0xb0 -o "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\9E9366E2ED779B4F3CCA29D2CFFD9756/Speech.ino.bin" "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\9E9366E2ED779B4F3CCA29D2CFFD9756/Speech.ino.elf"
esptool.py v4.6
Creating esp32s3 image...
Merged 2 ELF sections
Successfully created esp32s3 image.
"C:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.0.0-rc3\\tools\\gen_esp32part.exe" -q "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\9E9366E2ED779B4F3CCA29D2CFFD9756/partitions.csv" "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\9E9366E2ED779B4F3CCA29D2CFFD9756/Speech.ino.partitions.bin"
cmd /c if exist "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\9E9366E2ED779B4F3CCA29D2CFFD9756\\libraries\\Insights" "C:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.0.0-rc3\\tools\\gen_insights_package.exe" "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\9E9366E2ED779B4F3CCA29D2CFFD9756" Speech.ino "C:\\Users\\CameronBray\\Documents\\Arduino\\Speech"
cmd /c if exist "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\9E9366E2ED779B4F3CCA29D2CFFD9756\\libraries\\ESP_SR" if exist "C:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-442a798083/esp32s3\\esp_sr\\srmodels.bin" COPY /y "C:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-442a798083/esp32s3\\esp_sr\\srmodels.bin" "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\9E9366E2ED779B4F3CCA29D2CFFD9756\\srmodels.bin"

The syntax of the command is incorrect.
Using library ESP_SR at version 1.0.0 in folder: C:\Users\CameronBray\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-rc3\libraries\ESP_SR 
Using library ESP_I2S at version 1.0.0 in folder: C:\Users\CameronBray\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-rc3\libraries\ESP_I2S 
exit status 1

Compilation error: exit status 1

Hi @camb007 ,

Welcome to the forum..
Those 2 warnings you posted have nothing to do with your issue..
One of them is just a note, the other a warning..

looks like it's stumbling on copying a file..

curious, can you compile something really simple like the blink sketch when you have your s3 board selected??
and yes, you are using the developer release, so could be broken..
never played with the speech recognition..

good luck.. ~q

Hi @qubits-us

Yes I can compile the blink program, works like normal.

Wrote 0x1000000 bytes to file C:\Users\CameronBray\AppData\Local\Temp\arduino\sketches\82C828CDF5E42DB3D1EFEEE0D8524699/Blink.ino.merged.bin, ready to flash to offset 0x0

"C:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\xtensa-esp32s3-elf-gcc\\esp-12.2.0_20230208/bin/xtensa-esp32s3-elf-size" -A "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\82C828CDF5E42DB3D1EFEEE0D8524699/Blink.ino.elf"
Sketch uses 289237 bytes (9%) of program storage space. Maximum is 3145728 bytes.
Global variables use 14648 bytes (4%) of dynamic memory, leaving 313032 bytes for local variables. Maximum is 327680 bytes.

I'm working with my son to make an alarm clock and thought it would be fun to add some offline voice recognition to it, but a I said a novice when it comes to the programming side of things.

Cool, now add the include to this file and see if it bombs out..
if yes, then maybe try current stable 2.0.16..
uninstall this core, change the board url..
arduino-esp32 installing
hopefully that gets you coding..

good luck.. ~q

No luck when I tried to include on the blink program.
When I restored to the stable 2.0.16, it complains that

No such file or directory
 #include "ESP_SR.h"

And you can still compile blink??
strange, i'd say check on the esp32 forum but it appears down at the moment too..
did you see if the folder is there?
C:\Users\ user\AppData\Local\Arduino15\packages\esp32\hardware\esp32
replace "user" with your user name, this is where the core is installed..

good luck.. ~q

This is because the "ESP_SR" library was added to the "esp32" boards platform after the time of the 2.0.16 release

1 Like

Yep can compile blink on 2.0.16 with ESPS3 Dev Module.
But it doesn't look like the ESP_SR folder is there for version 2.0.16.

Part of the reason I was using the developers release was I thought ESP_SR was only available on there

Was looking also on the esp32 forum..
it's back up again, sql issues, sometimes..
i don't see any mention of this lib, so yeah, seems new..
esp32 forum
They got a cat called SKiaNet which looks like something to do with voice..
Maybe try a different ver of 3??

~q

So have tried all the 3 versions now: -alpha3, -rc1, -rc2, -rc3 but no luck.

Wonder if it just me and my setup for some reason...

maybe you have to select a certain partition size??

~q

really, looking at it again..
it's having trouble copying some bin file??
so let's see what everyone else says..
~q

1 Like

I had tried a few different partition schemes, think I read that "ESP SR 16M" was the best

I mentioned that after looking thru the source..
found this..

#if !defined(ARDUINO_PARTITION_esp_sr_32) && !defined(ARDUINO_PARTITION_esp_sr_16) && !defined(ARDUINO_PARTITION_esp_sr_8)
#warning Compatible partition must be selected for ESP_SR to work
#endif

arduino-esp32 libraries ESP_SR source

this is your error i believe..

the cmd right above it is copying a bin file, syntax looks ok..
but it's late, so could be my eyes..

tomorrows another day..

good luck.. ~q

The error is caused by this command:

The problem is the presence of a / separator in one of the paths instead of the Windows native \ separator. For the most part, Windows is fine with either, but in this specific situation where the command passes through the the os/exec Go package and then the Windows command interpreter, it seems that the use of backslash as path separator is mandatory.

I'll provide instructions you can follow to fix the bug in the "esp32" boards platform's command template:

  1. Select File > Quit from the Arduino IDE menus if it is running.
    All Arduino IDE windows will close.
    ā“˜ This is required because Arduino IDE won't recognize changes made to the platform configuration files while the IDE is running.
  2. Open the file at the following path in any text editor:
    C:\Users\CameronBray\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-rc3\platform.txt
    
    :exclamation: If looking for it with your file manager or command line, note that the AppData folder is hidden by default. On Windows "File Explorer", you can make it visible by opening the "View" menu, then checking the box next to "☐ Hidden items".
  3. Change line 170 from this:
    recipe.hooks.objcopy.postobjcopy.2.pattern.windows=cmd /c if exist "{build.path}\libraries\ESP_SR" if exist "{compiler.sdk.path}\esp_sr\srmodels.bin" COPY /y "{compiler.sdk.path}\esp_sr\srmodels.bin" "{build.path}\srmodels.bin"
    
    to this:
    recipe.hooks.objcopy.postobjcopy.2.pattern.windows=cmd /c if exist "{build.path}\libraries\ESP_SR" if exist "{tools.esp32-arduino-libs.path}\{build.mcu}\esp_sr\srmodels.bin" COPY /y "{compiler.sdk.path}\esp_sr\srmodels.bin" "{build.path}\srmodels.bin"
    
  4. Save the file.
  5. Start Arduino IDE.

Now try compiling or uploading the ESP_SR library sketch again. Hopefully this time it will work as expected.

Hi @ptillisch,

Thanks for posting!
I followed your instructions, and believe I did it correctly. I double checked that line 170 was correct, but I get the same result.

Linking everything together...
"C:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\xtensa-esp32s3-elf-gcc\\esp-12.2.0_20230208/bin/xtensa-esp32s3-elf-g++" "@C:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-442a798083/esp32s3/flags/ld_flags" "@C:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-442a798083/esp32s3/flags/ld_scripts" "-Wl,--Map=C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\51359F835F4FADB4D723A1F7A7DCA33F/Basic.ino.map" "-LC:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-442a798083/esp32s3/lib" "-LC:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-442a798083/esp32s3/ld" "-LC:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-442a798083/esp32s3/qio_opi" -Wl,--wrap=esp_panic_handler -Wl,--start-group "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\51359F835F4FADB4D723A1F7A7DCA33F\\sketch\\Basic.ino.cpp.o" "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\51359F835F4FADB4D723A1F7A7DCA33F\\libraries\\ESP_I2S\\ESP_I2S.cpp.o" "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\51359F835F4FADB4D723A1F7A7DCA33F\\libraries\\ESP_SR\\ESP_SR.cpp.o" "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\51359F835F4FADB4D723A1F7A7DCA33F\\libraries\\ESP_SR\\esp32-hal-sr.c.o" "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\51359F835F4FADB4D723A1F7A7DCA33F\\core\\core.a" "@C:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-442a798083/esp32s3/flags/ld_libs" -Wl,--end-group -Wl,-EL -o "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\51359F835F4FADB4D723A1F7A7DCA33F/Basic.ino.elf"
"C:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esptool_py\\4.6/esptool.exe" --chip esp32s3 elf2image --flash_mode dio --flash_freq 80m --flash_size 16MB --elf-sha256-offset 0xb0 -o "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\51359F835F4FADB4D723A1F7A7DCA33F/Basic.ino.bin" "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\51359F835F4FADB4D723A1F7A7DCA33F/Basic.ino.elf"
esptool.py v4.6
Creating esp32s3 image...
Merged 2 ELF sections
Successfully created esp32s3 image.
"C:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.0.0-rc3\\tools\\gen_esp32part.exe" -q "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\51359F835F4FADB4D723A1F7A7DCA33F/partitions.csv" "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\51359F835F4FADB4D723A1F7A7DCA33F/Basic.ino.partitions.bin"
cmd /c if exist "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\51359F835F4FADB4D723A1F7A7DCA33F\\libraries\\Insights" "C:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.0.0-rc3\\tools\\gen_insights_package.exe" "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\51359F835F4FADB4D723A1F7A7DCA33F" Basic.ino "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\.arduinoIDE-unsaved2024416-3376-13c07cr.byjj\\Basic"
cmd /c if exist "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\51359F835F4FADB4D723A1F7A7DCA33F\\libraries\\ESP_SR" if exist "C:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-442a798083\\esp32s3\\esp_sr\\srmodels.bin" COPY /y "C:\\Users\\CameronBray\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-442a798083/esp32s3\\esp_sr\\srmodels.bin" "C:\\Users\\CameronBray\\AppData\\Local\\Temp\\arduino\\sketches\\51359F835F4FADB4D723A1F7A7DCA33F\\srmodels.bin"
The syntax of the command is incorrect.

Using library ESP_I2S at version 1.0.0 in folder: C:\Users\CameronBray\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-rc3\libraries\ESP_I2S 
Using library ESP_SR at version 1.0.0 in folder: C:\Users\CameronBray\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-rc3\libraries\ESP_SR 
exit status 1

Compilation error: exit status 1

Sorry about that. I see that I missed one additional occurrence of the bug. Here are the corrected instructions:

  1. Select File > Quit from the Arduino IDE menus if it is running.
    All Arduino IDE windows will close.
    ā“˜ This is required because Arduino IDE won't recognize changes made to the platform configuration files while the IDE is running.
  2. Open the file at the following path in any text editor:
    C:\Users\CameronBray\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-rc3\platform.txt
    
    :exclamation: If looking for it with your file manager or command line, note that the AppData folder is hidden by default. On Windows "File Explorer", you can make it visible by opening the "View" menu, then checking the box next to "☐ Hidden items".
  3. Change line 170 in the file to this:
    recipe.hooks.objcopy.postobjcopy.2.pattern.windows=cmd /c if exist "{build.path}\libraries\ESP_SR" if exist "{tools.esp32-arduino-libs.path}\{build.mcu}\esp_sr\srmodels.bin" COPY /y "{tools.esp32-arduino-libs.path}\{build.mcu}\esp_sr\srmodels.bin" "{build.path}\srmodels.bin"
    
  4. Save the file.
  5. Start Arduino IDE.

Now try compiling or uploading the ESP_SR library sketch again. Hopefully this time it will work as expected.

1 Like

That did it! Thank you @ptillisch!!
I never would have got close to figuring that out

I have now submitted a fix to the ESP32 platform developers so that it won't be necessary for users to manually apply the fix in order to use the "ESP_SR" library:

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.