How to reset target from JLINK script?

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • How to reset target from JLINK script?

      I'm writing a JLINK script including the function SetupTarget().
      From within this function I need to reset and halt the target in order to check lock state of flash and if needed to unlock the flash.
      Unfortunately there doesn't seem to be a reset function available.
      I expected a function like
      JLINK_TARGET_Reset()

      Essentially it should execute the standard reset, same as when using command "Reset" in the JLINK console.

      Is there such a function?
      Thank you

      The post was edited 1 time, last by dsula ().

    • There is no “reset” API function available from within a script file because the reset itself may call script file functions like BeforeReset(), AfterReset() and ResetTarget().

      What core are you working on?
      Cortex-M…, Cortex-A…, RISC-V, …?
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.
    • Ok, thank you for your answer.
      I'm working with risc-v. I wanted to do standard reset using DMCONTROL.ndmreset. I can always do that manually by directly programming DMCONTROL. But using a simple reset function would have been nice. Even when implementing the ResetTarget() function it would be nice if it's possible to call the standard reset function from within ResetTarget(). Like this:

      ResetTarget()
      {
      Reset(); // do standard built-in ndmreset
      do_additional_reset_of_forgotten_peripherals();
      }

      But thanks again for your answer.