[SOLVED] Have Ozone disable Watchdog?

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

  • [SOLVED] Have Ozone disable Watchdog?

    Working on an STM32L072 system where the watchdog is enabled.

    If execution breaks or is halted manually, the WD will restart the system.

    The STM32L072 has a DBG_APB1_FZ register to "freeze" the WD (among other things) when the core is halted.

    This should be accessible to the J-Link - so how do I do it.

    I see the JLINK_MEM_WriteU32() command in the J-Link script files wiki:

    wiki.segger.com/J-Link_script_files#JLINK_MEM_WriteU32.28.29

    and there's Exec.Command() in the Ozone manual.

    So is it just a case of putting Exec.Command( "JLINK_MEM_WriteU32( 0x4001 5808, 0x1800)" ) at an appropriate place in the Ozone project?

    And where would be an "appropriate place" ?
  • Aha: Ozone itself has Target.WriteU32()

    So this seems to work:

    Source Code

    1. /*********************************************************************
    2. *
    3. * AfterTargetReset
    4. *
    5. * Function description
    6. * Event handler routine. Optional.
    7. * The default implementation initializes SP and PC to reset values.
    8. **
    9. **********************************************************************
    10. */
    11. void AfterTargetReset (void) {
    12. Target.WriteU32( 0x40015808, 0x1800 ); // Set DBG_IWDG_STOP and DBG_WWDG_STOP bits in DBG_APB1_FZ
    13. _SetupTarget();
    14. }
    Display All
  • Hello,

    Thank you for your inquiry.
    Yes that would be one correct approach.
    You can of course also use a JLinkScript and SetupTarget().

    Ozone generally offers all needed target manipulation actions like read, write, reset etc.
    See the Ozone manual for more information.

    For completeness. Exec.Command is only meant to be used for J-Link Command strings:
    wiki.segger.com/J-Link_Command_Strings

    Best regards,
    Nino
    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.