@@ -151,6 +151,7 @@ macro(nf_fix_esp32c3_rom_file)
151
151
152
152
endmacro ()
153
153
154
+
154
155
# setting compile definitions for a target based on general build options
155
156
# TARGET parameter to set the target that's setting them for
156
157
# optional EXTRA_COMPILE_DEFINITIONS with compiler definitions to be added to the library
@@ -184,7 +185,7 @@ function(nf_set_esp32_target_series)
184
185
set (TARGET_SERIES_SHORT ${TARGET_SERIES_2} CACHE INTERNAL "ESP32 target series lower case, short version" )
185
186
186
187
# 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" )
188
189
set (ESP32_CPU_TYPE "riscv" CACHE INTERNAL "Setting CPU type" )
189
190
else ()
190
191
set (ESP32_CPU_TYPE "xtensa" CACHE INTERNAL "Setting CPU type" )
@@ -466,8 +467,10 @@ macro(nf_setup_partition_tables_generator)
466
467
467
468
if (${TARGET_SERIES_SHORT} STREQUAL "esp32" OR
468
469
${TARGET_SERIES_SHORT} STREQUAL "esp32c3" OR
470
+ ${TARGET_SERIES_SHORT} STREQUAL "esp32c5" OR
469
471
${TARGET_SERIES_SHORT} STREQUAL "esp32c6" OR
470
472
${TARGET_SERIES_SHORT} STREQUAL "esp32h2" OR
473
+ ${TARGET_SERIES_SHORT} STREQUAL "esp32p4" OR
471
474
${TARGET_SERIES_SHORT} STREQUAL "esp32s2" OR
472
475
${TARGET_SERIES_SHORT} STREQUAL "esp32s3" )
473
476
@@ -481,7 +484,9 @@ macro(nf_setup_partition_tables_generator)
481
484
endif ()
482
485
483
486
if (${TARGET_SERIES_SHORT} STREQUAL "esp32" OR
487
+ ${TARGET_SERIES_SHORT} STREQUAL "esp32c5" OR
484
488
${TARGET_SERIES_SHORT} STREQUAL "esp32c6" OR
489
+ ${TARGET_SERIES_SHORT} STREQUAL "esp32p4" OR
485
490
${TARGET_SERIES_SHORT} STREQUAL "esp32s2" OR
486
491
${TARGET_SERIES_SHORT} STREQUAL "esp32s3" )
487
492
@@ -501,7 +506,8 @@ macro(nf_setup_partition_tables_generator)
501
506
502
507
endif ()
503
508
504
- if (${TARGET_SERIES_SHORT} STREQUAL "esp32s3" )
509
+ if (${TARGET_SERIES_SHORT} STREQUAL "esp32s3" OR
510
+ ${TARGET_SERIES_SHORT} STREQUAL "esp32p4" )
505
511
506
512
# 32MB partition table for ESP32_S3
507
513
add_custom_command ( TARGET ${NANOCLR_PROJECT_NAME} .elf POST_BUILD
@@ -594,11 +600,16 @@ macro(nf_add_idf_as_library)
594
600
# Load any required Components from Component registry
595
601
# Must be done before "tools/cmake/idf.cmake"
596
602
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 )
599
605
endif ()
600
606
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 ()
602
613
603
614
include (${IDF_PATH_CMAKED} /tools/cmake/idf.cmake)
604
615
@@ -611,6 +622,7 @@ macro(nf_add_idf_as_library)
611
622
message (FATAL_ERROR "Couldn't get IDF version from target __idf_build_target" )
612
623
endif ()
613
624
625
+ message (STATUS "ESP_IDF_VERSION: $ENV{ESP_IDF_VERSION} " )
614
626
message (STATUS "Current IDF version is: ${MY_IDF_VER} " )
615
627
616
628
string (FIND ${MY_IDF_VER} "-dirty" MY_IDF_VER_DIRTY)
@@ -670,7 +682,6 @@ macro(nf_add_idf_as_library)
670
682
freertos
671
683
esptool_py
672
684
fatfs
673
- esp_wifi
674
685
esp_event
675
686
vfs
676
687
esp_netif
@@ -686,7 +697,6 @@ macro(nf_add_idf_as_library)
686
697
idf::freertos
687
698
idf::esptool_py
688
699
idf::fatfs
689
- idf::esp_wifi
690
700
idf::esp_event
691
701
idf::vfs
692
702
idf::esp_netif
@@ -695,6 +705,17 @@ macro(nf_add_idf_as_library)
695
705
idf::littlefs
696
706
)
697
707
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
+
698
719
if (HAL_USE_BLE_OPTION)
699
720
list (APPEND IDF_COMPONENTS_TO_ADD bt)
700
721
list (APPEND IDF_LIBRARIES_TO_ADD idf::bt)
@@ -1035,8 +1056,8 @@ macro(nf_add_idf_as_library)
1035
1056
add_custom_command (
1036
1057
TARGET ${NANOCLR_PROJECT_NAME} .elf POST_BUILD
1037
1058
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" )
1040
1061
1041
1062
endmacro ()
1042
1063
0 commit comments