From 47e2ed1a5e9269b1d3cc4720ed614c86152b0112 Mon Sep 17 00:00:00 2001 From: dragonmux Date: Wed, 30 Oct 2024 20:53:52 +0000 Subject: [PATCH] stm32l4: Improved the device lookup handling on attach by using the copy stored in the private structure --- src/target/stm32l4.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/target/stm32l4.c b/src/target/stm32l4.c index 7734338f348..75a7dc8b09a 100644 --- a/src/target/stm32l4.c +++ b/src/target/stm32l4.c @@ -744,8 +744,8 @@ static bool stm32l4_attach(target_s *const target) if (!cortexm_attach(target) || !stm32l4_configure_dbgmcu(target, NULL)) return false; - /* Retrieve device information, and locate the device ID register */ - const stm32l4_device_info_s *device = stm32l4_get_device_info(target->part_id); + /* Extract the device structure from the priv storage and enable the Flash if on an L55 part */ + const stm32l4_device_info_s *const device = ((stm32l4_priv_s *)target->priv)->device; if (device->family == STM32L4_FAMILY_L55x) stm32l5_flash_enable(target);