From d0de91eb2e6b992d1e6e5a4cc0873edc1d07db1e Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Sat, 1 Nov 2025 13:50:27 +0100 Subject: [PATCH] stm32l1: Use ID from DBGMCU_IDCODE Otherwise STM32L152RC on stm32l152c-discovery is recognized with only 4k --- src/target/stm32l0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/target/stm32l0.c b/src/target/stm32l0.c index 79a5a3e2f70..27138cc4744 100644 --- a/src/target/stm32l0.c +++ b/src/target/stm32l0.c @@ -342,7 +342,7 @@ bool stm32l1_probe(target_s *const target) if (ap->partno != ID_STM32L1xxxB && ap->partno != ID_STM32L1xxxBxA && ap->partno != ID_STM32L1xxxC && ap->partno != ID_STM32L1xxxD && ap->partno != ID_STM32L1xxxE) return false; - target->part_id = ap->partno; + target->part_id = target_mem32_read32(target, STM32L1_DBGMCU_IDCODE) & 0xfffU; /* Now we have a stable debug environment, make sure the WDTs + WFI and WFE instructions can't cause problems */ stm32l1_configure_dbgmcu(target);