test_apps: Test multicore app can be run by unicore bootloader

This commit is contained in:
KonstantinKondrashov
2023-03-28 18:24:22 +08:00
committed by BOT
parent 1b608a1c07
commit a2ffc9374c
8 changed files with 69 additions and 0 deletions

View File

@ -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)

View File

@ -0,0 +1,2 @@
| Supported Targets | ESP32 | ESP32-S3 |
| ----------------- | ----- | -------- |

View File

@ -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.

View File

@ -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()

View File

@ -0,0 +1 @@
idf_component_register(SRCS "main.c")

View File

@ -0,0 +1,12 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdio.h>
void app_main(void)
{
printf("App is running\n");
}

View File

@ -0,0 +1 @@
CONFIG_FREERTOS_UNICORE=y