Skip to content

Update to IDF 5.4.1 and add basic ESP32_P4 support #3152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
84a3033
Update to IDF 5.4.1 and add basic ESP32_P4
AdrianSoundy Dec 12, 2024
b63734a
Code style fixes
nfbot Apr 12, 2025
8458b74
Fix Coderabbit issues and add P4 to Azure build
AdrianSoundy Apr 12, 2025
d55afb2
Add back mbedtls_xxx for some STM32 targets
AdrianSoundy Apr 14, 2025
ea4368e
Update patch version and python env for dockers
AdrianSoundy Apr 18, 2025
9b954da
Add libusb to docker for openocd
AdrianSoundy Apr 22, 2025
fb1bb10
Work around for ESP_ROM_ELF_DIR issue
AdrianSoundy Apr 22, 2025
c88beef
Correcting typos
josesimoes Apr 22, 2025
2e9c3c0
Resolve smoketest builds, header not found
AdrianSoundy Apr 23, 2025
d1b182d
IDF 5_4_1 patch test
AdrianSoundy Apr 26, 2025
29046ed
Updates from review part 1
AdrianSoundy Apr 26, 2025
82279f4
Updates for review part 2
AdrianSoundy Apr 29, 2025
ed0520c
Ethernet and build rework
AdrianSoundy Apr 30, 2025
f5874c6
Update Component registry versions to latest
AdrianSoundy Apr 30, 2025
bf80b01
Update Graphics_Memory.cpp code to same version for all ESP targets
AdrianSoundy May 1, 2025
8439fef
Merge branch 'main' into IDF5_4
AdrianSoundy May 1, 2025
b6d4b3e
Merge branch 'main' into IDF5_4
AdrianSoundy May 6, 2025
6a54fdf
Add extra p4 config for latest hosted component
AdrianSoundy May 6, 2025
22399a9
Merge branch 'IDF5_4' of https://github.com/AdrianSoundy/nf-interpret…
AdrianSoundy May 6, 2025
a896c12
Work CI-CD
josesimoes May 9, 2025
e4261b4
Merge branch 'main' into IDF5_4
josesimoes May 9, 2025
bba45e0
Merge branch 'main' into IDF5_4
josesimoes May 9, 2025
4f6b98b
Update P4 config & readme
AdrianSoundy May 10, 2025
7fff176
Merge branch 'IDF5_4' of https://github.com/AdrianSoundy/nf-interpret…
AdrianSoundy May 10, 2025
d2c2d1d
Change Wifi-remote & esp_hosted component versions used
AdrianSoundy May 10, 2025
b7769c2
Update sdkconfig.default.esp32p4
AdrianSoundy May 13, 2025
bff0a70
Add Wi-Fi Remote config for better performance on p4
AdrianSoundy May 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .devcontainer/All/Dockerfile.All.SRC
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ RUN apt-get update \
ninja-build \
srecord \
nodejs \
libffi-dev
libffi-dev \
libusb-1.0

# Create needed directories
RUN mkdir -p /usr/local/bin/gcc \
Expand Down Expand Up @@ -92,7 +93,7 @@ RUN git clone --branch V10.4.1-kernel-only https://github.com/FreeRTOS/FreeRTOS-
RUN git clone --branch STABLE-2_1_3_RELEASE https://github.com/lwip-tcpip/lwip.git --depth 1 ./sources/lwip

# Clone ESP-IDF
RUN git clone --branch v5.2.3 https://github.com/espressif/esp-idf --depth 1 --recursive ./sources/esp-idf
RUN git clone --branch v5.4.1 https://github.com/espressif/esp-idf --depth 1 --recursive ./sources/esp-idf

# Clone what is needed for TI
RUN git clone --branch 4.10.00.07 https://github.com/nanoframework/SimpleLink_CC32xx_SDK.git --depth 1 ./sources/SimpleLinkCC32 \
Expand Down Expand Up @@ -127,12 +128,12 @@ RUN ln -fs /usr/bin/python3 /usr/bin/python \

# Install ESP-IDF
ENV IDF_PATH=/sources/esp-idf
ENV ESP_PATCH_VER=esp-13.2.0_20230928
ENV ESP_PATCH_VER=esp-14.2.0_20241119
# This is now taking care in the following line
# RUN python -m pip install -r $IDF_PATH/requirements.txt
RUN $IDF_PATH/install.sh

