Please enable JavaScript to view this site.

winIDEA Help

Version: 9.21.241

Navigation: Debugging > How-to guides

Scroll Prev Top Next More

Watchdog

In this topic:

Introduction

How to find out if you have Watchdog issue?

Detecting Watchdog via winIDEA

Checking for reset messages via logging

Solution: Disabling External Watchdog on your Target

Solution: Disabling External or Internal Watchdog via scripts

Solution: Disabling Internal Watchdog at initialization via winIDEA

 

 

Introduction

Active Watchdog issue is one of the most common issues you experience when trying to debug.

Main function of a Watchdog (WDOG) or a Watchdog Timer (WDT) is to detect if something went wrong and recover from software malfunctions by resetting the chip.

 

It is a timer that starts counting from 0 and when it reaches a certain value, it performs an action (e.g. reset), which is specified by the developer. To prevent this the Watchdog has to be periodically fed or kicked - that means you have to reset the counter and set it to 0 so it doesn't reach a timeout and reset the chip.

 

Why Watchdog?

Finished application  - Active Watchdog prevents any faulty states or malfunctions.

Start of a development - You don’t want Watchdog resetting your chip all the time, because you’re actively trying to write and debug the application. Constant resets can slow you down or even prevent you from downloading the application to the chip.

 

Types

Internal Watchdog - Implemented on the chip and internal to the MCU; it can be easily disabled by a simple write to a register.

External Watchdog / System Basis Chip (SBC) - Implemented separately as a separate chip or board and it can reset MCU or even cut power; harder to disable, because it’s independent from the CPU.

 

watchdogtimer

 

 

How to find out if you have Watchdog issue?

You first notice the following issues in winIDEA:

You can’t perform a Download

Your application doesn’t run as expected

winIDEA displays error messages:

oUMI error

oFailed to initialize the debug session

oError 258

oChip in reset

oCannot stop the CPU

oError programming

oExternal reset detected - possible watchdog activity

 

watchdog-reset-progress

 

 

Detecting Watchdog via winIDEA

Watchdog detection is checked only after Reset / Program / Attach is performed from a disconnected debugger and not on every Reset / Program / Attach. The detection feature is disabled by default.

 

number1

Open Hardware / CPU Options / Reset.

 

number2

Check Detect watchdog option and define ms.

You can specify the time period (in milliseconds) for checking the target's reset.

The Progress window will display the results., e.g. Detecting watchdog activity for 10000 milliseconds. Reset asserted, probably watchdog activity.

 

 

Checking for reset messages via logging

number1

Power-cycle the BlueBox or select Debug / End Session.

This way you will ensure the log file will start with a connection to the BlueBox.Status shown in winIDEA must be OFFLINE.

 

number2

Configure settings in Hardware  / CPU Options / Reset.

Enable option Latch target RESET and disable Stop after target RESET.

 

number3

Create a log file via Help / Support / Log.

1. Check options 0, 1, 3, 4, 6, 28, 33. To avoid too much information in the log files don't enable too many options if it's not required.

2. Select Debug level and Absolute time.

3. Press the Clear button and copy the Log file path to open it later in the text editor.

 

Number4

Execute CPU Reset and open the log file.

The first reset is issued by the BlueBox. If several TRESET or Target RESET strings are found in the log file this indicates a watchdog reset (periodic reset) or other external source are resetting the CPU.

 

If Stop after target RESET is enabled as well, BlueBox will not try to re-establish connection with the CPU, logging will be stopped after first reset, otherwise logging will continue.

 

logfile-example

 

Possible solutions

winIDEA offers various solutions to disable internal or / and external watchdog.

Beside the solutions listed below, there is also an option that you have the watchdog enabled in your code.

 

 

Solution: Disabling External Watchdog on your Target

If you get periodic resets measured on your target, disable the External Watchdog on your Target.

 

number1

Make sure you are not using any external watchdog chip.

For example Infineon TLE9278QX, TLE7368, TLF35584, NXP UJA113X.

 

number2

Use a pull-up resistor instead of a pull-down resistor.

Chip has an input TM (Test Mode) where this operation can be disabled.

BlueBox signal PORST’ is an open drain with 1K Ohm pull-up resistor which can be pulled down by the External Watchdog chip. CPU behaves as a multiple output system power supply and when the watchdog is enabled, this chip expects that it is disabled in ~600ms after power on reset. If it is not disabled, it resets the chip. After that multiple output system power supply is turned off and hence cuts the power to the chip.

 

resets-target-watchdog

 

 

Solution: Disabling External or Internal Watchdog via scripts

If you get periodic resets measured on your target, disable the External or Internal Watchdog via scripts.

 

number1

Open Hardware  / CPU Options / Reset.

 

number2

Type 2000 (ms) in Target RESET timeout field.

In most cases 2000 ms in enough.

 

number3

Select a script from the SFR folder via Initialization before Programming / Initialize.

For example, select:

TC3xx_disableWDT.cpp to disable Internal Watchdog on TC3xx or

TC3X9_TLF35584_disable_stepA.ini to disable External Watchdog on the TLF chip (see Target folder).

 

i-icon

Infineon TriCore example - The sequence must be executed before 600ms expires (that is time after after target power on and not after reset). It initializes SPI in the chip and via SPI communication disables watchdog in the TLF chip.

 

winidea-ini-watchdog

 

 

Solution: Disabling Internal Watchdog at initialization via winIDEA

Option is available in the Hardware / CPU Options / Reset and it's checked by default on devices which have an Internal Watchdog.

If Internal Watchdog is not supported, this option is greyed out.

Internal Watchdog is disabled at Default and Custom Initialization.

 

disable-wdog-winidea

 

 

Copyright © 2024 TASKING Germany GmbH