ESP32-S3 panic (StoreProhibited) using Arduino, during run_classification()

Question/Issue:

I get the following panic during the run_classification() step using the Arduino framework on a Seeed Studio XIAO ESP32-S3 Sense board. This is my first project here so I suspect I could be doing something wrong. I have not been able to narrow it down, except that by changing some lines in ei_malloc() I can get past this error, but run into the same error later on in the execution. I am generally following the Seeed Studio tutorial on image classification for the board.

==============

Guru Meditation Error: Core  1 panic'ed (StoreProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x40380c55  PS      : 0x00060e33  A0      : 0x80380121  A1      : 0x3fcebb40  
A2      : 0x3c177b54  A3      : 0x00000010  A4      : 0x00000014  A5      : 0x00000008  
A6      : 0x3fcebd48  A7      : 0x3fc9fdd0  A8      : 0x00000010  A9      : 0x3c0e0014  
A10     : 0x0000001b  A11     : 0x27153f27  A12     : 0x14402c14  A13     : 0x3c0e0038  
A14     : 0x3c0e007c  A15     : 0x402c1440  SAR     : 0x0000001f  EXCCAUSE: 0x0000001d  
EXCVADDR: 0x14402c20  LBEG    : 0x400570e8  LEND    : 0x400570f3  LCOUNT  : 0x00000000  


Backtrace: 0x40380c52:0x3fcebb40 0x4038011e:0x3fcebb60 0x403802b3:0x3fcebb80 0x403765e2:0x3fcebba0 0x40376442:0x3fcebbd0 0x42007e03:0x3fcebbf0 0x4200419d:0x3fcebc10 0x42004605:0x3fcebcc0 0x42004706:0x3fcebce0 0x4200f4ec:0x3fcebd80 0x4037bed9:0x3fcebda0

Project ID:
austin944/austin944-project-1

Context/Use case:
Classification of Dog/Cat Images on Arduino using ESP32-S3 Camera

Summary:
ESP32-S3 panic during run-time

Steps to Reproduce:
Arduino Sketch Location:

Deploy Edge Impulse Project as Arduino Library
Upload code to Sense board using Arduino IDE 2.3.5

Expected Results:
I don’t expect a panic

Actual Results:
I get a panic

Reproducibility:

  • [x ] Always
  • [ ] Sometimes
  • [ ] Rarely

Environment:

  • Platform: Seeed Studio XIAO ESP32-S3 Sense board
  • Build Environment Details: Arduino IDE 2.3.5 , Arduino Core for ESP32 v3.3.7
  • OS Version: Windows 11
  • Edge Impulse Version (Firmware): 1.85.1
  • Edge Impulse CLI Version: [e.g., 1.5.0]
  • Project Version: [e.g., 1.0.1]
  • Custom Blocks / Impulse Configuration:
    Logs/Attachments:

=========== Before Setup Start ===========
Chip Info:
------------------------------------------
  Model             : ESP32-S3
  Package           : 0
  Revision          : 0.02
  Cores             : 2
  CPU Frequency     : 240 MHz
  XTAL Frequency    : 40 MHz
  Features Bitfield : 0x00000012
  Embedded Flash    : No
  Embedded PSRAM    : No
  2.4GHz WiFi       : Yes
  Classic BT        : No
  BT Low Energy     : Yes
  IEEE 802.15.4     : No
------------------------------------------
INTERNAL Memory Info:
------------------------------------------
  BT Low Energy     : Yes
  IEEE 802.15.4     : No
------------------------------------------
INTERNAL Memory Info:
------------------------------------------
  Total Size        :   368208 B ( 359.6 KB)
  Free Bytes        :   333912 B ( 326.1 KB)
  Allocated Bytes   :    29048 B (  28.4 KB)
  Minimum Free Bytes:   328764 B ( 321.1 KB)
  Largest Free Block:   270324 B ( 264.0 KB)
------------------------------------------
SPIRAM Memory Info:
------------------------------------------
  Total Size        :  8388608 B (8192.0 KB)
  Free Bytes        :  8386076 B (8189.5 KB)
  Allocated Bytes   :      140 B (   0.1 KB)
  Minimum Free Bytes:  8386076 B (8189.5 KB)
  Largest Free Block:  8257524 B (8064.0 KB)
  Bus Mode          : OPI
------------------------------------------
Flash Info:
------------------------------------------
  Chip Size         :  8388608 B (8 MB)
  Block Size        :    65536 B (  64.0 KB)
  Sector Size       :     4096 B (   4.0 KB)
  Page Size         :      256 B (   0.2 KB)
  Bus Speed         : 80 MHz
  Flash Frequency   : 80 MHz (source: 160 MHz, divider: 2)
  Bus Mode          : QIO
------------------------------------------
Partitions Info:
------------------------------------------
                nvs : addr: 0x00009000, size:    20.0 KB, type: DATA, subtype: NVS
            otadata : addr: 0x0000E000, size:     8.0 KB, type: DATA, subtype: OTA
               app0 : addr: 0x00010000, size:  3264.0 KB, type:  APP, subtype: OTA_0
               app1 : addr: 0x00340000, size:  3264.0 KB, type:  APP, subtype: OTA_1
             spiffs : addr: 0x00670000, size:  1536.0 KB, type: DATA, subtype: SPIFFS
           coredump : addr: 0x007F0000, size:    64.0 KB, type: DATA, subtype: COREDUMP
------------------------------------------
Software Info:
------------------------------------------
  Compile Date/Time : Feb 22 2026 15:45:38
  Compile Host OS   : windows
  ESP-IDF Version   : v5.5.2-729-g87912cd291
  Arduino Version   : 3.3.7
