Enable serial only when required for Mynewt
For Mynewt when no logging (default option) or serial boot was selected,
avoid initializing all serial supporting system. This enables to save
flash space when only basic bootloader functionality is used.
#include <console/console.h>
#include "bootutil/image.h"
#include "bootutil/bootutil.h"
+#include "bootutil/bootutil_log.h"
#define BOOT_AREA_DESC_MAX (256)
#define AREA_DESC_MAX (BOOT_AREA_DESC_MAX)
@@ -67,10 +68,14 @@ main(void)
hal_bsp_init();
+#if defined(MCUBOOT_SERIAL) || defined(MCUBOOT_HAVE_LOGGING)
/* initialize uart without os */
os_dev_initialize_all(OS_DEV_INIT_PRIMARY);
sysinit();
console_blocking_mode();
+#else
+ flash_map_init();
+#endif
#ifdef MCUBOOT_SERIAL
/*
