Stuck with compiling ESP32-P4 binary

Hey,

I’m a bit stuck at the moment sadly. I’m trying to compile a firmware for an esp32-p4 via the Homeassistant EspHome Builder addon, although it doesn’t seem to work due to compiler errors (for example /data/cache/platformio/packages/framework-espidf/components/esp_wifi/include/esp_wifi.h:308:25: error: ‘CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF’ was not declared in this scope)

I’m not sure where to start really, maybe someone can give me a hint where to start looking / configuring stuff?

Config

esphome:
  name: badge
  friendly_name: badge

esp32:
  board: esp32-p4
  framework:
    type: esp-idf
    

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxxx"

ota:
  - platform: esphome
    password: "xxxxxx"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

Log Output

INFO ESPHome 2025.8.0
INFO Reading configuration /config/esphome/badge.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing badge (board: esp32-p4; framework: espidf; platform: https://github.com/pioarduino/platform-espressif32/releases/download/54.03.21-2/platform-espressif32.zip)
--------------------------------------------------------------------------------
INFO Package configuration completed successfully
Library Manager: Installing esphome/noise-c @ 0.1.10
INFO Installing esphome/noise-c @ 0.1.10
Unpacking  [####################################]  100%
Library Manager: [email protected] has been installed!
INFO [email protected] has been installed!
Library Manager: Resolving dependencies...
INFO Resolving dependencies...
Library Manager: Installing esphome/libsodium @ 1.10020.7
INFO Installing esphome/libsodium @ 1.10020.7
Unpacking  [####################################]  100%
Library Manager: [email protected] has been installed!
INFO [email protected] has been installed!
INFO Package configuration completed successfully
HARDWARE: ESP32P4 360MHz, 320KB RAM, 4MB Flash
 - framework-espidf @ 3.50402.0 (5.4.2) 
 - tool-cmake @ 3.30.2 
 - tool-esp-rom-elfs @ 2024.10.11 
 - tool-esptoolpy @ 5.0.2 
 - tool-mklittlefs @ 3.2.0 
 - tool-ninja @ 1.13.1 
 - tool-scons @ 4.40801.0 (4.8.1) 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-riscv32-esp @ 14.2.0+20241119
Reading CMake configuration...
Generating assembly for certificate bundle...
Dependency Graph
|-- noise-c @ 0.1.10
Compiling .pioenvs/badge/src/esphome/components/api/api_connection.cpp.o
Compiling .pioenvs/badge/src/esphome/components/api/api_frame_helper.cpp.o
Compiling .pioenvs/badge/src/esphome/components/api/api_frame_helper_noise.cpp.o
Compiling .pioenvs/badge/src/esphome/components/api/api_pb2.cpp.o
Compiling .pioenvs/badge/src/esphome/components/api/api_pb2_service.cpp.o
Compiling .pioenvs/badge/src/esphome/components/api/api_server.cpp.o
Compiling .pioenvs/badge/src/esphome/components/api/list_entities.cpp.o
Compiling .pioenvs/badge/src/esphome/components/api/proto.cpp.o
Compiling .pioenvs/badge/src/esphome/components/api/subscribe_state.cpp.o
Compiling .pioenvs/badge/src/esphome/components/esp32/core.cpp.o
Compiling .pioenvs/badge/src/esphome/components/esp32/gpio.cpp.o
Compiling .pioenvs/badge/src/esphome/components/esp32/helpers.cpp.o
Compiling .pioenvs/badge/src/esphome/components/esp32/preferences.cpp.o
Compiling .pioenvs/badge/src/esphome/components/esphome/ota/ota_esphome.cpp.o
Compiling .pioenvs/badge/src/esphome/components/logger/logger.cpp.o
Compiling .pioenvs/badge/src/esphome/components/logger/logger_esp32.cpp.o
Compiling .pioenvs/badge/src/esphome/components/logger/task_log_buffer.cpp.o
Compiling .pioenvs/badge/src/esphome/components/md5/md5.cpp.o
Compiling .pioenvs/badge/src/esphome/components/mdns/mdns_component.cpp.o
Compiling .pioenvs/badge/src/esphome/components/mdns/mdns_esp32.cpp.o
Compiling .pioenvs/badge/src/esphome/components/network/util.cpp.o
Compiling .pioenvs/badge/src/esphome/components/ota/ota_backend.cpp.o
Compiling .pioenvs/badge/src/esphome/components/ota/ota_backend_esp_idf.cpp.o
Compiling .pioenvs/badge/src/esphome/components/safe_mode/safe_mode.cpp.o
Compiling .pioenvs/badge/src/esphome/components/socket/bsd_sockets_impl.cpp.o
Compiling .pioenvs/badge/src/esphome/components/socket/socket.cpp.o
Compiling .pioenvs/badge/src/esphome/components/wifi/wifi_component.cpp.o
Compiling .pioenvs/badge/src/esphome/components/wifi/wifi_component_esp_idf.cpp.o
Compiling .pioenvs/badge/src/esphome/core/application.cpp.o
Compiling .pioenvs/badge/src/esphome/core/color.cpp.o
In file included from src/esphome/components/wifi/wifi_component_esp_idf.cpp:9:
src/esphome/components/wifi/wifi_component_esp_idf.cpp: In member function 'void esphome::wifi::WiFiComponent::wifi_pre_setup_()':
/data/cache/platformio/packages/framework-espidf/components/esp_wifi/include/esp_wifi.h:303:26: error: 'CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM' was not declared in this scope; did you mean 'CONFIG_ETH_DMA_RX_BUFFER_NUM'?
  303 |     .static_rx_buf_num = CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM,\
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/wifi/wifi_component_esp_idf.cpp:177:28: note: in expansion of macro 'WIFI_INIT_CONFIG_DEFAULT'
  177 |   wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~
/data/cache/platformio/packages/framework-espidf/components/esp_wifi/include/esp_wifi.h:304:27: error: 'CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM' was not declared in this scope; did you mean 'WIFI_DYNAMIC_TX_BUFFER_NUM'?
  304 |     .dynamic_rx_buf_num = CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM,\
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/wifi/wifi_component_esp_idf.cpp:177:28: note: in expansion of macro 'WIFI_INIT_CONFIG_DEFAULT'
  177 |   wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~
/data/cache/platformio/packages/framework-espidf/components/esp_wifi/include/esp_wifi.h:305:20: error: 'CONFIG_ESP_WIFI_TX_BUFFER_TYPE' was not declared in this scope; did you mean 'CONFIG_ETH_DMA_TX_BUFFER_NUM'?
  305 |     .tx_buf_type = CONFIG_ESP_WIFI_TX_BUFFER_TYPE,\
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/wifi/wifi_component_esp_idf.cpp:177:28: note: in expansion of macro 'WIFI_INIT_CONFIG_DEFAULT'
  177 |   wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~
/data/cache/platformio/packages/framework-espidf/components/esp_wifi/include/esp_wifi.h:308:25: error: 'CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF' was not declared in this scope
  308 |     .rx_mgmt_buf_type = CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF,\
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/wifi/wifi_component_esp_idf.cpp:177:28: note: in expansion of macro 'WIFI_INIT_CONFIG_DEFAULT'
  177 |   wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~
/data/cache/platformio/packages/framework-espidf/components/esp_wifi/include/esp_wifi.h:323:31: error: 'CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM' was not declared in this scope
  323 |     .espnow_max_encrypt_num = CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM, \
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/wifi/wifi_component_esp_idf.cpp:177:28: note: in expansion of macro 'WIFI_INIT_CONFIG_DEFAULT'
  177 |   wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~
Compiling .pioenvs/badge/src/esphome/core/component.cpp.o
Compiling .pioenvs/badge/src/esphome/core/component_iterator.cpp.o
*** [.pioenvs/badge/src/esphome/components/wifi/wifi_component_esp_idf.cpp.o] Error 1
========================= [FAILED] Took 53.49 seconds =========================

If you come across compile errors always the first thing to do is clean the build files 3 dots on the right in the drop down somewhere. This may or may not work. Someone with more knowledge may be able to help more.

ESP32-P4 don’t have WiFi. So…

While P4 might be able to run esphome code, it’s not anyhow usable for normal HA setups because it doesn’t have any radio. Of course it could be connected to some module that has wireless capabilities.
TMHO Esphome documentation should mention this…

No P4 has native WiFi at this time, but most boards come with a second chip that does, you have to configure it.

I think this board is highly interesting, because of integrated Ethernet and Poe: ESP32-P4 Ethernet Development Board Based on ESP32-P4 Chip, with 100M RJ45 ETH Port, MIPI-CSI/DSI, Microphone, Speaker Header, PoE Module and Power Supply Header, USB OTG 2.0 HS etc.: Amazon.de: Business, Industry & Science
Do you think it will be supported by ESPHome Device Builder soon?