How to debug intermittent crashes when running MobileNet SSD on ESP32?

Hello! I'm deploying a MobileNet SSD object detection model on an ESP32 microcontroller using the ESP-WHO framework. During inference, the device occasionally crashes with the error Guru Meditation Error: Core 1 panic'ed (LoadProhibited). The crashes occur intermittently, roughly once every 10-15 inferences, and I haven't noticed a specific pattern related to the input data. My model is approximately 20 MB, and the input images are 320x240 pixels. I've confirmed that my input data and model are correctly formatted. What advanced debugging techniques or optimizations can I apply to handle such intermittent crashes? Are there any best practices for managing memory and processor load on the ESP32 when running complex models? Additionally, are there any specific tools or logs I should focus on to identify the root cause of these crashes?
1 Reply
Joseph Ogbonna
Joseph Ogbonna4mo ago
To address ESP32 crashes with MobileNet SSD: I found this for you Debugging
1. Enable Logging:
esp_log_level_set("*", ESP_LOG_VERBOSE);

esp_log_level_set("*", ESP_LOG_VERBOSE);

2. Stack Trace: - Use esp_backtrace_print to find crash points. 3. Memory Check:
size_t free_heap = heap_caps_get_free_size(MALLOC_CAP_8BIT);
ESP_LOGI("HEAP", "Free heap: %u", free_heap);

size_t free_heap = heap_caps_get_free_size(MALLOC_CAP_8BIT);
ESP_LOGI("HEAP", "Free heap: %u", free_heap);

Optimizations 1. Use PSRAM for large buffers. 2. Pin Tasks to cores:
xTaskCreatePinnedToCore(inference_task, "inference", 8192, NULL, 5, NULL, 1);

xTaskCreatePinnedToCore(inference_task, "inference", 8192, NULL, 5, NULL, 1);

3. Quantize Model to reduce size. 4. Preprocess Images to lower resolution. Check this also https://docs.espressif.com/projects/esp-idf/en/v5.0/esp32s3/api-guides/performance/speed.html
Want results from more Discord servers?
Add your server