ENV PATH=/root/.espressif/python_env/idf5.2_py3.11_env/bin:$PATH:\
ENV PATH=/root/.espressif/python_env/idf5.4_py3.11_env/bin:$PATH:\
$IDF_PATH/components/esptool_py/esptool:\
$IDF_PATH/components/espcoredump:\
$IDF_PATH/components/partition_table/:\
Expand Down
9 changes: 5 additions & 4 deletions .devcontainer/ESP32/Dockerfile.ESP32.SRC
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ RUN apt-get update \
ninja-build \
srecord \
nodejs \
libffi-dev
libffi-dev \
libusb-1.0

# Create needed directories
RUN mkdir -p /usr/local/bin/gcc
Expand All @@ -48,7 +49,7 @@ RUN mkdir -p /usr/local/bin/gcc
RUN git clone --branch R0.15a https://github.com/abbrev/fatfs.git --depth 1 ./sources/fatfs

# Clone ESP-IDF
RUN git clone --branch v5.2.3 https://github.com/espressif/esp-idf --depth 1 --recursive ./sources/esp-idf
RUN git clone --branch v5.4.1 https://github.com/espressif/esp-idf --depth 1 --recursive ./sources/esp-idf

# Creating static link python for pyhton3
RUN ln -fs /usr/bin/python3 /usr/bin/python \
Expand All @@ -61,12 +62,12 @@ ENV PATH=/usr/bin/cmake/bin:${PATH}

# Install ESP-IDF
ENV IDF_PATH=/sources/esp-idf
ENV ESP_PATCH_VER=esp-13.2.0_20230928
ENV ESP_PATCH_VER=esp-14.2.0_20241119
# This is now taking care in the following line
# RUN python -m pip install -r $IDF_PATH/requirements.txt
RUN $IDF_PATH/install.sh

ENV PATH=/root/.espressif/python_env/idf5.2_py3.11_env/bin:$PATH:\
ENV PATH=/root/.espressif/python_env/idf5.4_py3.11_env/bin:$PATH:\
$IDF_PATH/components/esptool_py/esptool:\
$IDF_PATH/components/espcoredump:\
$IDF_PATH/components/partition_table/:\
Expand Down
53 changes: 53 additions & 0 deletions CMake/Modules/ESP32_P4_GCC_options.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#
# Copyright (c) .NET Foundation and Contributors
# See LICENSE file in the project root for full license information.
#

# need to specify linker flags here
set(CMAKE_EXE_LINKER_FLAGS " -Wl,--print-memory-usage " CACHE INTERNAL "executable linker flags")

# TARGET parameter to set the target that's setting them for
# optional EXTRA_COMPILE_OPTIONS with compile options to be added
macro(nf_set_compile_options)

# parse arguments
cmake_parse_arguments(NFSCO "" "TARGET" "EXTRA_COMPILE_OPTIONS" ${ARGN})

if(NOT NFSCO_TARGET OR "${NFSCO_TARGET}" STREQUAL "")
message(FATAL_ERROR "Need to set TARGET argument when calling nf_set_compile_options()")
endif()

# include any extra options coming from any extra args?
target_compile_options(${NFSCO_TARGET} PUBLIC ${NFSCO_EXTRA_COMPILE_OPTIONS} -Wall -Wextra -Werror -Wno-sign-compare -Wno-unused-parameter -Wshadow -Wimplicit-fallthrough -fshort-wchar -fno-builtin -fno-common -fno-exceptions -fcheck-new )

# this series has FPU
target_compile_definitions(${NFSCO_TARGET} PUBLIC -DTARGET=esp32p4 -DUSE_FPU=TRUE -DPLATFORM_ESP32 -DESP_PLATFORM)

endmacro()

# TARGET parameter to set the target that's setting them for
# optional EXTRA_LINK_FLAGS with link flags to be added
macro(nf_set_link_options)

# parse arguments
cmake_parse_arguments(NFSLO "" "TARGET;EXTRA_LINK_FLAGS" "" ${ARGN})

if(NOT NFSLO_TARGET OR "${NFSLO_TARGET}" STREQUAL "")
message(FATAL_ERROR "Need to set TARGET argument when calling nf_set_link_options()")
endif()

