From b1ac4187b9ab915032e271e23a1076de67c42268 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Fri, 12 Mar 2021 21:07:23 +0100 Subject: [PATCH] Fix some formatting strings for 32-bit compile --- src/target/adiv5.c | 5 +++-- src/target/cortexm.c | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/target/adiv5.c b/src/target/adiv5.c index 0617ee84..50a42664 100644 --- a/src/target/adiv5.c +++ b/src/target/adiv5.c @@ -613,7 +613,7 @@ ADIv5_AP_t *adiv5_new_ap(ADIv5_DP_t *dp, uint8_t apsel) uint32_t cfg = adiv5_ap_read(ap, ADIV5_AP_CFG); DEBUG_INFO("AP %3d: IDR=%08"PRIx32" CFG=%08"PRIx32" BASE=%08" PRIx32 " CSW=%08"PRIx32, apsel, ap->idr, cfg, ap->base, ap->csw); - DEBUG_INFO(" (AHB-AP var%x rev%x)\n", + DEBUG_INFO(" (AHB-AP var%" PRIx32 " rev%" PRIx32 "\n", (ap->idr >> 4) & 0xf, ap->idr >> 28); #endif adiv5_ap_ref(ap); @@ -630,7 +630,8 @@ void adiv5_dp_init(ADIv5_DP_t *dp) free(dp); return; } - DEBUG_INFO("DPIDR 0x%08" PRIx32 " (v%d %srev%d)\n", dp->idcode, + DEBUG_INFO("DPIDR 0x%08" PRIx32 " (v%" PRId32 " %srev%" PRId32 ")\n", + dp->idcode, (dp->idcode >> 12) & 0xf, (dp->idcode & 0x10000) ? "MINDP " : "", dp->idcode >> 28); volatile uint32_t ctrlstat = 0; diff --git a/src/target/cortexm.c b/src/target/cortexm.c index 9761f5c4..9a36e0f9 100644 --- a/src/target/cortexm.c +++ b/src/target/cortexm.c @@ -327,9 +327,11 @@ bool cortexm_probe(ADIv5_AP_t *ap) t->core = "M0"; break; default: - DEBUG_WARN("Unexpected CortexM CPUID partno %04x\n", cpuid_partno); + DEBUG_WARN("Unexpected CortexM CPUID partno %04" PRIx32 "\n", + cpuid_partno); } - DEBUG_INFO("CPUID 0x%08" PRIx32 " (%s var %x rev %x)\n", t->cpuid, + DEBUG_INFO("CPUID 0x%08" PRIx32 " (%s var %" PRIx32 " rev %" PRIx32 ")\n", + t->cpuid, t->core, (t->cpuid & CPUID_REVISION_MASK) >> 20, t->cpuid & CPUID_PATCH_MASK);