Skip to content

Commit

Permalink
boot_serial: don't use '%j' length modifier with Zephyr's minimal libc
Browse files Browse the repository at this point in the history
The Zephyr's 'Minimal C library' (which since recently is no longer used
by default) doesn't support the '%j' length modifier when 'cbprintf' is
configured with minimum features.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
  • Loading branch information
pepe2k committed Sep 12, 2023
1 parent 2c5ba1e commit 04adb5c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions boot/boot_serial/src/boot_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,13 @@ static off_t erase_range(const struct flash_area *fap, off_t start, off_t end)
}

size = flash_sector_get_off(&sect) + flash_sector_get_size(&sect) - start;
#if defined(__ZEPHYR__) && defined(CONFIG_MINIMAL_LIBC) && defined(CONFIG_CBPRINTF_NANO)
BOOT_LOG_INF("Erasing range 0x%lx:0x%lx", (fap->fa_off + start),
(fap->fa_off + start + size - 1));
#else
BOOT_LOG_INF("Erasing range 0x%jx:0x%jx", (intmax_t)(fap->fa_off + start),
(intmax_t)(fap->fa_off + start + size - 1));
#endif

rc = flash_area_erase(fap, start, size);
if (rc != 0) {
Expand Down

0 comments on commit 04adb5c

Please sign in to comment.