From 52cac94c0eafdc4cf2183e2859f50d0c912ca93f Mon Sep 17 00:00:00 2001 From: Jerzy Kasenberg Date: Fri, 14 Jul 2023 09:17:53 +0200 Subject: [PATCH] mynewt: Make sysinit() call configurable In same cases (loging, hash, crypto) main function called newt tool generated sysinit() function to create uart device and crypto. Now user can specify that sysinit should be called for other cases if needed. This can be useful if some other package should be included in the build and it has package initialization function. Signed-off-by: Jerzy Kasenberg --- boot/mynewt/src/main.c | 2 +- boot/mynewt/syscfg.yml | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/boot/mynewt/src/main.c b/boot/mynewt/src/main.c index a054fa96..f5c7d5f6 100755 --- a/boot/mynewt/src/main.c +++ b/boot/mynewt/src/main.c @@ -229,7 +229,7 @@ main(void) #endif #if defined(MCUBOOT_SERIAL) || defined(MCUBOOT_HAVE_LOGGING) || \ - MYNEWT_VAL(CRYPTO) || MYNEWT_VAL(HASH) + MYNEWT_VAL(CRYPTO) || MYNEWT_VAL(HASH) || MYNEWT_VAL(BOOT_MYNEWT_SYSINIT) /* initialize uart/crypto without os */ os_dev_initialize_all(OS_DEV_INIT_PRIMARY); os_dev_initialize_all(OS_DEV_INIT_SECONDARY); diff --git a/boot/mynewt/syscfg.yml b/boot/mynewt/syscfg.yml index da0cc15c..b4fdb77e 100644 --- a/boot/mynewt/syscfg.yml +++ b/boot/mynewt/syscfg.yml @@ -31,6 +31,14 @@ syscfg.defs: BOOT_PREBOOT: description: 'Call boot_preboot() function before booting application' value: + BOOT_MYNEWT_SYSINIT: + description: > + When not 0 performs device initialization and calls newt + generated sysinit() function. + Note: this functionality is implicitly turned on when one of the + following settings are not 0: + MCUBOOT_SERIAL, MCUBOOT_HAVE_LOGGING, CRYPTO, HASH + value: 0 syscfg.vals: SYSINIT_CONSTRAIN_INIT: 0