------------------------------------------
Board Info:
------------------------------------------
  Arduino Board     : XIAO_ESP32S3
  Arduino Variant   : XIAO_ESP32S3
  Arduino FQBN      : esp32:esp32:XIAO_ESP32S3:UploadSpeed=921600,USBMode=hwcdc,CDCOnBoot=default,MSCOnBoot=default,DFUOnBoot=default,UploadMode=default,CPUFreq=240,FlashMode=qio,FlashSize=8M,PartitionScheme=default_8MB,DebugLevel=verbose,PSRAM=opi,LoopCore=1,EventsCore=1,EraseFlash=none,JTAGAdapter=default
============ Before Setup End ============
[   762][V][esp32-hal-periman.c:251] perimanClearBusDeinit(): Deinit function for type UART_RX (2) cleared
[   763][V][esp32-hal-periman.c:251] perimanClearBusDeinit(): Deinit function for type UART_TX (3) cleared
[   763][V][esp32-hal-periman.c:251] perimanClearBusDeinit(): Deinit function for type UART_CTS (4) cleared
[   763][V][esp32-hal-periman.c:251] perimanClearBusDeinit(): Deinit function for type UART_RTS (5) cleared
[   764][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 44 successfully set to type UART_RX (2) with bus 0x3fc95ec0
[   764][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RX (2) successfully set to 0x4200f324
[   765][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 43 successfully set to type UART_TX (3) with bus 0x3fc95ec0
[   765][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_TX (3) successfully set to 0x4200f240
[   766][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 19 already has type USB_DM (45) with bus 0x3fc9c56c
[   766][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 20 already has type USB_DP (46) with bus 0x3fc9c56c
Edge Impulse Inferencing Demo
Camera initialized


Starting continuous inference in 2 seconds...
=========== After Setup Start ============
INTERNAL Memory Info:
------------------------------------------
  Total Size        :   368208 B ( 359.6 KB)
  Free Bytes        :   310500 B ( 303.2 KB)
  Allocated Bytes   :    52076 B (  50.9 KB)
  Minimum Free Bytes:   310500 B ( 303.2 KB)
  Largest Free Block:   258036 B ( 252.0 KB)
------------------------------------------
SPIRAM Memory Info:
------------------------------------------
  Total Size        :  8388608 B (8192.0 KB)
  Free Bytes        :  8000724 B (7813.2 KB)
  Allocated Bytes   :   385348 B ( 376.3 KB)
  Minimum Free Bytes:  8000724 B (7813.2 KB)
  Largest Free Block:  7995380 B (7808.0 KB)
------------------------------------------
GPIO Info:
------------------------------------------
 GPIO : BUS_TYPE[bus/unit][chan]
  --------------------------------------  
    19 : USB_DM
    20 : USB_DP
    43 : UART_TX[0]
    44 : UART_RX[0]
============ After Setup End =============
Before buffer alloc
After buffer alloc
Got buffer
Got capture
Start classification
Guru Meditation Error: Core  1 panic'ed (StoreProhibited). Exception was unhandled.
Core  1 register dump:
PC      : 0x40380c55  PS      : 0x00060e33  A0      : 0x80380121  A1      : 0x3fcebb40  
A2      : 0x3c177b54  A3      : 0x00000010  A4      : 0x00000014  A5      : 0x00000008  
A6      : 0x3fcebd48  A7      : 0x3fc9fdd0  A8      : 0x00000010  A9      : 0x3c0e0014  
A10     : 0x0000001b  A11     : 0x27153f27  A12     : 0x14402c14  A13     : 0x3c0e0038  
A14     : 0x3c0e007c  A15     : 0x402c1440  SAR     : 0x0000001f  EXCCAUSE: 0x0000001d  
EXCVADDR: 0x14402c20  LBEG    : 0x400570e8  LEND    : 0x400570f3  LCOUNT  : 0x00000000  


Backtrace: 0x40380c52:0x3fcebb40 0x4038011e:0x3fcebb60 0x403802b3:0x3fcebb80 0x403765e2:0x3fcebba0 0x40376442:0x3fcebbd0 0x42007e03:0x3fcebbf0 0x4200419d:0x3fcebc10 0x42004605:0x3fcebcc0 0x42004706:0x3fcebce0 0x4200f4ec:0x3fcebd80 0x4037bed9:0x3fcebda0




ELF file SHA256: c9bcb369d

Rebooting...

Additional Information:

From what I can tell by inserting prints, it gets the exception from the very first execution of this line in edge-impulse-sdk/classifier/ei_run_classifier.h, line 252, inside process_impulse():

std::unique_ptr<ei_feature_t[]> raw_results_ptr(new ei_feature_t[num_results]);

If I change this line in edge-impulse-sdk/porting/espressif/ei_classifier_porting.cpp

return heap_caps_aligned_alloc(16, size, MALLOC_CAP_DEFAULT);

over to:

return aligned_alloc(16, size);

Then it gets past the unique pointer allocation without a panic, but gets a different panic later on, still inside the first invocation of process_impulse():

Guru Meditation Error: Core 1 panic’ed (StoreProhibited). Exception was unhandled.

Seeed Studio Tutorial I am following:

I removed all of the classifier code from the sketch and changed the malloc() to an ei_malloc() and I still get this error:

assert failed: multi_heap_free multi_heap_poisoning.c:279 (head != NULL)

Let me work on narrowing down the problem further as I think there could be a problem in the sketch.

I eventually got the system to work by changing from the EON compiler over to TensorFlow Lite, similar to what was done in this other thread where the same assert message was seen with an ESP32-S3 Sense board.

1 Like

Yes! This is what it makes it work! ESP32 is not working with the EON compiler model versions but runs on the TensorFlow Lite version!

Glad that you found this :slight_smile: