Merge branch 'feature/add_target_esp32p4' into 'master'

esp32p4: introduce the target

See merge request espressif/esp-idf!24155
This commit is contained in:
Armando (Dou Yiwen) 2023-06-14 10:16:44 +08:00
commit 17d6768e65
33 changed files with 40 additions and 2 deletions

View File

@ -90,6 +90,11 @@ mainmenu "Espressif IoT Development Framework Configuration"
select FREERTOS_UNICORE
select IDF_TARGET_ARCH_RISCV
config IDF_TARGET_ESP32P4
bool
default "y" if IDF_TARGET="esp32p4"
select IDF_TARGET_ARCH_RISCV
config IDF_TARGET_ESP32H2
bool
default "y" if IDF_TARGET="esp32h2"
@ -109,6 +114,7 @@ mainmenu "Espressif IoT Development Framework Configuration"
default 0x000C if IDF_TARGET_ESP32C2
default 0x000D if IDF_TARGET_ESP32C6
default 0x0010 if IDF_TARGET_ESP32H2
default 0x0012 if IDF_TARGET_ESP32P4
default 0xFFFF

View File

@ -20,6 +20,7 @@ typedef enum {
ESP_CHIP_ID_ESP32C2 = 0x000C, /*!< chip ID: ESP32-C2 */
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_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;

View File

@ -27,6 +27,7 @@ typedef enum {
CHIP_ESP32C2 = 12, //!< ESP32-C2
CHIP_ESP32C6 = 13, //!< ESP32-C6
CHIP_ESP32H2 = 16, //!< ESP32-H2
CHIP_ESP32P4 = 18, //!< ESP32-P4
CHIP_POSIX_LINUX = 999, //!< The code is running on POSIX/Linux simulator
} esp_chip_model_t;

View File

@ -1,5 +1,10 @@
idf_build_get_property(idf_target IDF_TARGET)
if(IDF_TARGET STREQUAL "esp32p4")
# TODO: IDF-7460
return()
endif()
set(srcs "src/phy_override.c" "src/lib_printf.c")
if(CONFIG_APP_NO_BLOBS)

View File

View File

View File

View File

View File

View File

View File

View File

@ -17,6 +17,8 @@ function(__add_dfu_targets)
return()
elseif("${target}" STREQUAL "esp32h2")
return()
elseif("${target}" STREQUAL "esp32p4")
set(dfu_pid "12")
elseif("${target}" STREQUAL "linux")
return()
else()

View File

@ -0,0 +1,20 @@
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=rv32imafc_zicsr_zifencei -mabi=ilp32f ${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=rv32imafc_zicsr_zifencei -mabi=ilp32f ${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("-march=rv32imafc_zicsr_zifencei -mabi=ilp32f ${CMAKE_ASM_FLAGS}" UNIQ_CMAKE_ASM_FLAGS)
set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" CACHE STRING "Asm Compiler Base Flags" FORCE)
remove_duplicated_flags("-nostartfiles -march=rv32imafc_zicsr_zifencei -mabi=ilp32f --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)

View File

@ -16,6 +16,8 @@ function(__add_uf2_targets)
set(uf2_family_id "0x2b88d29c")
elseif("${target}" STREQUAL "esp32c6") # TODO: IDF-5626
set(uf2_family_id "0x2b88d29c")
elseif("${target}" STREQUAL "esp32p4")
set(uf2_family_id "0x2b88d29c")
elseif("${target}" STREQUAL "linux")
return()
else()

View File

@ -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']
PREVIEW_TARGETS = ['linux', 'esp32p4']
OPENOCD_TAGET_CONFIG_DEFAULT = '-f interface/ftdi/esp32_devkitj_v1.cfg -f target/{target}.cfg'
OPENOCD_TAGET_CONFIG: Dict[str, str] = {

View File

@ -92,7 +92,8 @@
"esp32c3",
"esp32c2",
"esp32c6",
"esp32h2"
"esp32h2",
"esp32p4"
],
"version_cmd": [
"riscv32-esp-elf-gdb-no-python",