Skip to content

Commit

Permalink
stm32l4: Improved the device lookup handling on attach by using the c…
Browse files Browse the repository at this point in the history
…opy stored in the private structure
  • Loading branch information
dragonmux committed Nov 15, 2024
1 parent 0f813e3 commit 178abf5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/target/stm32l4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 178abf5

Please sign in to comment.