global: add new target name: esp32-s3

add target name, chip ID, toochain descriptions for ESP32-S3
This commit is contained in:
morris 2020-01-15 21:50:19 +08:00
parent 625bd5eb18
commit 067b1b91c2
7 changed files with 37 additions and 3 deletions

View file

@ -11,6 +11,7 @@ mainmenu "Espressif IoT Development Framework Configuration"
config IDF_ENV_FPGA config IDF_ENV_FPGA
# This option is for internal use only # This option is for internal use only
bool bool
option env="IDF_ENV_FPGA"
config IDF_TARGET config IDF_TARGET
# This option records the IDF target when sdkconfig is generated the first time. # This option records the IDF target when sdkconfig is generated the first time.
@ -29,10 +30,16 @@ mainmenu "Espressif IoT Development Framework Configuration"
default "y" if IDF_TARGET="esp32s2" default "y" if IDF_TARGET="esp32s2"
select FREERTOS_UNICORE select FREERTOS_UNICORE
config IDF_TARGET_ESP32S3
bool
default "y" if IDF_TARGET="esp32s3"
select IDF_ENV_FPGA
config IDF_FIRMWARE_CHIP_ID config IDF_FIRMWARE_CHIP_ID
hex hex
default 0x0000 if IDF_TARGET_ESP32 default 0x0000 if IDF_TARGET_ESP32
default 0x0002 if IDF_TARGET_ESP32S2 default 0x0002 if IDF_TARGET_ESP32S2
default 0x0004 if IDF_TARGET_ESP32S3
default 0xFFFF default 0xFFFF
menu "SDK tool configuration" menu "SDK tool configuration"
@ -40,6 +47,7 @@ mainmenu "Espressif IoT Development Framework Configuration"
string "Compiler toolchain path/prefix" string "Compiler toolchain path/prefix"
default "xtensa-esp32-elf-" if IDF_TARGET_ESP32 default "xtensa-esp32-elf-" if IDF_TARGET_ESP32
default "xtensa-esp32s2-elf-" if IDF_TARGET_ESP32S2 default "xtensa-esp32s2-elf-" if IDF_TARGET_ESP32S2
default "xtensa-esp32s3-elf-" if IDF_TARGET_ESP32S3
help help
The prefix/path that is used to call the toolchain. The default setting assumes The prefix/path that is used to call the toolchain. The default setting assumes
a crosstool-ng gcc setup that is in your PATH. a crosstool-ng gcc setup that is in your PATH.

View file

@ -19,7 +19,8 @@
*/ */
typedef enum { typedef enum {
ESP_CHIP_ID_ESP32 = 0x0000, /*!< chip ID: ESP32 */ ESP_CHIP_ID_ESP32 = 0x0000, /*!< chip ID: ESP32 */
ESP_CHIP_ID_ESP32S2 = 0x0002, /*!< chip ID: ESP32S2 */ ESP_CHIP_ID_ESP32S2 = 0x0002, /*!< chip ID: ESP32-S2 */
ESP_CHIP_ID_ESP32S3 = 0x0004, /*!< chip ID: ESP32-S3 */
ESP_CHIP_ID_INVALID = 0xFFFF /*!< Invalid chip ID (we defined it to make sure the esp_chip_id_t is 2 bytes size) */ 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; } __attribute__((packed)) esp_chip_id_t;

View file

@ -251,6 +251,7 @@ void __attribute__((noreturn)) esp_system_abort(const char* details);
typedef enum { typedef enum {
CHIP_ESP32 = 1, //!< ESP32 CHIP_ESP32 = 1, //!< ESP32
CHIP_ESP32S2 = 2, //!< ESP32-S2 CHIP_ESP32S2 = 2, //!< ESP32-S2
CHIP_ESP32S3 = 4, //!< ESP32-S3
} esp_chip_model_t; } esp_chip_model_t;
/* Chip feature flags, used in esp_chip_info_t */ /* Chip feature flags, used in esp_chip_info_t */

View file

@ -7,6 +7,8 @@ function(__add_dfu_targets)
return() return()
elseif("${target}" STREQUAL "esp32s2") elseif("${target}" STREQUAL "esp32s2")
set(dfu_pid "2") set(dfu_pid "2")
elseif("${target}" STREQUAL "esp32s3")
set(dfu_pid "4")
else() else()
message(FATAL_ERROR "DFU PID unknown for ${target}") message(FATAL_ERROR "DFU PID unknown for ${target}")
endif() endif()

View file

@ -0,0 +1,8 @@
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_C_COMPILER xtensa-esp32s3-elf-gcc)
set(CMAKE_CXX_COMPILER xtensa-esp32s3-elf-g++)
set(CMAKE_ASM_COMPILER xtensa-esp32s3-elf-gcc)
set(CMAKE_C_FLAGS "-mlongcalls" CACHE STRING "C Compiler Base Flags")
set(CMAKE_CXX_FLAGS "-mlongcalls" CACHE STRING "C++ Compiler Base Flags")

