From f1aec5f786ab2decfe577f880adeb29fc667cd57 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 8 Aug 2024 00:16:54 +0800 Subject: [PATCH] stm32: fix formatting for DEBUG_TARGET on esp32 These functions incorrectly use formatting, resulting in build errors on ESP32. Use the correct formatting arguments to DEBUG_TARGET() to fix the build on those platforms. Signed-off-by: Sean Cross --- src/target/stm32h7.c | 3 ++- src/target/stm32mp15.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/target/stm32h7.c b/src/target/stm32h7.c index 143e2a30b3d..5f14966d7a2 100644 --- a/src/target/stm32h7.c +++ b/src/target/stm32h7.c @@ -264,7 +264,8 @@ bool stm32h7_probe(target_s *target) /* By now it's established that this is likely an H7, but check that it's not an MP15x_CM4 with an errata in AP part code */ const uint32_t idcode = target_mem32_read32(target, STM32H7_DBGMCU_IDCODE); const uint16_t dev_id = idcode & STM32H7_DBGMCU_IDCODE_DEV_MASK; - DEBUG_TARGET("%s: looking at device ID 0x%03x at 0x%08" PRIx32 "\n", __func__, dev_id, STM32H7_DBGMCU_IDCODE); + DEBUG_TARGET( + "%s: looking at device ID 0x%03x at 0x%08" PRIu32 "\n", __func__, dev_id, (uint32_t)STM32H7_DBGMCU_IDCODE); /* MP15x_CM4 errata: has a partno of 0x450. SoC DBGMCU says 0x500. */ if (dev_id != ID_STM32H72x && dev_id != ID_STM32H74x && dev_id != ID_STM32H7Bx) return false; diff --git a/src/target/stm32mp15.c b/src/target/stm32mp15.c index d395adcc65e..7e80121cd7f 100644 --- a/src/target/stm32mp15.c +++ b/src/target/stm32mp15.c @@ -103,7 +103,8 @@ static bool stm32mp15_ident(target_s *const target, const bool cortexm) /* By now it's established that this is likely an MP15x_CM4, but check that it's not an H74x */ const uint32_t idcode = target_mem32_read32(target, STM32MP15_DBGMCU_IDCODE); const uint16_t dev_id = idcode & STM32MP15_DBGMCU_IDCODE_DEV_MASK; - DEBUG_TARGET("%s: looking at device ID 0x%03x at 0x%08" PRIx32 "\n", __func__, dev_id, STM32MP15_DBGMCU_IDCODE); + DEBUG_TARGET( + "%s: looking at device ID 0x%03x at 0x%08" PRIx32 "\n", __func__, dev_id, (uint32_t)STM32MP15_DBGMCU_IDCODE); /* If this probe routine ever runs ahead of stm32h7_probe, skip the H74x. */ if (dev_id != ID_STM32MP15x) return false;