diff --git a/esphome/components/micro_wake_word/micro_wake_word.cpp b/esphome/components/micro_wake_word/micro_wake_word.cpp index c031a9f269d..6877e9e5df5 100644 --- a/esphome/components/micro_wake_word/micro_wake_word.cpp +++ b/esphome/components/micro_wake_word/micro_wake_word.cpp @@ -23,7 +23,13 @@ static const size_t DATA_TIMEOUT_MS = 50; static const uint32_t RING_BUFFER_DURATION_MS = 120; +#ifdef CONFIG_IDF_TARGET_ESP32P4 +// ESP32-P4 PIE-optimized esp-nn kernels (e.g. depthwise_conv_s8_ch1_pie) require +// significantly more stack than other variants, causing stack protection faults at 3072. +static const uint32_t INFERENCE_TASK_STACK_SIZE = 8192; +#else static const uint32_t INFERENCE_TASK_STACK_SIZE = 3072; +#endif static const UBaseType_t INFERENCE_TASK_PRIORITY = 3; enum EventGroupBits : uint32_t {