Deploying key word spotting impulse on an arduino Nano esp32. Device keeps rebooting

I am trying to deploy the key word spotting impulse on an arduino Nano esp32 board.
I deployed the arduino library and integrated already in two different Environments: arduino ide and in platform io (with platform: arduino)
Compilation and linking succeeds without error.
When running the firmware, the result is, that the board reboots continuously.
Can anyone help or have experience with the arduino Nano esp32 board?

I am still trying to run the “static-Buffer” example on an “arduino nano ESP32” board.
Environment: Platform IO with arduino framework
[env:arduino_nano_esp32] platform = espressif32 board = arduino_nano_esp32 framework = arduino

After building and uploading the firmware. The board starts running, but then disconnects USB, which seems like a reboot. I activated the debug mode with

// invoke the impulse
    EI_IMPULSE_ERROR res = run_classifier(&features_signal, &result, true /* debug */);

and added some extra debug messages as below, to observer, how far the code is working.
It seems that the features are processed

Features (456 ms.): 0.000000 0.000000 0.000000 ........ 0.000000 0.000000 0.000000 0.000000 0.000000
Running impulse...
PAL: Processing [0] of [1]

but after “Running impulse…” the reset seems to occur in

EI_IMPULSE_ERROR res = block.infer_fn(impulse, ....)

Any ideas? I have no idea how to proceed. Thank you !!!

extern "C" EI_IMPULSE_ERROR run_inference(
    ei_impulse_handle_t *handle,
    ei_feature_t *fmatrix,
    ei_impulse_result_t *result,
    bool debug = false)
{
    auto& impulse = handle->impulse;
    for (size_t ix = 0; ix < impulse->learning_blocks_size; ix++) {

        ei_learning_block_t block = impulse->learning_blocks[ix];

        ei_printf("PAL: Processing [%lu] of [%lu]\n", ix,impulse->learning_blocks_size);    // #### gets to this point

#if EI_CLASSIFIER_LOAD_IMAGE_SCALING
        // we do not plan to have multiple dsp blocks with image
        // so just apply scaling to the first one
        EI_IMPULSE_ERROR scale_res = ei_scale_fmatrix(&block, fmatrix[0].matrix);
        if (scale_res != EI_IMPULSE_OK) {
            return scale_res;
        }
#endif

        result->copy_output = block.keep_output;

        EI_IMPULSE_ERROR res = block.infer_fn(impulse, fmatrix, ix, (uint32_t*)block.input_block_ids, block.input_block_ids_size, result, block.config, debug);
        ei_printf("PAL: block.infer_fn RESULT [%i]\n", res);    // #### never gets to this point
        if (res != EI_IMPULSE_OK) {
            return res;
        }

HI @plangfeld

No experience with this board but is it esp32 based? if so check out this guide particularly the using with other hardware - Espressif ESP-EYE | Edge Impulse Documentation

Best

Eoin

Looking again and because it is restarting constantly it must be either power or memory its running short on. Can you try running a smaller version of this project, or enable in8 / eon compiler? The size of the model may be causing overload.

Some variations of esp32 use PSRAM, check out you device specs you can see how to enable that from the discussion here - Use PSRAM for impulse deployment on ESP32-S3

Also can you share your platformio configuration @plangfeld?

You may need to enable that in the platformio config, I’m not too famlier with their IDE but it should be something like -

board_build.psram_type = qio
build_flags = 
  **-DBOARD_HAS_PSRAM**

I guess you should be able to allocate the correct amount of memory for your model this is the right one i think - https://docs.arduino.cc/hardware/nano-esp32/#tech-specs

model-parameters/model_variables.h within your exported Edge Impulse Arduino library. look for the * ```
#define EI_CLASSIFIER_TFLITE_ARENA_SIZE (XX * 1024)

#define EI_CLASSIFIER_TFLITE_ARENA_SIZE    (512 * 1024) // for example

Hope this helps getting you unblocked let me know if you make any progress, also the example you should be working from is continuous inference not the static buffer example one

Best

Eoin