Skip to content

Commit fbbe8f2

Browse files
committed
mcuboot: unify boot log output
Make sure mcuboot zephyr-port log output uses the common ESP_EARLY_LOG already implemented for other bootloader initialization calls. This unify the booting output prefix to commom type: "I (xx) boot:" Signed-off-by: Sylvio Alves <[email protected]>
1 parent 8979dff commit fbbe8f2

File tree

4 files changed

+6
-63
lines changed

4 files changed

+6
-63
lines changed

west/tools.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,9 @@ def monitor(self, module_path, args):
181181
monitor_path = Path(module_path, "tools/idf_monitor/idf_monitor.py")
182182
cmd_path = Path(os.getcwd())
183183

184-
# Build command arguments
185184
cmd = [sys.executable, str(monitor_path), "-p", esp_port, "-b", args.baud, str(elf_path), "--eol", args.eol]
186185

187-
# Add "-d" flag by default unless explicitly enabled
186+
# Adding "-d" argument for idf_monitor.py disables the address decoding
188187
if not args.enable_address_decoding:
189188
cmd.append("-d")
190189

zephyr/port/include/boot/esp_log.h

Lines changed: 0 additions & 26 deletions
This file was deleted.

zephyr/port/include/boot/mcuboot_config/mcuboot_logging.h

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "sdkconfig.h"
1010
#include "mcuboot_config.h"
11+
#include "esp_log.h"
1112

1213
extern int ets_printf(const char *fmt, ...);
1314

@@ -17,30 +18,14 @@ extern int ets_printf(const char *fmt, ...);
1718
#define MCUBOOT_LOG_LEVEL_INFO 3
1819
#define MCUBOOT_LOG_LEVEL_DEBUG 4
1920

20-
#if CONFIG_IDF_TARGET_ESP32
21-
#define TARGET "[esp32]"
22-
#elif CONFIG_IDF_TARGET_ESP32S2
23-
#define TARGET "[esp32s2]"
24-
#elif CONFIG_IDF_TARGET_ESP32S3
25-
#define TARGET "[esp32s3]"
26-
#elif CONFIG_IDF_TARGET_ESP32C2
27-
#define TARGET "[esp32c2]"
28-
#elif CONFIG_IDF_TARGET_ESP32C3
29-
#define TARGET "[esp32c3]"
30-
#elif CONFIG_IDF_TARGET_ESP32C6
31-
#define TARGET "[esp32c6]"
32-
#else
33-
#error "Selected target not supported."
34-
#endif
35-
3621
#ifndef MCUBOOT_LOG_LEVEL
3722
#define MCUBOOT_LOG_LEVEL MCUBOOT_LOG_LEVEL_INFO
3823
#endif
3924

4025
#if MCUBOOT_LOG_LEVEL >= MCUBOOT_LOG_LEVEL_ERROR
4126
#define MCUBOOT_LOG_ERR(_fmt, ...) \
4227
do { \
43-
ets_printf(TARGET " [ERR] " _fmt "\n\r", ##__VA_ARGS__); \
28+
ESP_EARLY_LOGE("boot", _fmt "\n\r", ##__VA_ARGS__); \
4429
} while (0)
4530
#else
4631
#define MCUBOOT_LOG_ERR(_fmt, ...)
@@ -49,7 +34,7 @@ extern int ets_printf(const char *fmt, ...);
4934
#if MCUBOOT_LOG_LEVEL >= MCUBOOT_LOG_LEVEL_WARNING
5035
#define MCUBOOT_LOG_WRN(_fmt, ...) \
5136
do { \
52-
ets_printf(TARGET " [WRN] " _fmt "\n\r", ##__VA_ARGS__); \
37+
ESP_EARLY_LOGW("boot", _fmt "\n\r", ##__VA_ARGS__); \
5338
} while (0)
5439
#else
5540
#define MCUBOOT_LOG_WRN(_fmt, ...)
@@ -58,7 +43,7 @@ extern int ets_printf(const char *fmt, ...);
5843
#if MCUBOOT_LOG_LEVEL >= MCUBOOT_LOG_LEVEL_INFO
5944
#define MCUBOOT_LOG_INF(_fmt, ...) \
6045
do { \
61-
ets_printf(TARGET " [INF] " _fmt "\n\r", ##__VA_ARGS__); \
46+
ESP_EARLY_LOGI("boot", _fmt "\n\r", ##__VA_ARGS__); \
6247
} while (0)
6348
#else
6449
#define MCUBOOT_LOG_INF(_fmt, ...)
@@ -67,7 +52,7 @@ extern int ets_printf(const char *fmt, ...);
6752
#if MCUBOOT_LOG_LEVEL >= MCUBOOT_LOG_LEVEL_DEBUG
6853
#define MCUBOOT_LOG_DBG(_fmt, ...) \
6954
do { \
70-
ets_printf(TARGET " [DBG] " _fmt "\n\r", ##__VA_ARGS__); \
55+
ESP_EARLY_LOGD("boot", _fmt "\n\r", ##__VA_ARGS__); \
7156
} while (0)
7257
#else
7358
#define MCUBOOT_LOG_DBG(_fmt, ...)

zephyr/port/include/boot/soc_log.h

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)