diff --git a/tools/test_apps/system/unicore_bootloader/CMakeLists.txt b/tools/test_apps/system/unicore_bootloader/CMakeLists.txt new file mode 100644 index 0000000000..4b7ab3fd72 --- /dev/null +++ b/tools/test_apps/system/unicore_bootloader/CMakeLists.txt @@ -0,0 +1,6 @@ +# The following lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.5) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(test_unicore_bootloader) diff --git a/tools/test_apps/system/unicore_bootloader/README.md b/tools/test_apps/system/unicore_bootloader/README.md new file mode 100644 index 0000000000..5ab630aafd --- /dev/null +++ b/tools/test_apps/system/unicore_bootloader/README.md @@ -0,0 +1,2 @@ +| Supported Targets | ESP32 | ESP32-S3 | +| ----------------- | ----- | -------- | diff --git a/tools/test_apps/system/unicore_bootloader/README.txt b/tools/test_apps/system/unicore_bootloader/README.txt new file mode 100644 index 0000000000..875b2c9400 --- /dev/null +++ b/tools/test_apps/system/unicore_bootloader/README.txt @@ -0,0 +1,4 @@ +This project tests if the app can start up in a certain configuration. +Multicore app can start up even if the bootloader is unicore. + +The test is only for Multicore chips. diff --git a/tools/test_apps/system/unicore_bootloader/app_test.py b/tools/test_apps/system/unicore_bootloader/app_test.py new file mode 100644 index 0000000000..1ce9a2dd08 --- /dev/null +++ b/tools/test_apps/system/unicore_bootloader/app_test.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python + +from typing import Any + +import ttfw_idf + + +@ttfw_idf.idf_custom_test(env_tag='Example_GENERIC', group='test-apps', target=['esp32', 'esp32s3']) +def test_multicore_app_and_unicore_bootloader(env, _): # type: (Any, Any) -> None + dut = env.get_dut('unicore_bootloader', 'tools/test_apps/system/unicore_bootloader', app_config_name='multicore_cfg') + print('Using binary path: {}'.format(dut.app.binary_path)) + dut.start_app() + dut.expect('Multicore bootloader') + dut.expect('Multicore app') + dut.expect('App is running') + + another_build_path = dut.app.binary_path.replace('multicore_cfg', 'unicore_cfg') + print('Using binary from another_build_path: {}'.format(another_build_path)) + dut.bootloader_flash(another_build_path) + dut.expect('Unicore bootloader') + dut.expect('Multicore app') + dut.expect('App is running') + + +@ttfw_idf.idf_custom_test(env_tag='Example_GENERIC', group='test-apps', target=['esp32', 'esp32s3']) +def test_unicore_app_and_multicore_bootloader(env, _): # type: (Any, Any) -> None + dut = env.get_dut('unicore_bootloader', 'tools/test_apps/system/unicore_bootloader', app_config_name='unicore_cfg') + print('Using binary path: {}'.format(dut.app.binary_path)) + dut.expect('Unicore bootloader') + dut.expect('Unicore app') + dut.expect('App is running') + + another_build_path = dut.app.binary_path.replace('unicore_cfg', 'multicore_cfg') + print('Using binary from another_build_path: {}'.format(another_build_path)) + dut.bootloader_flash(another_build_path) + dut.expect('Multicore bootloader') + dut.expect('Unicore app') + dut.expect('App is running') + + +if __name__ == '__main__': + test_multicore_app_and_unicore_bootloader() + test_unicore_app_and_multicore_bootloader() diff --git a/tools/test_apps/system/unicore_bootloader/main/CMakeLists.txt b/tools/test_apps/system/unicore_bootloader/main/CMakeLists.txt new file mode 100644 index 0000000000..34613e8e3c --- /dev/null +++ b/tools/test_apps/system/unicore_bootloader/main/CMakeLists.txt @@ -0,0 +1 @@ +idf_component_register(SRCS "main.c") diff --git a/tools/test_apps/system/unicore_bootloader/main/main.c b/tools/test_apps/system/unicore_bootloader/main/main.c new file mode 100644 index 0000000000..50c39ad016 --- /dev/null +++ b/tools/test_apps/system/unicore_bootloader/main/main.c @@ -0,0 +1,12 @@ +/* + * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +void app_main(void) +{ + printf("App is running\n"); +} diff --git a/tools/test_apps/system/unicore_bootloader/sdkconfig.ci.multicore_cfg b/tools/test_apps/system/unicore_bootloader/sdkconfig.ci.multicore_cfg new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tools/test_apps/system/unicore_bootloader/sdkconfig.ci.unicore_cfg b/tools/test_apps/system/unicore_bootloader/sdkconfig.ci.unicore_cfg new file mode 100644 index 0000000000..f0b0b5e03d --- /dev/null +++ b/tools/test_apps/system/unicore_bootloader/sdkconfig.ci.unicore_cfg @@ -0,0 +1 @@ +CONFIG_FREERTOS_UNICORE=y