Skip to content

Commit

Permalink
stm32: fix formatting for DEBUG_TARGET on esp32
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
xobs committed Aug 8, 2024
1 parent 13b055c commit f1aec5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/target/stm32h7.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/target/stm32mp15.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f1aec5f

Please sign in to comment.