diff --git a/components/bootloader/Kconfig.projbuild b/components/bootloader/Kconfig.projbuild index 932f67f88d..2e5878626f 100644 --- a/components/bootloader/Kconfig.projbuild +++ b/components/bootloader/Kconfig.projbuild @@ -185,6 +185,20 @@ menu "Bootloader config" (factory or OTA[x]). Note that GPIO34-39 do not have an internal pullup and an external one must be provided. + choice BOOTLOADER_APP_TEST_PIN_LEVEL + bool "App test GPIO level" + depends on BOOTLOADER_APP_TEST + default BOOTLOADER_APP_TEST_PIN_LOW + help + Pin level for app test, can be triggered on low or high. + + config BOOTLOADER_APP_TEST_PIN_LOW + bool "Enter test app on GPIO low" + + config BOOTLOADER_APP_TEST_PIN_HIGH + bool "Enter test app on GPIO high" + endchoice + config BOOTLOADER_HOLD_TIME_GPIO int "Hold time of GPIO for reset/test mode (seconds)" depends on BOOTLOADER_FACTORY_RESET || BOOTLOADER_APP_TEST diff --git a/components/bootloader/subproject/main/bootloader_start.c b/components/bootloader/subproject/main/bootloader_start.c index 4a589beb7f..4645331dde 100644 --- a/components/bootloader/subproject/main/bootloader_start.c +++ b/components/bootloader/subproject/main/bootloader_start.c @@ -1,16 +1,8 @@ -// Copyright 2015-2019 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-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include "esp_log.h" #include "bootloader_init.h" @@ -110,7 +102,11 @@ static int selected_boot_partition(const bootloader_state_t *bs) #endif // TEST firmware. #ifdef CONFIG_BOOTLOADER_APP_TEST - if (bootloader_common_check_long_hold_gpio(CONFIG_BOOTLOADER_NUM_PIN_APP_TEST, CONFIG_BOOTLOADER_HOLD_TIME_GPIO) == 1) { + bool app_test_level = false; +#if CONFIG_BOOTLOADER_APP_TEST_PIN_HIGH + app_test_level = true; +#endif + if (bootloader_common_check_long_hold_gpio_level(CONFIG_BOOTLOADER_NUM_PIN_APP_TEST, CONFIG_BOOTLOADER_HOLD_TIME_GPIO, app_test_level) == GPIO_LONG_HOLD) { ESP_LOGI(TAG, "Detect a boot condition of the test firmware"); if (bs->test.offset != 0) { boot_index = TEST_APP_INDEX; diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index 7d1f663acd..402ce05b13 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/tools/ci/check_copyright_ignore.txt @@ -1,5 +1,4 @@ components/bootloader/subproject/main/bootloader_hooks.h -components/bootloader/subproject/main/bootloader_start.c components/bt/common/osi/alarm.c components/bt/common/osi/allocator.c components/bt/common/osi/buffer.c