From 3247f667839527441b34eea4f0b15ecda2bcb3b8 Mon Sep 17 00:00:00 2001 From: Krzysztof Date: Thu, 7 Oct 2021 19:49:58 +0800 Subject: [PATCH] tools: update ttfw to support ESP32-H2 and ESP32-C6 chips --- tools/ci/check_copyright_ignore.txt | 2 -- tools/ci/python_packages/ttfw_idf/IDFDUT.py | 35 +++++++++++-------- tools/ci/python_packages/ttfw_idf/__init__.py | 22 ++++-------- 3 files changed, 28 insertions(+), 31 deletions(-) diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index dec0ee5cd2..31c77eacdd 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/tools/ci/check_copyright_ignore.txt @@ -3935,8 +3935,6 @@ tools/ci/python_packages/ttfw_idf/CIScanTests.py tools/ci/python_packages/ttfw_idf/DebugUtils.py tools/ci/python_packages/ttfw_idf/IDFApp.py tools/ci/python_packages/ttfw_idf/IDFAssignTest.py -tools/ci/python_packages/ttfw_idf/IDFDUT.py -tools/ci/python_packages/ttfw_idf/__init__.py tools/ci/python_packages/ttfw_idf/unity_test_parser.py tools/ci/python_packages/wifi_tools.py tools/ci/test_autocomplete.py diff --git a/tools/ci/python_packages/ttfw_idf/IDFDUT.py b/tools/ci/python_packages/ttfw_idf/IDFDUT.py index 13a8b0977b..9accca56b9 100644 --- a/tools/ci/python_packages/ttfw_idf/IDFDUT.py +++ b/tools/ci/python_packages/ttfw_idf/IDFDUT.py @@ -1,16 +1,5 @@ -# Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http:#www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD +# SPDX-License-Identifier: Apache-2.0 """ DUT for IDF applications """ import collections @@ -611,6 +600,24 @@ class ESP32C3DUT(IDFDUT): return esptool.ESP32C3ROM +class ESP32C6DUT(IDFDUT): + TARGET = 'esp32c6' + TOOLCHAIN_PREFIX = 'riscv32-esp-elf-' + + @classmethod + def get_rom(cls): + return esptool.ESP32C6BETAROM + + +class ESP32H2DUT(IDFDUT): + TARGET = 'esp32h2' + TOOLCHAIN_PREFIX = 'riscv32-esp-elf-' + + @classmethod + def get_rom(cls): + return esptool.ESP32H2ROM + + class ESP8266DUT(IDFDUT): TARGET = 'esp8266' TOOLCHAIN_PREFIX = 'xtensa-lx106-elf-' @@ -621,7 +628,7 @@ class ESP8266DUT(IDFDUT): def get_target_by_rom_class(cls): - for c in [ESP32DUT, ESP32S2DUT, ESP32S3DUT, ESP32C3DUT, ESP8266DUT, IDFQEMUDUT]: + for c in [ESP32DUT, ESP32S2DUT, ESP32S3DUT, ESP32C3DUT, ESP32C6DUT, ESP32H2DUT, ESP8266DUT, IDFQEMUDUT]: if c.get_rom() == cls: return c.TARGET return None diff --git a/tools/ci/python_packages/ttfw_idf/__init__.py b/tools/ci/python_packages/ttfw_idf/__init__.py index 8a7daaa12b..a8e380b7a6 100644 --- a/tools/ci/python_packages/ttfw_idf/__init__.py +++ b/tools/ci/python_packages/ttfw_idf/__init__.py @@ -1,16 +1,6 @@ -# Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http:#www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD +# SPDX-License-Identifier: Apache-2.0 + import functools import json import logging @@ -24,8 +14,8 @@ from tiny_test_fw import TinyFW, Utility from .DebugUtils import CustomProcess, GDBBackend, OCDBackend # noqa: export DebugUtils for users from .IDFApp import UT, ComponentUTApp, Example, IDFApp, LoadableElfTestApp, TestApp # noqa: export all Apps for users -from .IDFDUT import (ESP32C3DUT, ESP32C3FPGADUT, ESP32DUT, ESP32QEMUDUT, ESP32S2DUT, # noqa: export DUTs for users - ESP32S3DUT, ESP32S3FPGADUT, ESP8266DUT, IDFDUT) +from .IDFDUT import (ESP32C3DUT, ESP32C3FPGADUT, ESP32C6DUT, ESP32DUT, ESP32H2DUT, # noqa: export DUTs for users + ESP32QEMUDUT, ESP32S2DUT, ESP32S3DUT, ESP32S3FPGADUT, ESP8266DUT, IDFDUT) from .unity_test_parser import TestFormat, TestResults # pass TARGET_DUT_CLS_DICT to Env.py to avoid circular dependency issue. @@ -36,6 +26,8 @@ TARGET_DUT_CLS_DICT = { 'ESP32C3': ESP32C3DUT, 'ESP32C3FPGA': ESP32C3FPGADUT, 'ESP32S3FPGA': ESP32S3FPGADUT, + 'ESP32C6': ESP32C6DUT, + 'ESP32H2': ESP32H2DUT, }