@@ -151,6 +151,7 @@ macro(nf_fix_esp32c3_rom_file)
151151
152152endmacro ()
153153
154+
154155# setting compile definitions for a target based on general build options
155156# TARGET parameter to set the target that's setting them for
156157# optional EXTRA_COMPILE_DEFINITIONS with compiler definitions to be added to the library
@@ -184,7 +185,7 @@ function(nf_set_esp32_target_series)
184185 set (TARGET_SERIES_SHORT ${TARGET_SERIES_2} CACHE INTERNAL "ESP32 target series lower case, short version" )
185186
186187 # set the CPU type
187- if (${TARGET_SERIES_SHORT} STREQUAL "esp32c3" OR ${TARGET_SERIES_SHORT} STREQUAL "esp32c6" OR ${TARGET_SERIES_SHORT} STREQUAL "esp32h2" )
188+ if (${TARGET_SERIES_SHORT} STREQUAL "esp32c3" OR ${TARGET_SERIES_SHORT} STREQUAL "esp32c5" OR ${TARGET_SERIES_SHORT} STREQUAL " esp32c6" OR ${TARGET_SERIES_SHORT} STREQUAL "esp32h2" OR ${TARGET_SERIES_SHORT} STREQUAL "esp32p4" )
188189 set (ESP32_CPU_TYPE "riscv" CACHE INTERNAL "Setting CPU type" )
189190 else ()
190191 set (ESP32_CPU_TYPE "xtensa" CACHE INTERNAL "Setting CPU type" )
@@ -466,8 +467,10 @@ macro(nf_setup_partition_tables_generator)
466467
467468 if (${TARGET_SERIES_SHORT} STREQUAL "esp32" OR
468469 ${TARGET_SERIES_SHORT} STREQUAL "esp32c3" OR
470+ ${TARGET_SERIES_SHORT} STREQUAL "esp32c5" OR
469471 ${TARGET_SERIES_SHORT} STREQUAL "esp32c6" OR
470472 ${TARGET_SERIES_SHORT} STREQUAL "esp32h2" OR
473+ ${TARGET_SERIES_SHORT} STREQUAL "esp32p4" OR
471474 ${TARGET_SERIES_SHORT} STREQUAL "esp32s2" OR
472475 ${TARGET_SERIES_SHORT} STREQUAL "esp32s3" )
473476
@@ -481,7 +484,9 @@ macro(nf_setup_partition_tables_generator)
481484 endif ()
482485
483486 if (${TARGET_SERIES_SHORT} STREQUAL "esp32" OR
487+ ${TARGET_SERIES_SHORT} STREQUAL "esp32c5" OR
484488 ${TARGET_SERIES_SHORT} STREQUAL "esp32c6" OR
489+ ${TARGET_SERIES_SHORT} STREQUAL "esp32p4" OR
485490 ${TARGET_SERIES_SHORT} STREQUAL "esp32s2" OR
486491 ${TARGET_SERIES_SHORT} STREQUAL "esp32s3" )
487492
@@ -501,7 +506,8 @@ macro(nf_setup_partition_tables_generator)
501506
502507 endif ()
503508
504- if (${TARGET_SERIES_SHORT} STREQUAL "esp32s3" )
509+ if (${TARGET_SERIES_SHORT} STREQUAL "esp32s3" OR
510+ ${TARGET_SERIES_SHORT} STREQUAL "esp32p4" )
505511
506512 # 32MB partition table for ESP32_S3
507513 add_custom_command ( TARGET ${NANOCLR_PROJECT_NAME} .elf POST_BUILD
@@ -594,11 +600,16 @@ macro(nf_add_idf_as_library)
594600 # Load any required Components from Component registry
595601 # Must be done before "tools/cmake/idf.cmake"
596602 if (ESP32_USB_CDC)
597- nf_install_idf_component_from_registry(tinyusb 55142eec-a3a4-47a5-ad01-4ba3ef44444b )
598- nf_install_idf_component_from_registry(esp_tinyusb 8115ffc9-366a-4340-94ab-e327aed20831 )
603+ nf_install_idf_component_from_registry(tinyusb c384401d-144d-453d-a821-20f1ba0a7be1 )
604+ nf_install_idf_component_from_registry(esp_tinyusb 47b2b1fc-fb7e-4acf-943b-a14125e0f1e7 )
599605 endif ()
600606
601- nf_install_idf_component_from_registry(littlefs 4831aa41-8b72-48ac-a534-910a985a5519)
607+ nf_install_idf_component_from_registry(littlefs 288ff2e7-dfd9-4833-9be5-6e9d37d29880)
608+
609+ if (${TARGET_SERIES_SHORT} STREQUAL "esp32p4" )
610+ nf_install_idf_component_from_registry(esp_wifi_remote 3355c7e4-03ac-44a2-b100-1cbb29a05d03)
611+ nf_install_idf_component_from_registry(esp_hosted 9fb39051-7a32-4fbf-83e9-a4b54ab6fae5)
612+ endif ()
602613
603614 include (${IDF_PATH_CMAKED} /tools/cmake/idf.cmake)
604615
@@ -611,6 +622,7 @@ macro(nf_add_idf_as_library)
611622 message (FATAL_ERROR "Couldn't get IDF version from target __idf_build_target" )
612623 endif ()
613624
625+ message (STATUS "ESP_IDF_VERSION: $ENV{ESP_IDF_VERSION} " )
614626 message (STATUS "Current IDF version is: ${MY_IDF_VER} " )
615627
616628 string (FIND ${MY_IDF_VER} "-dirty" MY_IDF_VER_DIRTY)
@@ -670,7 +682,6 @@ macro(nf_add_idf_as_library)
670682 freertos
671683 esptool_py
672684 fatfs
673- esp_wifi
674685 esp_event
675686 vfs
676687 esp_netif
@@ -686,7 +697,6 @@ macro(nf_add_idf_as_library)
686697 idf::freertos
687698 idf::esptool_py
688699 idf::fatfs
689- idf::esp_wifi
690700 idf::esp_event
691701 idf::vfs
692702 idf::esp_netif
@@ -695,6 +705,17 @@ macro(nf_add_idf_as_library)
695705 idf::littlefs
696706 )
697707
708+ # Needed for remote Wifi module on P4 boards
709+ if (${TARGET_SERIES_SHORT} STREQUAL "esp32p4" )
710+ list (APPEND IDF_COMPONENTS_TO_ADD esp_wifi_remote)
711+ list (APPEND IDF_COMPONENTS_TO_ADD esp_hosted)
712+ list (APPEND IDF_LIBRARIES_TO_ADD idf::esp_hosted)
713+ list (APPEND IDF_LIBRARIES_TO_ADD idf::esp_wifi_remote)
714+ else ()
715+ list (APPEND IDF_COMPONENTS_TO_ADD esp_wifi)
716+ list (APPEND IDF_LIBRARIES_TO_ADD idf::esp_wifi)
717+ endif ()
718+
698719 if (HAL_USE_BLE_OPTION)
699720 list (APPEND IDF_COMPONENTS_TO_ADD bt)
700721 list (APPEND IDF_LIBRARIES_TO_ADD idf::bt)
@@ -1035,8 +1056,8 @@ macro(nf_add_idf_as_library)
10351056 add_custom_command (
10361057 TARGET ${NANOCLR_PROJECT_NAME} .elf POST_BUILD
10371058 COMMAND ${output_idf_size}
1038- --archives -- target ${TARGET_SERIES_SHORT} ${CMAKE_BINARY_DIR} /${CMAKE_PROJECT_NAME} .map
1039- COMMENT "Ouptut IDF size summary" )
1059+ --archives ${CMAKE_BINARY_DIR} /${CMAKE_PROJECT_NAME} .map
1060+ COMMENT "Output IDF size summary" )
10401061
10411062endmacro ()
10421063
0 commit comments