esp32h2: add esp32h2 build target

Add esp32h2 support in the following components:
 * Kconfig
 * components/esptool_py
 * components/riscv
 * components/xtensa
 * tools
This commit is contained in:
Shu Chen 2021-06-08 16:11:35 +08:00
parent 68f33b75de
commit 2b9e8fed71
11 changed files with 40 additions and 5 deletions

View File

@ -11,6 +11,7 @@ mainmenu "Espressif IoT Development Framework Configuration"
config IDF_ENV_FPGA
# This option is for internal use only
bool
default "y" if IDF_TARGET="esp32h2" # ESP32H2-TODO: IDF-3378
option env="IDF_ENV_FPGA"
config IDF_TARGET_ARCH_RISCV
@ -51,6 +52,12 @@ mainmenu "Espressif IoT Development Framework Configuration"
select FREERTOS_UNICORE
select IDF_TARGET_ARCH_RISCV
config IDF_TARGET_ESP32H2
bool
default "y" if IDF_TARGET="esp32h2"
select FREERTOS_UNICORE
select IDF_TARGET_ARCH_RISCV
config IDF_TARGET_LINUX
bool
default "y" if IDF_TARGET="linux"
@ -61,6 +68,7 @@ mainmenu "Espressif IoT Development Framework Configuration"
default 0x0002 if IDF_TARGET_ESP32S2
default 0x0005 if IDF_TARGET_ESP32C3
default 0x0009 if IDF_TARGET_ESP32S3
default 0x000A if IDF_TARGET_ESP32H2
default 0xFFFF
menu "SDK tool configuration"
@ -70,6 +78,7 @@ mainmenu "Espressif IoT Development Framework Configuration"
default "xtensa-esp32s2-elf-" if IDF_TARGET_ESP32S2
default "xtensa-esp32s3-elf-" if IDF_TARGET_ESP32S3
default "riscv32-esp-elf-" if IDF_TARGET_ESP32C3
default "riscv32-esp-elf-" if IDF_TARGET_ESP32H2
help
The prefix/path that is used to call the toolchain. The default setting assumes

View File

@ -56,6 +56,7 @@ menu "Serial flasher config"
config ESPTOOLPY_NO_STUB
bool "Disable download stub"
default "y" if IDF_TARGET_ESP32H2 # ESP32H2-TODO: IDF-3378
default "n"
help
The flasher tool sends a precompiled download stub first by default. That stub allows things
@ -117,7 +118,7 @@ menu "Serial flasher config"
choice ESPTOOLPY_FLASHFREQ
prompt "Flash SPI speed"
default ESPTOOLPY_FLASHFREQ_40M if IDF_TARGET_ESP32
default ESPTOOLPY_FLASHFREQ_40M if IDF_TARGET_ESP32 || IDF_TARGET_ESP32H2
default ESPTOOLPY_FLASHFREQ_80M
help
The SPI flash frequency to be used.

@ -1 +1 @@
Subproject commit 1c9fe7059738ecd8e2b77c66cf7e2be73e566c16
Subproject commit 46ead46242c57a0b0b137976dc55550225faefec

View File

@ -1,6 +1,6 @@
idf_build_get_property(target IDF_TARGET)
if(NOT "${target}" STREQUAL "esp32c3")
if(NOT "${target}" STREQUAL "esp32c3" AND NOT "${target}" STREQUAL "esp32h2" )
return()
endif()

View File

@ -1,6 +1,6 @@
idf_build_get_property(target IDF_TARGET)
if("${target}" STREQUAL "esp32c3")
if("${target}" STREQUAL "esp32c3" OR "${target}" STREQUAL "esp32h2")
return()
endif()

View File

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

View File

@ -0,0 +1,9 @@
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_C_FLAGS "-march=rv32imc" CACHE STRING "C Compiler Base Flags")
set(CMAKE_CXX_FLAGS "-march=rv32imc" CACHE STRING "C++ Compiler Base Flags")
set(CMAKE_EXE_LINKER_FLAGS "-nostartfiles -march=rv32imc --specs=nosys.specs" CACHE STRING "Linker Base Flags")

View File

@ -10,6 +10,8 @@ function(__add_uf2_targets)
set(uf2_family_id "0xd42ba06c")
elseif("${target}" STREQUAL "esp32s3")
set(uf2_family_id "0xc47e5767")
elseif("${target}" STREQUAL "esp32h2")
set(uf2_family_id "0xd42ba06c")
elseif("${target}" STREQUAL "linux")
return()
else()

View File

@ -295,6 +295,7 @@ class BuildSystem:
'ESP32-S2': 'esp32s2',
'ESP32-S3': 'esp32s3',
'ESP32-C3': 'esp32c3',
'ESP32-H2': 'esp32h2',
'Linux': 'linux',
}

View File

@ -36,6 +36,6 @@ GENERATORS = collections.OrderedDict([
})
])
SUPPORTED_TARGETS = ['esp32', 'esp32s2', 'esp32c3', 'esp32s3']
SUPPORTED_TARGETS = ['esp32', 'esp32s2', 'esp32c3', 'esp32s3', 'esp32h2']
PREVIEW_TARGETS = ['linux']

View File

@ -139,6 +139,17 @@ class MemRegions(object):
# Used by cache
MemRegDef(0x4037C000, 0x4000, MemRegions.IRAM_ID, 0),
])
elif target == 'esp32h2':
return sorted([
MemRegDef(0x3FC80000, 0x60000, MemRegions.DIRAM_ID, 0x40380000),
# MemRegDef(0x3FC80000, 0x20000, MemRegions.DIRAM_ID, 0x40380000),
# MemRegDef(0x3FCA0000, 0x20000, MemRegions.DIRAM_ID, 0x403A0000),
# MemRegDef(0x3FCC0000, 0x20000, MemRegions.DIRAM_ID, 0x403C0000),
# Used by cache
MemRegDef(0x4037C000, 0x4000, MemRegions.IRAM_ID, 0),
])
else:
return None