View file

@ -37,3 +37,5 @@ GENERATORS = collections.OrderedDict([
]) ])
SUPPORTED_TARGETS = ["esp32", "esp32s2"] SUPPORTED_TARGETS = ["esp32", "esp32s2"]
PREVIEW_TARGETS = ["esp32s3"]

View file

@ -5,7 +5,7 @@ import sys
import click import click
from idf_py_actions.constants import GENERATORS, SUPPORTED_TARGETS from idf_py_actions.constants import GENERATORS, SUPPORTED_TARGETS, PREVIEW_TARGETS
from idf_py_actions.errors import FatalError from idf_py_actions.errors import FatalError
from idf_py_actions.global_options import global_options from idf_py_actions.global_options import global_options
from idf_py_actions.tools import ensure_build_directory, idf_version, merge_action_lists, realpath, run_target, TargetChoice from idf_py_actions.tools import ensure_build_directory, idf_version, merge_action_lists, realpath, run_target, TargetChoice
@ -122,6 +122,8 @@ def action_extensions(base_actions, project_path):
os.remove(f) os.remove(f)
def set_target(action, ctx, args, idf_target): def set_target(action, ctx, args, idf_target):
if(not args["preview"] and idf_target in PREVIEW_TARGETS):
raise FatalError("%s is still in preview. You have to append '--preview' option after idf.py to use any preview feature." % idf_target)
args.define_cache_entry.append("IDF_TARGET=" + idf_target) args.define_cache_entry.append("IDF_TARGET=" + idf_target)
sdkconfig_path = os.path.join(args.project_dir, 'sdkconfig') sdkconfig_path = os.path.join(args.project_dir, 'sdkconfig')
sdkconfig_old = sdkconfig_path + ".old" sdkconfig_old = sdkconfig_path + ".old"
@ -164,6 +166,10 @@ def action_extensions(base_actions, project_path):
for target in SUPPORTED_TARGETS: for target in SUPPORTED_TARGETS:
print(target) print(target)
if "preview" in ctx.params:
for target in PREVIEW_TARGETS:
print(target)
sys.exit(0) sys.exit(0)
root_options = { root_options = {
@ -208,6 +214,12 @@ def action_extensions(base_actions, project_path):
"default": False, "default": False,
"callback": verbose_callback "callback": verbose_callback
}, },
{
"names": ["--preview"],
"help": "Enable IDF features that are still in preview.",
"is_flag": True,
"default": False,
},
{ {
"names": ["--ccache/--no-ccache"], "names": ["--ccache/--no-ccache"],
"help": ( "help": (
@ -379,7 +391,7 @@ def action_extensions(base_actions, project_path):
{ {
"names": ["idf-target"], "names": ["idf-target"],
"nargs": 1, "nargs": 1,
"type": TargetChoice(SUPPORTED_TARGETS), "type": TargetChoice(SUPPORTED_TARGETS + PREVIEW_TARGETS),
}, },
], ],
"dependencies": ["fullclean"], "dependencies": ["fullclean"],