bootloader: Kconfig files in bootloader_components is now part of menuconfig

It is now possible to configure the options (Kconfig) of bootloader components
directly from the menuconfig
This commit is contained in:
Omar Chebib
2021-08-11 14:59:16 +08:00
parent 2c49af9e75
commit 339454ff19
5 changed files with 57 additions and 2 deletions

View File

@@ -0,0 +1,8 @@
menu "Bootloader welcome message"
config EXAMPLE_BOOTLOADER_WELCOME_MESSAGE
string "Bootloader welcome message"
default "Custom bootloader message defined in the KConfig file."
help
Message to print by the custom bootloader when booting up.
endmenu

View File

@@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdbool.h>
#include "sdkconfig.h"
#include "esp_log.h"
#include "bootloader_init.h"
#include "bootloader_utility.h"
@@ -41,7 +42,7 @@ void __attribute__((noreturn)) call_start_cpu0(void)
}
// 2.1 Print a custom message!
esp_rom_printf("[%s] Custom bootloader has been initialized correctly.\n", TAG);
esp_rom_printf("[%s] %s\n", TAG, CONFIG_EXAMPLE_BOOTLOADER_WELCOME_MESSAGE);
// 3. Load the app image for booting
bootloader_utility_load_boot_image(&bs, boot_index);

View File

@@ -10,7 +10,10 @@ def test_custom_bootloader_impl_example(env, _): # type: ignore
dut.start_app()
# Expect to read a message from the custom bootloader
dut.expect('Custom bootloader has been initialized correctly.')
# This message is defined in the Kconfig file, retrieve it while deleting
# leading and trailing quotes (")
welcome_message = dut.app.get_sdkconfig()['CONFIG_EXAMPLE_BOOTLOADER_WELCOME_MESSAGE'].strip("\"")
dut.expect(welcome_message)
# Expect to read a message from the user application
dut.expect('Application started!')