diff --git a/Kconfig b/Kconfig index 99c7a7dc07..a71e3179a2 100644 --- a/Kconfig +++ b/Kconfig @@ -114,6 +114,13 @@ mainmenu "Espressif IoT Development Framework Configuration" select FREERTOS_UNICORE select IDF_TARGET_ARCH_RISCV + config IDF_TARGET_ESP32C5 + bool + default "y" if IDF_TARGET="esp32c5" + select FREERTOS_UNICORE + select IDF_TARGET_ARCH_RISCV + select IDF_ENV_BRINGUP + config IDF_TARGET_ESP32P4 bool default "y" if IDF_TARGET="esp32p4" @@ -139,6 +146,7 @@ mainmenu "Espressif IoT Development Framework Configuration" default 0x000D if IDF_TARGET_ESP32C6 default 0x0010 if IDF_TARGET_ESP32H2 default 0x0012 if IDF_TARGET_ESP32P4 + default 0x0013 if IDF_TARGET_ESP32C5 default 0xFFFF diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c5.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c5.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/bootloader_support/include/esp_app_format.h b/components/bootloader_support/include/esp_app_format.h index 33990e65cd..e4df425b46 100644 --- a/components/bootloader_support/include/esp_app_format.h +++ b/components/bootloader_support/include/esp_app_format.h @@ -21,6 +21,7 @@ typedef enum { ESP_CHIP_ID_ESP32C6 = 0x000D, /*!< chip ID: ESP32-C6 */ ESP_CHIP_ID_ESP32H2 = 0x0010, /*!< chip ID: ESP32-H2 */ ESP_CHIP_ID_ESP32P4 = 0x0012, /*!< chip ID: ESP32-P4 */ + ESP_CHIP_ID_ESP32C5 = 0x0013, /*!< chip ID: ESP32-C5 */ ESP_CHIP_ID_INVALID = 0xFFFF /*!< Invalid chip ID (we defined it to make sure the esp_chip_id_t is 2 bytes size) */ } __attribute__((packed)) esp_chip_id_t; diff --git a/components/bootloader_support/src/bootloader_random_esp32c5.c b/components/bootloader_support/src/bootloader_random_esp32c5.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/bt/controller/esp32c5/Kconfig.in b/components/bt/controller/esp32c5/Kconfig.in new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_adc/esp32c5/include/.gitkeep b/components/esp_adc/esp32c5/include/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_hw_support/include/esp_chip_info.h b/components/esp_hw_support/include/esp_chip_info.h index a4509f5b0e..3922c0aeb6 100644 --- a/components/esp_hw_support/include/esp_chip_info.h +++ b/components/esp_hw_support/include/esp_chip_info.h @@ -28,6 +28,7 @@ typedef enum { CHIP_ESP32C6 = 13, //!< ESP32-C6 CHIP_ESP32H2 = 16, //!< ESP32-H2 CHIP_ESP32P4 = 18, //!< ESP32-P4 + CHIP_ESP32C5 = 19, //!< ESP32-C5 CHIP_POSIX_LINUX = 999, //!< The code is running on POSIX/Linux simulator } esp_chip_model_t; diff --git a/components/esp_hw_support/include/soc/esp32c5/.gitkeep b/components/esp_hw_support/include/soc/esp32c5/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_hw_support/port/esp32c5/CMakeLists.txt b/components/esp_hw_support/port/esp32c5/CMakeLists.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_hw_support/port/esp32c5/cpu_region_protect.c b/components/esp_hw_support/port/esp32c5/cpu_region_protect.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_hw_support/port/esp32c5/esp_clk_tree.c b/components/esp_hw_support/port/esp32c5/esp_clk_tree.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_hw_support/port/esp32c5/io_mux.c b/components/esp_hw_support/port/esp32c5/io_mux.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_mm/port/esp32c5/ext_mem_layout.c b/components/esp_mm/port/esp32c5/ext_mem_layout.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_phy/esp32c5/include/.gitkeep b/components/esp_phy/esp32c5/include/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_rom/esp32c5/.gitkeep b/components/esp_rom/esp32c5/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_rom/include/esp32c5/rom/.gitkeep b/components/esp_rom/include/esp32c5/rom/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_system/ld/esp32c5/memory.ld.in b/components/esp_system/ld/esp32c5/memory.ld.in new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_system/port/soc/esp32c5/CMakeLists.txt b/components/esp_system/port/soc/esp32c5/CMakeLists.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_system/port/soc/esp32c5/Kconfig.cpu b/components/esp_system/port/soc/esp32c5/Kconfig.cpu new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_system/port/soc/esp32c5/Kconfig.system b/components/esp_system/port/soc/esp32c5/Kconfig.system new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/hal/esp32c5/include/.gitkeep b/components/hal/esp32c5/include/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/heap/port/esp32c5/memory_layout.c b/components/heap/port/esp32c5/memory_layout.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/idf_test/include/esp32c5/.gitkeep b/components/idf_test/include/esp32c5/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/soc/esp32c5/gpio_periph.c b/components/soc/esp32c5/gpio_periph.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/soc/esp32c5/interrupts.c b/components/soc/esp32c5/interrupts.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/soc/esp32c5/uart_periph.c b/components/soc/esp32c5/uart_periph.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/examples/system/.build-test-rules.yml b/examples/system/.build-test-rules.yml index 9811ec8e62..485c742537 100644 --- a/examples/system/.build-test-rules.yml +++ b/examples/system/.build-test-rules.yml @@ -54,8 +54,8 @@ examples/system/deep_sleep_wake_stub: reason: target(s) is not supported yet examples/system/efuse: - enable: - - if: IDF_TARGET == "esp32" or (NIGHTLY_RUN == "1" and IDF_TARGET != "linux") + disable: + - if: IDF_TARGET != "esp32" and (NIGHTLY_RUN != "1" or IDF_TARGET == "linux") reason: no target specific functionality, testing on a single target is sufficient depends_components: - efuse @@ -74,11 +74,9 @@ examples/system/esp_timer: - esp_timer examples/system/eventfd: - enable: - - if: IDF_TARGET == "esp32" or (NIGHTLY_RUN == "1" and IDF_TARGET != "linux") - reason: no target specific functionality, testing on a single target is sufficient disable: - - if: SOC_GPTIMER_SUPPORTED != 1 + - if: SOC_GPTIMER_SUPPORTED != 1 and (IDF_TARGET != "esp32" and (NIGHTLY_RUN != "1" or IDF_TARGET == "linux")) + reason: no target specific functionality, testing on a single target is sufficient depends_components: - vfs - esp_driver_gptimer @@ -90,8 +88,8 @@ examples/system/flash_suspend: reason: the other targets are not tested yet examples/system/freertos: - enable: - - if: IDF_TARGET == "esp32" or (NIGHTLY_RUN == "1" and IDF_TARGET != "linux") + disable: + - if: IDF_TARGET != "esp32" and (NIGHTLY_RUN != "1" or IDF_TARGET == "linux") reason: no target specific functionality, testing on a single target is sufficient depends_components: - freertos @@ -109,8 +107,8 @@ examples/system/gdbstub: reason: not supported yet #TODO: IDF-7510 examples/system/heap_task_tracking: - enable: - - if: IDF_TARGET == "esp32c3" or (NIGHTLY_RUN == "1" and IDF_TARGET != "linux") + disable: + - if: IDF_TARGET != "esp32c3" and (NIGHTLY_RUN != "1" or IDF_TARGET == "linux") reason: no target specific functionality, testing on a single target is sufficient depends_components: - heap @@ -201,15 +199,15 @@ examples/system/perfmon: - perfmon examples/system/pthread: - enable: - - if: IDF_TARGET == "esp32" or (NIGHTLY_RUN == "1" and IDF_TARGET != "linux") + disable: + - if: IDF_TARGET != "esp32" and (NIGHTLY_RUN != "1" or IDF_TARGET == "linux") reason: no target specific functionality, testing on a single target is sufficient depends_components: - pthread examples/system/select: - enable: - - if: IDF_TARGET == "esp32c3" or (NIGHTLY_RUN == "1" and IDF_TARGET != "linux") + disable: + - if: IDF_TARGET != "esp32c3" and (NIGHTLY_RUN != "1" or IDF_TARGET == "linux") reason: no target specific functionality, testing on a single target is sufficient depends_components: - vfs @@ -237,8 +235,8 @@ examples/system/sysview_tracing_heap_log: reason: lack of runners examples/system/task_watchdog: - enable: - - if: IDF_TARGET == "esp32" or (NIGHTLY_RUN == "1" and IDF_TARGET != "linux") + disable: + - if: IDF_TARGET != "esp32" and (NIGHTLY_RUN != "1" or IDF_TARGET == "linux") reason: no target specific functionality, testing on a single target is sufficient depends_components: - esp_system @@ -326,8 +324,8 @@ examples/system/ulp/ulp_riscv/uart_print: - ulp examples/system/unit_test/: - enable: - - if: IDF_TARGET == "esp32" or (NIGHTLY_RUN == "1" and IDF_TARGET != "linux") + disable: + - if: IDF_TARGET != "esp32" and (NIGHTLY_RUN != "1" or IDF_TARGET == "linux") reason: no target specific functionality, testing on a single target is sufficient depends_components: - unity diff --git a/tools/ci/check_build_test_rules.py b/tools/ci/check_build_test_rules.py index 080ce2ad55..f204f0702a 100755 --- a/tools/ci/check_build_test_rules.py +++ b/tools/ci/check_build_test_rules.py @@ -31,6 +31,7 @@ USUAL_TO_FORMAL = { 'esp32c3': 'ESP32-C3', 'esp32c2': 'ESP32-C2', 'esp32c6': 'ESP32-C6', + 'esp32c5': 'ESP32-C5', 'esp32h2': 'ESP32-H2', 'esp32p4': 'ESP32-P4', 'linux': 'Linux', @@ -43,6 +44,7 @@ FORMAL_TO_USUAL = { 'ESP32-C3': 'esp32c3', 'ESP32-C2': 'esp32c2', 'ESP32-C6': 'esp32c6', + 'ESP32-C5': 'esp32c5', 'ESP32-H2': 'esp32h2', 'ESP32-P4': 'esp32p4', 'Linux': 'linux', diff --git a/tools/cmake/dfu.cmake b/tools/cmake/dfu.cmake index ead9bac1e1..4f58cd283d 100644 --- a/tools/cmake/dfu.cmake +++ b/tools/cmake/dfu.cmake @@ -15,6 +15,8 @@ function(__add_dfu_targets) return() elseif("${target}" STREQUAL "esp32c6") return() + elseif("${target}" STREQUAL "esp32c5") + return() elseif("${target}" STREQUAL "esp32h2") return() elseif("${target}" STREQUAL "esp32p4") diff --git a/tools/cmake/toolchain-esp32c5.cmake b/tools/cmake/toolchain-esp32c5.cmake new file mode 100644 index 0000000000..6415daa59b --- /dev/null +++ b/tools/cmake/toolchain-esp32c5.cmake @@ -0,0 +1,18 @@ +include($ENV{IDF_PATH}/tools/cmake/utilities.cmake) + +set(CMAKE_SYSTEM_NAME Generic) + +set(CMAKE_C_COMPILER riscv32-esp-elf-gcc) +set(CMAKE_CXX_COMPILER riscv32-esp-elf-g++) +set(CMAKE_ASM_COMPILER riscv32-esp-elf-gcc) +set(_CMAKE_TOOLCHAIN_PREFIX riscv32-esp-elf-) + +remove_duplicated_flags("-march=rv32imac_zicsr_zifencei ${CMAKE_C_FLAGS}" UNIQ_CMAKE_C_FLAGS) +set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" CACHE STRING "C Compiler Base Flags" FORCE) +remove_duplicated_flags("-march=rv32imac_zicsr_zifencei ${CMAKE_CXX_FLAGS}" UNIQ_CMAKE_CXX_FLAGS) +set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" CACHE STRING "C++ Compiler Base Flags" FORCE) + +remove_duplicated_flags("-nostartfiles -march=rv32imac_zicsr_zifencei --specs=nosys.specs \ + ${CMAKE_EXE_LINKER_FLAGS}" + UNIQ_CMAKE_SAFE_EXE_LINKER_FLAGS) +set(CMAKE_EXE_LINKER_FLAGS "${UNIQ_CMAKE_SAFE_EXE_LINKER_FLAGS}" CACHE STRING "Linker Base Flags" FORCE) diff --git a/tools/idf_py_actions/constants.py b/tools/idf_py_actions/constants.py index 42d5cbe0d9..6a7835835e 100644 --- a/tools/idf_py_actions/constants.py +++ b/tools/idf_py_actions/constants.py @@ -33,7 +33,7 @@ if os.name != 'nt': URL_TO_DOC = 'https://docs.espressif.com/projects/esp-idf' SUPPORTED_TARGETS = ['esp32', 'esp32s2', 'esp32c3', 'esp32s3', 'esp32c2', 'esp32c6', 'esp32h2'] -PREVIEW_TARGETS = ['linux', 'esp32p4'] +PREVIEW_TARGETS = ['linux', 'esp32p4', 'esp32c5'] OPENOCD_TAGET_CONFIG_DEFAULT = '-f interface/ftdi/esp32_devkitj_v1.cfg -f target/{target}.cfg' OPENOCD_TAGET_CONFIG: Dict[str, str] = { @@ -42,5 +42,6 @@ OPENOCD_TAGET_CONFIG: Dict[str, str] = { 'esp32c3': '-f board/esp32c3-builtin.cfg', 'esp32s3': '-f board/esp32s3-builtin.cfg', 'esp32c6': '-f board/esp32c6-builtin.cfg', + 'esp32c5': '-f board/esp32c5-builtin.cfg', 'esp32h2': '-f board/esp32h2-builtin.cfg', } diff --git a/tools/tools.json b/tools/tools.json index beb41c9d03..b1f28e2ca2 100644 --- a/tools/tools.json +++ b/tools/tools.json @@ -92,6 +92,7 @@ "esp32c3", "esp32c2", "esp32c6", + "esp32c5", "esp32h2", "esp32p4" ], @@ -247,6 +248,7 @@ "esp32c3", "esp32c2", "esp32c6", + "esp32c5", "esp32h2" ], "version_cmd": [ @@ -311,6 +313,7 @@ "esp32c3", "esp32c2", "esp32c6", + "esp32c5", "esp32h2" ], "version_cmd": [