Commit 9f1933d1 authored by Emanuele Di Santo's avatar Emanuele Di Santo Committed by Andrzej Puzdrowski
Browse files

boot: zephyr: migrate to new log subystem

The old log subsystem has been deprecated in Zephyr.
Migrate to the new subsystem to avoid compilation warnings.

In-place log processing is selected as it is required as MCUBoot is
one thread application.

Signed-off-by: default avatarEmanuele Di Santo <emdi@nordicsemi.no>
Signed-off-by: default avatarAndrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
parent 2733f515
Loading
Loading
Loading
Loading
+3 −1
Changes for boot/boot_serial/src/boot_serial.c: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -59,6 +59,8 @@
#include "bootutil_priv.h"
#endif

MCUBOOT_LOG_MODULE_DECLARE(mcuboot);

#define BOOT_SERIAL_INPUT_MAX   512
#define BOOT_SERIAL_OUT_MAX	80

@@ -71,8 +73,8 @@

#define ntohs(x) sys_be16_to_cpu(x)
#define htons(x) sys_cpu_to_be16(x)

#endif

static char in_buf[BOOT_SERIAL_INPUT_MAX + 1];
static char dec_buf[BOOT_SERIAL_INPUT_MAX + 1];
const struct boot_uart_funcs *boot_uf;
+2
Changes for boot/bootutil/src/bootutil_misc.c: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@
#include "bootutil/enc_key.h"
#endif

MCUBOOT_LOG_MODULE_DECLARE(mcuboot);

int boot_current_slot;

const uint32_t boot_img_magic[] = {
+2
Changes for boot/bootutil/src/loader.c: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -40,6 +40,8 @@

#include "mcuboot_config/mcuboot_config.h"

MCUBOOT_LOG_MODULE_DECLARE(mcuboot);

static struct boot_loader_state boot_data;

#if defined(MCUBOOT_VALIDATE_SLOT0) && !defined(MCUBOOT_OVERWRITE_ONLY)
+3
Changes for boot/mynewt/mcuboot_config/include/mcuboot_config/mcuboot_logging.h: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -38,6 +38,9 @@
#define MCUBOOT_LOG_LEVEL MYNEWT_VAL(BOOTUTIL_LOG_LEVEL)
#endif

#define MCUBOOT_LOG_MODULE_DECLARE(domain)	/* ignore */
#define MCUBOOT_LOG_MODULE_REGISTER(domain)	/* ignore */

#if !((MCUBOOT_LOG_LEVEL >= MCUBOOT_LOG_LEVEL_OFF) && \
      (MCUBOOT_LOG_LEVEL <= MCUBOOT_LOG_LEVEL_DEBUG))
#error "Invalid MCUBOOT_LOG_LEVEL config."
+3 −2
Changes for boot/zephyr/Kconfig: 3 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -132,10 +132,11 @@ config ZEPHYR_TRY_MASS_ERASE
config BOOT_HAVE_LOGGING
	bool "MCUboot have logging enabled"
	default y
	select SYS_LOG
	select LOG
	select LOG_INPLACE_PROCESS
	help
	  If y, enables logging on the serial port. The log level can
	  be defined by setting `SYS_LOG_DEFAULT_LEVEL`.
	  be defined by setting `LOG_DEFAULT_LEVEL`.
	  If unsure, leave at the default value.

menuconfig MCUBOOT_SERIAL
Loading