# set optimization linker flags for RELEASE and MinSizeRel
if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
set_property(TARGET ${NFSLO_TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -Os ")
endif()

# include libraries in build
nf_include_libraries_in_build(${NFSLO_TARGET})

# set extra linker flags
set_property(TARGET ${NFSLO_TARGET} APPEND_STRING PROPERTY LINK_FLAGS " ${NFSLO_EXTRA_LINK_FLAGS} ")

# set optimization flags
nf_set_optimization_options(${NFSLO_TARGET})

endmacro()
4 changes: 4 additions & 0 deletions CMake/Modules/ESP32_P4_sources.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#
# Copyright (c) .NET Foundation and Contributors
# See LICENSE file in the project root for full license information.
#
31 changes: 16 additions & 15 deletions CMake/Modules/FindESP32_IDF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ FetchContent_GetProperties(esp32_idf)
include(binutils.ESP32)

list(APPEND ESP32_IDF_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/config)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/${TARGET_SERIES_SHORT})
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/${TARGET_SERIES_SHORT}/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/${TARGET_SERIES_SHORT}/esp_rom/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/${ESP32_CPU_TYPE}/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/${ESP32_CPU_TYPE}/${TARGET_SERIES_SHORT}/include)
Expand All @@ -21,21 +19,22 @@ list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/hal/includ
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/hal/${TARGET_SERIES_SHORT}/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/soc/${TARGET_SERIES_SHORT}/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/soc/${TARGET_SERIES_SHORT}/include/soc)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/soc/${TARGET_SERIES_SHORT}/register)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_hw_support/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_hw_support/dma/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_hw_support/include/soc)

list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/gptimer/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/uart/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/gpio/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/spi/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_driver_gptimer/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_driver_uart/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_driver_gpio/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_driver_spi/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/i2c/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/i2s/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/dac/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/ledc/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/pcnt/include)
#list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/rmt/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/sdmmc/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_driver_i2s/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_driver_dac/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_driver_ledc/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_driver_pcnt/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_driver_sdmmc/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_driver_sdspi/include)

# Use depecated drivers for RMT, I2S etc
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/deprecated)
Expand All @@ -58,6 +57,7 @@ list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_ringbu
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_timer/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_system/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_wifi/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_wifi/include/local)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_partition/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_pm/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/fatfs/diskio)
Expand Down Expand Up @@ -86,11 +86,12 @@ list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/sdmmc/incl
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/soc/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/vfs/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/wear_levelling/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/usb_serial_jtag/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_driver_usb_serial_jtag/include)

list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_rom/include/${TARGET_SERIES_SHORT}/rom)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_rom/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_rom/${TARGET_SERIES_SHORT})
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_rom/${TARGET_SERIES_SHORT}/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_rom/${TARGET_SERIES_SHORT}/include/${TARGET_SERIES_SHORT}/rom)

# includes specific to ESP32S2 and ESP32S3
if(${TARGET_SERIES_SHORT} STREQUAL "esp32s2" OR ${TARGET_SERIES_SHORT} STREQUAL "esp32s3")
Expand Down
75 changes: 66 additions & 9 deletions CMake/binutils.ESP32.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,43 @@ macro(nf_fix_esp32c3_rom_file)

endmacro()

# Fixes an issue with IDF 5.4.1 where we get an error cause by ESP_ROM_ELF_DIR environment variable missing
# This patch removes need for variable. Offical patch added after IDF5.4.1 release
macro(nf_patch_idf5_4_1)
file(READ
${esp32_idf_SOURCE_DIR}/tools/cmake/gdbinit.cmake
ESP32_GBBINIT_CONTENT)

string(FIND ${ESP32_GBBINIT_CONTENT} "# set(gdbinit_rom_in_path " GBD_INIT_PATCH_INDEX)
message("-- Check IDF patch exists")
if(GBD_INIT_PATCH_INDEX EQUAL -1)

message("-- Patching IDF 5.4.1 gdbinit.cmake")

string(REPLACE
"set(gdbinit_rom_in_path "
"# set(gdbinit_rom_in_path "
ESP32_GBBINIT_NEW_CONTENT
"${ESP32_GBBINIT_CONTENT}")

string(REPLACE
"set(gdbinit_rom_path "
"# set(gdbinit_rom_path "
ESP32_GBBINIT_NEW_CONTENT
"${ESP32_GBBINIT_NEW_CONTENT}")

string(REPLACE
"file(TO_CMAKE_PATH "
"# file(TO_CMAKE_PATH "
ESP32_GBBINIT_NEW_CONTENT
"${ESP32_GBBINIT_NEW_CONTENT}")

