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' doesn't support the '%j' length
modifier when 'cbprintf' is configured with minimum features.

Signed-off-by: Piotr Dymacz <[email protected]>
  • Loading branch information
pepe2k committed Sep 19, 2023
1 parent 5785f1f commit 5045928
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 @@ -596,8 +596,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 5045928

Please sign in to comment.