From 4e67332b741930b9cee1de2870a2b76542b6980d Mon Sep 17 00:00:00 2001 From: Cao Sen Miao Date: Thu, 29 Dec 2022 11:00:42 +0800 Subject: [PATCH] ESP32H2: Add small CI test for ESP32H2 --- .gitlab/ci/dependencies/dependencies.yml | 1 + .gitlab/ci/pre_check.yml | 1 + .gitlab/ci/rules.yml | 21 +++++++++++++++++++ .../cmake/idf_as_lib/CMakeLists.txt | 2 +- .../cmake/idf_as_lib/build-esp32h2.sh | 1 + .../cmake/idf_as_lib/run-esp32h2.sh | 1 + tools/ci/build_template_app.sh | 4 ++-- tools/ci/check_build_test_rules.py | 2 ++ tools/ci/test_build_system_cmake.sh | 2 +- tools/idf_size_yaml/esp32h2_data_info.yaml | 17 +++++++++++++++ tools/test_apps/.build-test-rules.yml | 2 +- ...config.ci.esp32h2_with_rom_impl_components | 5 +++++ ...fig.ci.esp32h2_without_rom_impl_components | 5 +++++ .../system/g0_components/CMakeLists.txt | 2 +- .../test_apps/system/g0_components/README.md | 4 ++-- tools/tools.json | 6 ++++-- 16 files changed, 66 insertions(+), 10 deletions(-) create mode 120000 examples/build_system/cmake/idf_as_lib/build-esp32h2.sh create mode 120000 examples/build_system/cmake/idf_as_lib/run-esp32h2.sh create mode 100644 tools/idf_size_yaml/esp32h2_data_info.yaml create mode 100644 tools/test_apps/system/build_test/sdkconfig.ci.esp32h2_with_rom_impl_components create mode 100644 tools/test_apps/system/build_test/sdkconfig.ci.esp32h2_without_rom_impl_components diff --git a/.gitlab/ci/dependencies/dependencies.yml b/.gitlab/ci/dependencies/dependencies.yml index 70447ee94d..4539b5c2ef 100644 --- a/.gitlab/ci/dependencies/dependencies.yml +++ b/.gitlab/ci/dependencies/dependencies.yml @@ -6,6 +6,7 @@ - esp32h4 - esp32c2 - esp32c6 + - esp32h2 .target_test: &target_test - example_test diff --git a/.gitlab/ci/pre_check.yml b/.gitlab/ci/pre_check.yml index cb811ea57a..55b2126141 100644 --- a/.gitlab/ci/pre_check.yml +++ b/.gitlab/ci/pre_check.yml @@ -93,6 +93,7 @@ check_public_headers: - IDF_TARGET=esp32c3 python tools/ci/check_public_headers.py --jobs 4 --prefix riscv32-esp-elf- - IDF_TARGET=esp32c2 python tools/ci/check_public_headers.py --jobs 4 --prefix riscv32-esp-elf- - IDF_TARGET=esp32c6 python tools/ci/check_public_headers.py --jobs 4 --prefix riscv32-esp-elf- + - IDF_TARGET=esp32h2 python tools/ci/check_public_headers.py --jobs 4 --prefix riscv32-esp-elf- check_chip_support_components: extends: diff --git a/.gitlab/ci/rules.yml b/.gitlab/ci/rules.yml index 2e46d30b02..8056783b16 100644 --- a/.gitlab/ci/rules.yml +++ b/.gitlab/ci/rules.yml @@ -394,6 +394,9 @@ .if-label-component_ut_esp32c6: &if-label-component_ut_esp32c6 if: '$BOT_LABEL_COMPONENT_UT_ESP32C6 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*component_ut_esp32c6(?:,[^,\n\r]+)*$/i' +.if-label-component_ut_esp32h2: &if-label-component_ut_esp32h2 + if: '$BOT_LABEL_COMPONENT_UT_ESP32H2 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*component_ut_esp32h2(?:,[^,\n\r]+)*$/i' + .if-label-component_ut_esp32h4: &if-label-component_ut_esp32h4 if: '$BOT_LABEL_COMPONENT_UT_ESP32H4 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*component_ut_esp32h4(?:,[^,\n\r]+)*$/i' @@ -418,6 +421,9 @@ .if-label-custom_test_esp32c6: &if-label-custom_test_esp32c6 if: '$BOT_LABEL_CUSTOM_TEST_ESP32C6 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*custom_test_esp32c6(?:,[^,\n\r]+)*$/i' +.if-label-custom_test_esp32h2: &if-label-custom_test_esp32h2 + if: '$BOT_LABEL_CUSTOM_TEST_ESP32H2 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*custom_test_esp32h2(?:,[^,\n\r]+)*$/i' + .if-label-custom_test_esp32h4: &if-label-custom_test_esp32h4 if: '$BOT_LABEL_CUSTOM_TEST_ESP32H4 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*custom_test_esp32h4(?:,[^,\n\r]+)*$/i' @@ -445,6 +451,9 @@ .if-label-example_test_esp32c6: &if-label-example_test_esp32c6 if: '$BOT_LABEL_EXAMPLE_TEST_ESP32C6 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*example_test_esp32c6(?:,[^,\n\r]+)*$/i' +.if-label-example_test_esp32h2: &if-label-example_test_esp32h2 + if: '$BOT_LABEL_EXAMPLE_TEST_ESP32H2 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*example_test_esp32h2(?:,[^,\n\r]+)*$/i' + .if-label-example_test_esp32h4: &if-label-example_test_esp32h4 if: '$BOT_LABEL_EXAMPLE_TEST_ESP32H4 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*example_test_esp32h4(?:,[^,\n\r]+)*$/i' @@ -505,6 +514,9 @@ .if-label-unit_test_esp32c6: &if-label-unit_test_esp32c6 if: '$BOT_LABEL_UNIT_TEST_ESP32C6 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*unit_test_esp32c6(?:,[^,\n\r]+)*$/i' +.if-label-unit_test_esp32h2: &if-label-unit_test_esp32h2 + if: '$BOT_LABEL_UNIT_TEST_ESP32H2 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*unit_test_esp32h2(?:,[^,\n\r]+)*$/i' + .if-label-unit_test_esp32h4: &if-label-unit_test_esp32h4 if: '$BOT_LABEL_UNIT_TEST_ESP32H4 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*unit_test_esp32h4(?:,[^,\n\r]+)*$/i' @@ -544,6 +556,7 @@ - <<: *if-label-component_ut_esp32c2 - <<: *if-label-component_ut_esp32c3 - <<: *if-label-component_ut_esp32c6 + - <<: *if-label-component_ut_esp32h2 - <<: *if-label-component_ut_esp32h4 - <<: *if-label-component_ut_esp32s2 - <<: *if-label-component_ut_esp32s3 @@ -554,6 +567,7 @@ - <<: *if-label-unit_test_esp32c2 - <<: *if-label-unit_test_esp32c3 - <<: *if-label-unit_test_esp32c6 + - <<: *if-label-unit_test_esp32h2 - <<: *if-label-unit_test_esp32h4 - <<: *if-label-unit_test_esp32s2 - <<: *if-label-unit_test_esp32s3 @@ -782,6 +796,7 @@ - <<: *if-label-custom_test_esp32c2 - <<: *if-label-custom_test_esp32c3 - <<: *if-label-custom_test_esp32c6 + - <<: *if-label-custom_test_esp32h2 - <<: *if-label-custom_test_esp32h4 - <<: *if-label-custom_test_esp32s2 - <<: *if-label-custom_test_esp32s3 @@ -999,6 +1014,7 @@ - <<: *if-label-example_test_esp32c2 - <<: *if-label-example_test_esp32c3 - <<: *if-label-example_test_esp32c6 + - <<: *if-label-example_test_esp32h2 - <<: *if-label-example_test_esp32h4 - <<: *if-label-example_test_esp32s2 - <<: *if-label-example_test_esp32s3 @@ -1332,6 +1348,7 @@ - <<: *if-label-component_ut_esp32c2 - <<: *if-label-component_ut_esp32c3 - <<: *if-label-component_ut_esp32c6 + - <<: *if-label-component_ut_esp32h2 - <<: *if-label-component_ut_esp32h4 - <<: *if-label-component_ut_esp32s2 - <<: *if-label-component_ut_esp32s3 @@ -1340,6 +1357,7 @@ - <<: *if-label-custom_test_esp32c2 - <<: *if-label-custom_test_esp32c3 - <<: *if-label-custom_test_esp32c6 + - <<: *if-label-custom_test_esp32h2 - <<: *if-label-custom_test_esp32h4 - <<: *if-label-custom_test_esp32s2 - <<: *if-label-custom_test_esp32s3 @@ -1348,6 +1366,7 @@ - <<: *if-label-example_test_esp32c2 - <<: *if-label-example_test_esp32c3 - <<: *if-label-example_test_esp32c6 + - <<: *if-label-example_test_esp32h2 - <<: *if-label-example_test_esp32h4 - <<: *if-label-example_test_esp32s2 - <<: *if-label-example_test_esp32s3 @@ -1362,6 +1381,7 @@ - <<: *if-label-unit_test_esp32c2 - <<: *if-label-unit_test_esp32c3 - <<: *if-label-unit_test_esp32c6 + - <<: *if-label-unit_test_esp32h2 - <<: *if-label-unit_test_esp32h4 - <<: *if-label-unit_test_esp32s2 - <<: *if-label-unit_test_esp32s3 @@ -1420,6 +1440,7 @@ - <<: *if-label-unit_test_esp32c2 - <<: *if-label-unit_test_esp32c3 - <<: *if-label-unit_test_esp32c6 + - <<: *if-label-unit_test_esp32h2 - <<: *if-label-unit_test_esp32h4 - <<: *if-label-unit_test_esp32s2 - <<: *if-label-unit_test_esp32s3 diff --git a/examples/build_system/cmake/idf_as_lib/CMakeLists.txt b/examples/build_system/cmake/idf_as_lib/CMakeLists.txt index 6914c4aee5..6409d4a6bc 100644 --- a/examples/build_system/cmake/idf_as_lib/CMakeLists.txt +++ b/examples/build_system/cmake/idf_as_lib/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.16) project(idf_as_lib C) -set(targets "esp32" "esp32s2" "esp32s3" "esp32c3" "esp32h4" "esp32c2" "esp32c6") +set(targets "esp32" "esp32s2" "esp32s3" "esp32c3" "esp32h4" "esp32c2" "esp32c6" "esp32h2") if("${TARGET}" IN_LIST targets) # Include for ESP-IDF build system functions diff --git a/examples/build_system/cmake/idf_as_lib/build-esp32h2.sh b/examples/build_system/cmake/idf_as_lib/build-esp32h2.sh new file mode 120000 index 0000000000..c07a74de4f --- /dev/null +++ b/examples/build_system/cmake/idf_as_lib/build-esp32h2.sh @@ -0,0 +1 @@ +build.sh \ No newline at end of file diff --git a/examples/build_system/cmake/idf_as_lib/run-esp32h2.sh b/examples/build_system/cmake/idf_as_lib/run-esp32h2.sh new file mode 120000 index 0000000000..cde8585ed4 --- /dev/null +++ b/examples/build_system/cmake/idf_as_lib/run-esp32h2.sh @@ -0,0 +1 @@ +run-esp32.sh \ No newline at end of file diff --git a/tools/ci/build_template_app.sh b/tools/ci/build_template_app.sh index 7cb7bfeaa5..f214b87986 100755 --- a/tools/ci/build_template_app.sh +++ b/tools/ci/build_template_app.sh @@ -62,7 +62,7 @@ build_stage2() { --build-log ${BUILD_LOG_CMAKE} \ --size-file size.json \ --collect-size-info size_info.txt \ - --default-build-targets esp32,esp32s2,esp32s3,esp32c2,esp32c3,esp32c6 # add esp32h4 back after IDF-5541 + --default-build-targets esp32,esp32s2,esp32s3,esp32c2,esp32c3,esp32c6,esp32h2 # add esp32h4 back after IDF-5541 } build_stage1() { @@ -76,7 +76,7 @@ build_stage1() { --build-log ${BUILD_LOG_CMAKE} \ --size-file size.json \ --collect-size-info size_info.txt \ - --default-build-targets esp32,esp32s2,esp32s3,esp32c2,esp32c3,esp32h4,esp32c6 + --default-build-targets esp32,esp32s2,esp32s3,esp32c2,esp32c3,esp32h4,esp32c6,esp32h2 } # Default arguments diff --git a/tools/ci/check_build_test_rules.py b/tools/ci/check_build_test_rules.py index ae83b3f64c..940c7f31a5 100755 --- a/tools/ci/check_build_test_rules.py +++ b/tools/ci/check_build_test_rules.py @@ -32,6 +32,7 @@ USUAL_TO_FORMAL = { 'esp32h4': 'ESP32-H4', 'esp32c2': 'ESP32-C2', 'esp32c6': 'ESP32-C6', + 'esp32h2': 'ESP32-H2', 'linux': 'Linux', } @@ -43,6 +44,7 @@ FORMAL_TO_USUAL = { 'ESP32-H4': 'esp32h4', 'ESP32-C2': 'esp32c2', 'ESP32-C6': 'esp32c6', + 'ESP32-H2': 'esp32h2', 'Linux': 'linux', } diff --git a/tools/ci/test_build_system_cmake.sh b/tools/ci/test_build_system_cmake.sh index 828002e162..cbc800c3cc 100755 --- a/tools/ci/test_build_system_cmake.sh +++ b/tools/ci/test_build_system_cmake.sh @@ -513,7 +513,7 @@ function run_tests() print_status "Test build ESP-IDF as a library to a custom CMake projects for all targets" IDF_AS_LIB=$IDF_PATH/examples/build_system/cmake/idf_as_lib # note: we just need to run cmake - for TARGET in "esp32" "esp32s2" "esp32s3" "esp32c3" "esp32h4" "esp32c2" "esp32c6" + for TARGET in "esp32" "esp32s2" "esp32s3" "esp32c3" "esp32h4" "esp32c2" "esp32c6" "esp32h2" do echo "Build idf_as_lib for $TARGET target" rm -rf build diff --git a/tools/idf_size_yaml/esp32h2_data_info.yaml b/tools/idf_size_yaml/esp32h2_data_info.yaml new file mode 100644 index 0000000000..b0470de7dd --- /dev/null +++ b/tools/idf_size_yaml/esp32h2_data_info.yaml @@ -0,0 +1,17 @@ +# Data_type: +# primary_address: value +# length: value or equation +# secondary_address: value if exist +DRAM: + primary_address: 0x40800000 + length: 0x50000 + secondary_address: 0x40800000 +CACHE_I: + primary_address: 0x42000000 + length: 0x800000 +CACHE_D: + primary_address: 0x42000000 + length: 0x800000 +RTC_SLOW_D: # TODO: IDF-5667 Better to rename to LP_RAM + primary_address: 0x50000000 + length: 0x4000 diff --git a/tools/test_apps/.build-test-rules.yml b/tools/test_apps/.build-test-rules.yml index 13860eb1d9..be1ddf8ed1 100644 --- a/tools/test_apps/.build-test-rules.yml +++ b/tools/test_apps/.build-test-rules.yml @@ -115,7 +115,7 @@ tools/test_apps/system/flash_psram: tools/test_apps/system/g0_components: enable: - - if: INCLUDE_DEFAULT == 1 or IDF_TARGET in ["esp32h4", "esp32c6"] # preview targets + - if: INCLUDE_DEFAULT == 1 or IDF_TARGET in ["esp32h4", "esp32c6", "esp32h2"] # preview targets tools/test_apps/system/g1_components: diff --git a/tools/test_apps/system/build_test/sdkconfig.ci.esp32h2_with_rom_impl_components b/tools/test_apps/system/build_test/sdkconfig.ci.esp32h2_with_rom_impl_components new file mode 100644 index 0000000000..7456ed4f65 --- /dev/null +++ b/tools/test_apps/system/build_test/sdkconfig.ci.esp32h2_with_rom_impl_components @@ -0,0 +1,5 @@ +CONFIG_IDF_TARGET="esp32h2" +CONFIG_HAL_WDT_USE_ROM_IMPL=y +CONFIG_HAL_SYSTIMER_USE_ROM_IMPL=y +CONFIG_HEAP_TLSF_USE_ROM_IMPL=y +CONFIG_SPI_FLASH_ROM_IMPL=y diff --git a/tools/test_apps/system/build_test/sdkconfig.ci.esp32h2_without_rom_impl_components b/tools/test_apps/system/build_test/sdkconfig.ci.esp32h2_without_rom_impl_components new file mode 100644 index 0000000000..843ca0e1a1 --- /dev/null +++ b/tools/test_apps/system/build_test/sdkconfig.ci.esp32h2_without_rom_impl_components @@ -0,0 +1,5 @@ +CONFIG_IDF_TARGET="esp32h2" +CONFIG_HAL_WDT_USE_ROM_IMPL=n +CONFIG_HAL_SYSTIMER_USE_ROM_IMPL=n +CONFIG_HEAP_TLSF_USE_ROM_IMPL=n +CONFIG_SPI_FLASH_ROM_IMPL=n diff --git a/tools/test_apps/system/g0_components/CMakeLists.txt b/tools/test_apps/system/g0_components/CMakeLists.txt index d6433b7fce..eb04cf6a4d 100644 --- a/tools/test_apps/system/g0_components/CMakeLists.txt +++ b/tools/test_apps/system/g0_components/CMakeLists.txt @@ -28,7 +28,7 @@ project(g0_components) # As a workaround for ESP32-C2, we need to define the MMU page size here, until MMU hal-driver # is refactored -if(CONFIG_IDF_TARGET_ESP32C2 OR CONFIG_IDF_TARGET_ESP32C6) +if(CONFIG_IDF_TARGET_ESP32C2 OR CONFIG_IDF_TARGET_ESP32C6 OR CONFIG_IDF_TARGET_ESP32H2) idf_build_set_property(C_COMPILE_OPTIONS "-DCONFIG_MMU_PAGE_SIZE=64" APPEND) endif() diff --git a/tools/test_apps/system/g0_components/README.md b/tools/test_apps/system/g0_components/README.md index 6060d89b20..52129284e5 100644 --- a/tools/test_apps/system/g0_components/README.md +++ b/tools/test_apps/system/g0_components/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-H4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # "G0"-components-only app diff --git a/tools/tools.json b/tools/tools.json index 784cbe17eb..4b1c085d08 100644 --- a/tools/tools.json +++ b/tools/tools.json @@ -390,7 +390,8 @@ "esp32c3", "esp32h4", "esp32c2", - "esp32c6" + "esp32c6", + "esp32h2" ], "version_cmd": [ "clang", @@ -454,7 +455,8 @@ "esp32c3", "esp32h4", "esp32c2", - "esp32c6" + "esp32c6", + "esp32h2" ], "version_cmd": [ "riscv32-esp-elf-gcc",