file(WRITE
${esp32_idf_SOURCE_DIR}/tools/cmake/gdbinit.cmake
"${ESP32_GBBINIT_NEW_CONTENT}")
endif()
endmacro()

# setting compile definitions for a target based on general build options
# TARGET parameter to set the target that's setting them for
# optional EXTRA_COMPILE_DEFINITIONS with compiler definitions to be added to the library
Expand Down Expand Up @@ -184,7 +221,7 @@ function(nf_set_esp32_target_series)
set(TARGET_SERIES_SHORT ${TARGET_SERIES_2} CACHE INTERNAL "ESP32 target series lower case, short version")

# set the CPU type
if(${TARGET_SERIES_SHORT} STREQUAL "esp32c3" OR ${TARGET_SERIES_SHORT} STREQUAL "esp32c6" OR ${TARGET_SERIES_SHORT} STREQUAL "esp32h2" )
if(${TARGET_SERIES_SHORT} STREQUAL "esp32c3" OR ${TARGET_SERIES_SHORT} STREQUAL "esp32c6" OR ${TARGET_SERIES_SHORT} STREQUAL "esp32h2" OR ${TARGET_SERIES_SHORT} STREQUAL "esp32p4")
set(ESP32_CPU_TYPE "riscv" CACHE INTERNAL "Setting CPU type")
else()
set(ESP32_CPU_TYPE "xtensa" CACHE INTERNAL "Setting CPU type")
Expand Down Expand Up @@ -468,6 +505,7 @@ macro(nf_setup_partition_tables_generator)
${TARGET_SERIES_SHORT} STREQUAL "esp32c3" OR
${TARGET_SERIES_SHORT} STREQUAL "esp32c6" OR
${TARGET_SERIES_SHORT} STREQUAL "esp32h2" OR
${TARGET_SERIES_SHORT} STREQUAL "esp32p4" OR
${TARGET_SERIES_SHORT} STREQUAL "esp32s2" OR
${TARGET_SERIES_SHORT} STREQUAL "esp32s3")

Expand All @@ -482,6 +520,7 @@ macro(nf_setup_partition_tables_generator)

if(${TARGET_SERIES_SHORT} STREQUAL "esp32" OR
${TARGET_SERIES_SHORT} STREQUAL "esp32c6" OR
${TARGET_SERIES_SHORT} STREQUAL "esp32p4" OR
${TARGET_SERIES_SHORT} STREQUAL "esp32s2" OR
${TARGET_SERIES_SHORT} STREQUAL "esp32s3")

Expand All @@ -501,7 +540,8 @@ macro(nf_setup_partition_tables_generator)

endif()

if(${TARGET_SERIES_SHORT} STREQUAL "esp32s3")
if(${TARGET_SERIES_SHORT} STREQUAL "esp32s3" OR
${TARGET_SERIES_SHORT} STREQUAL "esp32p4")

# 32MB partition table for ESP32_S3
add_custom_command( TARGET ${NANOCLR_PROJECT_NAME}.elf POST_BUILD
Expand Down Expand Up @@ -594,11 +634,16 @@ macro(nf_add_idf_as_library)
# Load any required Components from Component registry
# Must be done before "tools/cmake/idf.cmake"
if(ESP32_USB_CDC)
nf_install_idf_component_from_registry(tinyusb 55142eec-a3a4-47a5-ad01-4ba3ef44444b)
nf_install_idf_component_from_registry(esp_tinyusb 8115ffc9-366a-4340-94ab-e327aed20831)
nf_install_idf_component_from_registry(tinyusb c384401d-144d-453d-a821-20f1ba0a7be1)
nf_install_idf_component_from_registry(esp_tinyusb 47b2b1fc-fb7e-4acf-943b-a14125e0f1e7)
endif()

nf_install_idf_component_from_registry(littlefs 4831aa41-8b72-48ac-a534-910a985a5519)
nf_install_idf_component_from_registry(littlefs 288ff2e7-dfd9-4833-9be5-6e9d37d29880)

if(${TARGET_SERIES_SHORT} STREQUAL "esp32p4")
nf_install_idf_component_from_registry(esp_wifi_remote 3355c7e4-03ac-44a2-b100-1cbb29a05d03)
nf_install_idf_component_from_registry(esp_hosted 9fb39051-7a32-4fbf-83e9-a4b54ab6fae5)
endif()

include(${IDF_PATH_CMAKED}/tools/cmake/idf.cmake)

Expand Down Expand Up @@ -670,7 +715,6 @@ macro(nf_add_idf_as_library)
freertos
esptool_py
fatfs
esp_wifi
esp_event
vfs
esp_netif
Expand All @@ -686,7 +730,6 @@ macro(nf_add_idf_as_library)
idf::freertos
idf::esptool_py
idf::fatfs
idf::esp_wifi
idf::esp_event
idf::vfs
idf::esp_netif
Expand All @@ -695,6 +738,17 @@ macro(nf_add_idf_as_library)
idf::littlefs
)

