Skip to content

Commit

Permalink
stm32h7: Fixed the part identification logic in probe to handle the d…
Browse files Browse the repository at this point in the history
…ifferences between JTAG and SWD correctly
  • Loading branch information
dragonmux committed May 12, 2024
1 parent 8c8b450 commit 0f22623
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/target/stm32h7.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,11 @@ void stm32h7_configure_wdts(target_s *const target)

bool stm32h7_probe(target_s *target)
{
const uint16_t part_id = target->part_id >> 4U;
if (part_id != ID_STM32H74x && part_id != ID_STM32H7Bx && part_id != ID_STM32H72x)
const adiv5_access_port_s *const ap = cortex_ap(target);
/* Use the partno from the AP always to handle the difference between JTAG and SWD */
if (ap->partno != ID_STM32H72x && ap->partno != ID_STM32H74x && ap->partno != ID_STM32H7Bx)
return false;
/* Update part_id on match */
target->part_id = part_id;
target->part_id = ap->partno;

/* Save private storage */
stm32h7_priv_s *priv_storage = calloc(1, sizeof(*priv_storage));
Expand Down

0 comments on commit 0f22623

Please sign in to comment.