Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RESET_SOFT_AND_HALT as a specifiable behavior for monitor reset #1319

Closed
6 tasks done
sfarnswo opened this issue Jul 12, 2023 · 1 comment · Fixed by #1332
Closed
6 tasks done

RESET_SOFT_AND_HALT as a specifiable behavior for monitor reset #1319

sfarnswo opened this issue Jul 12, 2023 · 1 comment · Fixed by #1332

Comments

@sfarnswo
Copy link

sfarnswo commented Jul 12, 2023

  • I made serious effort to avoid creating duplicate or nearly similar issue

In order to allow developers to isolate and target your respective issue, please take some time to select the check boxes below and fill out each of the following items appropriate to your specific request.

  • Programmer/board type: STLINK/V3
  • Operating system an version: Linux
  • stlink tools version and/or git commit hash: f7fb0a6
  • stlink commandline tool name: st-util
  • Target chip (and board, if applicable): N/A

I am proposing adding this option to be able to specify a "halt" behavior for the "reset" monitor command.

Using the Cortex-Debug extension on VsCode, and when debugging a target without the NRST pin connected, the default monitor reset attempts and succeeds at performing a soft reset in the absence of NRST. However; early breakpoints (such as those in main or Reset_Handler) do not trigger. This behavior is corrected when re-compiling the stlink-tools suite with the following modification:

diff --git a/src/st-util/gdb-server.c b/src/st-util/gdb-server.c
index 9f9d938..5ad7087 100644
--- a/src/st-util/gdb-server.c
+++ b/src/st-util/gdb-server.c
@@ -1317,7 +1317,7 @@ int32_t serve(stlink_t *sl, st_state_t *st) {
                         reply = strdup("E00");
                     }
 
-                    ret = stlink_reset(sl, RESET_AUTO);
+                    ret = stlink_reset(sl, RESET_SOFT_AND_HALT);
                     if (ret) {
                         DLOG("Rcmd: reset failed with reset\n");
                         reply = strdup("E00");

Using the modified solution, the software reset succeeds and early breakpoints are triggered.

@Nightwalker-87
Copy link
Member

Obviously related to #1198.

@Nightwalker-87 Nightwalker-87 changed the title [feature] RESET_SOFT_AND_HALT as a specifiable behavior for monitor reset [bugfix] RESET_SOFT_AND_HALT as a specifiable behavior for monitor reset Sep 2, 2023
@Nightwalker-87 Nightwalker-87 changed the title [bugfix] RESET_SOFT_AND_HALT as a specifiable behavior for monitor reset RESET_SOFT_AND_HALT as a specifiable behavior for monitor reset Sep 4, 2023
Nightwalker-87 added a commit that referenced this issue Sep 14, 2023
Fixes an issue where early breakpoints did not trigger.
(Closes #1198) (Closes #1246) (Closes #1319)
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Sep 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants