Esp_hosted: issues with building

冰冰watermelon
Posts: 3
Joined: Mon Jan 26, 2026 4:06 am

Esp_hosted: issues with building

Postby 冰冰watermelon » Mon Jan 26, 2026 5:17 am

I am a student currently learning to use the ESP32-P4-FUNCTION-EV-Board development kit. When attempting to connect the P4 to the C6 via the SDIO2 interface, I keep encountering strange issues—my esp32_hosted component cannot be properly integrated into my project.

Code: Select all

dependencies:
    espressif/esp_wifi_remote:
     version: "0.14.*"

    espressif/esp_hosted:
     version: "1.4.*"
This is my idf_component.yml file,which is located in the main directory of the project (the folder where the main function resides).

Code: Select all

idf_component_register(SRCS "main.c" "esp_hosted_example.c"
                    INCLUDE_DIRS "."
                    REQUIRES esp_wifi esp_event nvs_flash esp_system esp32_p4_function_ev_board esp_psram custom mqtt generated espressif__esp_hosted)

Code: Select all

# The following five lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)

# Add component directories
set(EXTRA_COMPONENT_DIRS 
    components/hardware/esp32_p4_function_ev_board
    components/software/mqtt
    components/software/wifi
    components/app/custom
    components/app/generated
    managed_components/espressif__esp_hosted
)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(newset_P4)
Here are my two CMakeLists.txt files, which are located in the main directory (where the main function resides) and the root directory of the project respectively.


Here are my error messages. I apologize for not being sure which part is the key information, so I've copied and pasted the entire content here.
CMake Error in CMakeLists.txt:
Evaluation file to be written multiple times with different content. This
is generally caused by the content evaluating the configuration type,
language, or location of object files:

D:/Documents/VScode_esp_idf/newset_P4/build/ldgen_libraries

CMake Error in CMakeLists.txt:
Evaluation file to be written multiple times with different content. This
is generally caused by the content evaluating the configuration type,
language, or location of object files:

D:/Documents/VScode_esp_idf/newset_P4/build/project_description.json

-- Generating done (4.3s)
CMake Generate step failed. Build files cannot be regenerated correctly.
ninja: error: rebuilding 'build.ninja': subcommand failed
FAILED: build.ninja
D:\ESP32_IDF_Versions\.espressif\tools\cmake\3.30.2\bin\cmake.exe --regenerate-during-build -SD:\Documents\VScode_esp_idf\newset_P4 -BD:\Documents\VScode_esp_idf\newset_P4\build
Whenever I include #include "esp_hosted.h" in any of my source files (function files), the build process always throws an error.
I’ve reached out to many AI tools for help, including Copilot and ChatGPT, but none of them provided effective solutions.

I would greatly appreciate it if any of you could give me some tips on troubleshooting direction or solutions! Even a small clue will help me a lot. Once the problem is solved, I will update the solution in this post timely to help others who may encounter the same issue later. Thank you all again for your kindness and help.

Sprite
Espressif staff
Espressif staff
Posts: 10596
Joined: Thu Nov 26, 2015 4:08 am

Re: Esp_hosted: issues with building

Postby Sprite » Mon Jan 26, 2026 6:12 am

Moved from 'forum bugs' topic (where it was offtopic) to its own post.

MicroController
Posts: 2661
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Esp_hosted: issues with building

Postby MicroController » Mon Jan 26, 2026 8:21 am

One thing I notice is your EXTRA_COMPONENT_DIRS. This should list directories where components can be found, not the individual components, i.e.

Code: Select all

set(EXTRA_COMPONENT_DIRS
    ...
    components/software
    ...
for the components "mqtt" and "wifi" to be found (assuming "mqtt" and "wifi" are the actual components' directories inside "software").

冰冰watermelon
Posts: 3
Joined: Mon Jan 26, 2026 4:06 am

Re: Esp_hosted: issues with building

Postby 冰冰watermelon » Tue Jan 27, 2026 3:43 am

I've found the problem! The root cause is that I didn't add my components correctly. There are some parts of the component content that I don't need to write separately—they’re already included in one of the existing components. I just need to call the functions of this component to use them. Thank you everyone!

Code: Select all

dependencies:
  espressif/wifi_remote_over_eppp: ^0.3.0
  espressif/esp_serial_slave_link: ^1.1.2
  espressif/eppp_link: ^1.1.4
  espressif/esp_wifi_remote: ^1.3.1
  espressif/esp_hosted: ^2.11.3
idf:
    version: ">=5.0"

Who is online

Users browsing this forum: Baidu [Spider], ChatGPT-User and 11 guests