Skip to content

Commit

Permalink
Merge pull request #828 from trabucayre/fix_reset_stlinkv1
Browse files Browse the repository at this point in the history
Do not issue JTAG reset on stlink-v1
  • Loading branch information
texane committed Sep 3, 2019
2 parents 4909dd8 + 738e48e commit c4283f4
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/tools/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ int main(int ac, char** av)
}

if (o.reset){
if (stlink_jtag_reset(sl, 2)) {
printf("Failed to reset JTAG\n");
goto on_error;
if (sl->version.stlink_v > 1) {
if (stlink_jtag_reset(sl, 2)) {
printf("Failed to reset JTAG\n");
goto on_error;
}
}

if (stlink_reset(sl)) {
Expand Down Expand Up @@ -185,9 +187,11 @@ int main(int ac, char** av)
}
} else if (o.cmd == CMD_RESET)
{
if (stlink_jtag_reset(sl, 2)) {
printf("Failed to reset JTAG\n");
goto on_error;
if (sl->version.stlink_v > 1) {
if (stlink_jtag_reset(sl, 2)) {
printf("Failed to reset JTAG\n");
goto on_error;
}
}

if (stlink_reset(sl)) {
Expand All @@ -212,7 +216,7 @@ int main(int ac, char** av)
}

if (o.reset){
stlink_jtag_reset(sl,2);
if (sl->version.stlink_v > 1) stlink_jtag_reset(sl, 2);
stlink_reset(sl);
}

Expand Down

0 comments on commit c4283f4

Please sign in to comment.