ESP32 Compile Error in Arduino

Hi All,
I am trying to run a color recognition example on an ESP32 with arduino.just use a color sensor gives the rgb raw data.like r 234 g 34 b 45.
if i chose Nano 33 BLE Board ,it can finish compile,but when i chose esp32 wrover board,it report errors.
Does anyone have an idea how I can fix this?

In file included from C:\Users\jacob\Documents\Arduino\libraries\color_inferencing\src/edge-impulse-sdk/dsp/speechpy/speechpy.hpp:27,
                 from C:\Users\jacob\Documents\Arduino\libraries\color_inferencing\src/edge-impulse-sdk/classifier/ei_run_dsp.h:28,
                 from C:\Users\jacob\Documents\Arduino\libraries\color_inferencing\src/edge-impulse-sdk/classifier/ei_run_classifier.h:34,
                 from C:\Users\jacob\Documents\Arduino\libraries\color_inferencing\src/color_inferencing.h:55,
                 from C:\Users\jacob\AppData\Local\Temp\arduino_modified_sketch_690417\sketch_jan01a.ino:24:
C:\Users\jacob\Documents\Arduino\libraries\color_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\jacob\Documents\Arduino\libraries\color_inferencing\src/edge-impulse-sdk/dsp/speechpy/feature.hpp:323:5: error: insn does not satisfy its constraints:
     }
     ^
(insn 2011 1862 30 72 (set (reg:SF 20 f1 [orig:78 prephitmp_53 ] [78])
        (mem/u/c:SF (symbol_ref/u:SI ("*.LC64") [flags 0x2]) [0  S4 A32])) "C:\Users\jacob\Documents\Arduino\libraries\color_inferencing\src/edge-impulse-sdk/dsp/speechpy/feature.hpp":154 47 {movsf_internal}
     (nil))
during RTL pass: postreload
C:\Users\jacob\Documents\Arduino\libraries\color_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
为开发板 ESP32 Dev Module 编译时出错。

Hello @sunhaoqin,

Are you trying to use the default examples provided by the Arduino library export? These ones won’t work on an ESP32 (except the static_buffer example).
If not, can you share your code or the example you are trying to reproduce so I can have a look please?

Regards,

Louis

hi @louis
thanks for your reply。
I tried the static_buffer example,but still have the same error.
esp32 board compile failed and Nano 33 BLE Board can finish compile.
I just added 48,253,12 to the default static_buffer example

static const float features[] = {
    48, 253, 12
    // copy raw features here (for example from the 'Live classification' page)
    // see https://docs.edgeimpulse.com/docs/running-your-impulse-arduino
};

https://studio.edgeimpulse.com/public/74435/latest

Hello @sunhaoqin,

Unfortunately I cannot reproduce your error:

I can successfully compile when using the ESP32 Wrover module.

Could you try deleting your imported color_inferencing library from Arduino folder and import it again? Or removing your ESP32 boards and install them again from the Boards Manager?
Also, which Arduino IDE are you using?

Regards,

Louis

Hi @louis
I update the ESP32 board management,Then the compilation succeeded。
but i have another question,
if esp32 only can use static buffer,Does this mean that I can’t get data in real time?
Would you consider add any esp32 board to the fully supported development board list?I think this will be of great help to developers。
Anyway,thanks for your reply。

Hello @sunhaoqin,

So, as you can export C++ libraries, you can make it work with any board that have enough resources for your model and support C/C++.

On the ESP32 side, here is an example I wrote some time ago to do image classification:

On this project, the only “complex” thing was to adapt the image pre-processing with the functions available in Espressif SDK.

Also, Espressif have their own custom DSP instructions so it won’t be as optimized as it is for an Arm Cortex (that we fully support).
So to take advantage of hardware acceleration, we would need to integrate that in our SDK which is not done.

But in any cases, you can compile our C/C++ library without hardware acceleration and it will work (it just won’t be as optimized as it is for fully supported target).

I hope this was clear and answered your questions.

Regards,

Louis

@sunhaoqin

Also, for your particular project, you just need to find a way to get your RGB values you want to classify and then pass these values in your classifier. Adapting the code should not be very hard I guess.
How did you plan to grab these values? Any particular sensor that you had in mind?

Regards,

Louis

hi @louis
This is the first time I try edgeimpulse,and it’s a really good product。Before I know it I am trying to use tensorflowlite and python to train my model but it‘s really hard for me,because I am a hardware engineer,I’m not good at python.So edgeimpulse really helps a lot。
The project “color” is just a test for the product and environment。Next step I will use a color sensor to get data, like AS7341 or TCS34725。

In this website,I find I can use signal_from_buffer to get data from RAM instead of static buffer。

1 Like