# Needed for remote Wifi module on P4 boards
if(${TARGET_SERIES_SHORT} STREQUAL "esp32p4")
list(APPEND IDF_COMPONENTS_TO_ADD esp_wifi_remote)
list(APPEND IDF_COMPONENTS_TO_ADD esp_hosted)
list(APPEND IDF_LIBRARIES_TO_ADD idf::esp_hosted)
list(APPEND IDF_LIBRARIES_TO_ADD idf::esp_wifi_remote)
else()
list(APPEND IDF_COMPONENTS_TO_ADD esp_wifi)
list(APPEND IDF_LIBRARIES_TO_ADD idf::esp_wifi)
endif()

if(HAL_USE_BLE_OPTION)
list(APPEND IDF_COMPONENTS_TO_ADD bt)
list(APPEND IDF_LIBRARIES_TO_ADD idf::bt)
Expand Down Expand Up @@ -1004,6 +1058,9 @@ macro(nf_add_idf_as_library)

nf_fix_esp32c3_rom_file()

# FIXME patch IDF 5.4.1 problem
nf_patch_idf5_4_1()

# find out if there is support for BLE
string(FIND ${SDKCONFIG_DEFAULT_CONTENTS} "CONFIG_BT_ENABLED=y" CONFIG_BT_ENABLED_POS)

Expand Down Expand Up @@ -1035,8 +1092,8 @@ macro(nf_add_idf_as_library)
add_custom_command(
TARGET ${NANOCLR_PROJECT_NAME}.elf POST_BUILD
COMMAND ${output_idf_size}
--archives --target ${TARGET_SERIES_SHORT} ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.map
COMMENT "Ouptut IDF size summary")
--archives ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.map
COMMENT "Output IDF size summary")

endmacro()

Expand Down
4 changes: 2 additions & 2 deletions CMake/xtensa-esp32c3.json → CMake/riscv-esp32c3.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
],
"configurePresets": [
{
"name": "xtensa-esp32c3-preset",
"name": "riscv-esp32c3-preset",
"description": "Preset for ESP32-C3 series",
"inherits": "general-preset",
"hidden": true,
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": {
"type": "FILEPATH",
"value": "${sourceDir}/CMake/toolchain.riscv32-esp-elf.cmake"
"value": "${sourceDir}/CMake/toolchain.riscv32-esp32c3-elf.cmake"
},
"NF_INTEROP_ASSEMBLIES": null,
"NF_TARGET_HAS_NANOBOOTER": "OFF",
Expand Down
6 changes: 3 additions & 3 deletions CMake/xtensa-esp32c6.json → CMake/riscv-esp32c6.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
],
"configurePresets": [
{
"name": "xtensa-esp32c6-preset",
"name": "riscv-esp32c6-preset",
"description": "Preset for ESP32-C6 series",
"inherits": "general-preset",
"hidden": true,
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": {
"type": "FILEPATH",
"value": "${sourceDir}/CMake/toolchain.riscv32-esp-elf.cmake"
"value": "${sourceDir}/CMake/toolchain.riscv32-esp32c6-elf.cmake"
},
"NF_INTEROP_ASSEMBLIES": null,
"NF_TARGET_HAS_NANOBOOTER": "OFF",
Expand All @@ -25,7 +25,7 @@
"SUPPORT_ANY_BASE_CONVERSION": "ON",
"API_System.Net": "ON",
"API_System.Math": "ON",
"API_System.Device.Adc": "ON",
"API_System.Device.Adc": "OFF",
"API_System.Device.Gpio": "ON",
"API_System.Device.I2c": "ON",
"API_System.Device.I2c.Slave": "ON",
Expand Down
Loading
Loading