Hi all, I’m trying to run the continuous inferencing code on my XIAO ESP32S3, with limited success. The code is taken directly from the continuous example generated in the library. When looking at the serial, this is what happens
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x8 (TG1WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x403743c5
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x44c
load:0x403c9700,len:0xbe4
load:0x403cc700,len:0x2a68
entry 0x403c98d4
Edge Impulse Inferencing Demo
Inferencing settings:
Interval: 0.062500 ms.
Frame size: 16000
Sample length: 1000 ms.
No. of classes: 3
Starting continious inference in 2 seconds...
And the code gets stuck on boot forever. I was wondering if I could get any help on how to fix this issue. Thanks a lot!
Hi @hanqiulicai,
When you say “stuck on boot,” do you mean that the ESP32 just hangs after printing the first inference results? Or does the ESP32 reboot?
Hi @shawn_edgeimpulse
The ESP32 reboots constantly, there is no inferencing going on.
1 Like
Hi @hanqiulicai,
Do you see anything like “Guru Meditation Error: Core 0 panic’ed” in the serial output? Constant reboots on the ESP32 usually indicate that you ran out of RAM, and the ESP32 just reboots when that happens.
I have the same issue, constant reboots, seeed studio esp32-s3 sense board, added bit more debug messages, so it seems it crashes in function run_classifier. Also tried to increase EI_CLASSIFIER_TFLITE_LARGEST_ARENA_SIZE, and different expressif versions like the latest 6.9.0 but with no luck, model is simple with one object, project 607761.
When I run rstp server with the same board it works fine.
Camera initialized
Starting continious inference in 2 seconds...
loop...
ei_camera_capture...
run_classifier...
Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x40380488 PS : 0x00060233 A0 : 0x80380be0 A1 : 0x3fceb700
A2 : 0x3d800014 A3 : 0x00000010 A4 : 0x0003afb0 A5 : 0x00000008
A6 : 0x00000010 A7 : 0x00002a00 A8 : 0x3d8f4690 A9 : 0x00000018
A10 : 0x00240000 A11 : 0x29000037 A12 : 0x3d80007c A13 : 0x3d800038
A14 : 0x00060223 A15 : 0x00000000 SAR : 0x00000014 EXCCAUSE: 0x0000001d
EXCVADDR: 0x0024000c LBEG : 0x400570e8 LEND : 0x400570f3 LCOUNT : 0x00000000
Backtrace: 0x40380485:0x3fceb700 0x40380bdd:0x3fceb730 0x40380d70:0x3fceb750 0x40377a6a:0x3fceb770 0x4038123f:0x3fceb790 0x420262da:0x3fceb7b0 0x42004740:0x3fceb7e0 0x4200276c:0x3fceb800 0x42004a4e:0x3fceb820 0x420026b5:0x3fceb8d0 0x420037ff:0x3fceb900 0x42003dfb:0x3fcebad0 0x42003e93:0x3fcebaf0 0x42004239:0x3fcebba0 0x420042f5:0x3fcebbc0 0x4200d4ad:0x3fcebc50
PlatformIO config:
[env:seeed_xiao_esp32s3]
platform = espressif32
board = seeed_xiao_esp32s3
framework = arduino
build_flags =
-D 'BOARD_HAS_PSRAM'
-D 'CAMERA_MODEL_XIAO_ESP32S3'
lib_deps =
./lib/mikko.kallio-project-1_inferencing
espressif/esp32-camera@^2.0.4
and the decoded message:
Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x40380488 PS : 0x00060233 A0 : 0x80380be0 A1 : 0x3fceb6c0
A2 : 0x3d800014 A3 : 0x00000010 A4 : 0x0003afb0 A5 : 0x00000008
A6 : 0x00000010 A7 : 0x83809e83 A8 : 0x3d8f4690 A9 : 0x00000018
A10 : 0x809e8380 A11 : 0x9e83809e A12 : 0x3d80007c A13 : 0x3d800038
A14 : 0x00060223 A15 : 0x00000000 SAR : 0x00000014 EXCCAUSE: 0x0000001d
EXCVADDR: 0x809e838c LBEG : 0x400570e8 LEND : 0x400570f3 LCOUNT : 0x00000000
Backtrace: 0x40380485:0x3fceb6c0 0x40380bdd:0x3fceb6f0 0x40380d70:0x3fceb710 0x40377a6a:0x3fceb730 0x4038123f:0x3fceb750 0x42029b06:0x3fceb770 0x42004dd8:0x3fceb7a0 0x42002962:0x3fceb7c0 0x42005235:0x3fceb7e0 0x4200288e:0x3fceb890 0x4200420e:0x3fceb8c0 0x42004419:0x3fceba50 0x42004499:0x3fceba70 0x420049a5:0x3fcebb70 0x42004ad1:0x3fcebb90 0x42010cd9:0x3fcebc50
#0 0x40380485 in remove_free_block at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/heap_tlsf.c:206
(inlined by) block_locate_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/heap_tlsf.c:442
(inlined by) tlsf_memalign_offs at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/heap_tlsf.c:907
#1 0x40380bdd in multi_heap_aligned_alloc_impl_offs at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/multi_heap.c:264
(inlined by) multi_heap_aligned_alloc_impl_offs at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/multi_heap.c:248
#2 0x40380d70 in multi_heap_aligned_alloc at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/multi_heap_poisoning.c:203
#3 0x40377a6a in heap_caps_aligned_alloc at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/heap_caps.c:683
(inlined by) heap_caps_aligned_alloc at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/heap_caps.c:646
#4 0x4038123f in posix_memalign at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/heap.c:84
#5 0x42029b06 in aligned_alloc at /Users/brnomac003/.gitlab-runner/builds/qR2TxTby/1/idf/crosstool-NG/.build/xtensa-esp32s3-elf/src/newlib/newlib/libc/stdlib/aligned_alloc.c:35
#6 0x42004dd8 in ei_calloc(unsigned int, unsigned int) at lib/mikko.kallio-project-1_inferencing/src/edge-impulse-sdk/porting/espressif/ei_classifier_porting.cpp:100
#7 0x42002962 in (anonymous namespace)::ei_aligned_calloc(unsigned int, unsigned int) at lib/mikko.kallio-project-1_inferencing/src/edge-impulse-sdk/classifier/ei_aligned_malloc.h:64
#8 0x42005235 in tflite_learn_3_init(void* (*)(unsigned int, unsigned int)) at lib/mikko.kallio-project-1_inferencing/src/tflite-model/tflite_learn_3_compiled.cpp:1578
#9 0x4200288e in inference_tflite_setup(ei_learning_block_config_tflite_graph_t*, unsigned long long*, TfLiteTensor*, TfLiteTensor*, TfLiteTensor*, TfLiteTensor*, std::unique_ptr<void, std::function<void (void*)> >&) at lib/mikko.kallio-project-1_inferencing/src/edge-impulse-sdk/classifier/inferencing_engines/tflite_eon.h:54
#10 0x4200420e in run_nn_inference_image_quantized(ei_impulse const*, ei::ei_signal_t*, ei_impulse_result_t*, void*, bool) at lib/mikko.kallio-project-1_inferencing/src/edge-impulse-sdk/classifier/inferencing_engines/tflite_eon.h:297
#11 0x42004419 in run_classifier_image_quantized at lib/mikko.kallio-project-1_inferencing/src/edge-impulse-sdk/classifier/ei_run_classifier.h:645
#12 0x42004499 in process_impulse at lib/mikko.kallio-project-1_inferencing/src/edge-impulse-sdk/classifier/ei_run_classifier.h:245
#13 0x420049a5 in run_classifier at lib/mikko.kallio-project-1_inferencing/src/edge-impulse-sdk/classifier/ei_run_classifier.h:995
#14 0x42004ad1 in loop() at src/main.cpp:137
#15 0x42010cd9 in loopTask(void*) at /Users/miki/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp:50
ELF file SHA256: b2a6998cb60e847f
Rebooting...
Seems like the problem was esp camera setting fb_count, which was originally. set to 2, changing it to 1 fixed the issue for me.