• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Microcontrollers » C2000™ Microcontrollers » C2000 32-bit Microcontrollers Forum » Watchdog re-enables itself
Share
C2000™ Microcontrollers
  • Forums
  • Announcements
  • E2E Wiki
Options
  • Subscribe via RSS
C2000 Resources
  • Product Folder
  • C2000 Training Portal
  • C2000 Technical Training Catalog
  • C2000 Datasheets, App Notes, User Guides
  • C2000 Hardware Design Kits
  • controlSUITE for C2000 Software Library


  • InstaSPIN Resources
  • What is InstaSPIN?
  • Videos and Support


  • InstaSPIN-FOC and InstaSPIN-MOTION Resources
  • What is InstaSPIN-FOC?
  • What is InstaSPIN-MOTION?
  • InstaSPIN Simulation Tool
  • Product Folder: F28069F, F28068F, F28062F, F28068M, F28069M
  • User’s Guide
  • Technical User’s Manual
  • Tools
  • Forums

    Watchdog re-enables itself

    This question is not answered
    Investigator
    Posted by Investigator
    on Apr 24 2012 07:43 AM
    Intellectual500 points

    Hello,

    I disable the watchdog at the start of my application (WDCR shows up as 0x0040, which means the watchdog is disabled).

    For some reason, when stepping through my code after some time, the watchdog gets re-enabled (and the SYSCTRL registers get messed up) without any apparent reason. It is roughly at the same location that this occurs, but not exactly the same location each time...

    Would anyone have any idea about why this is happening?

    Many thanks for any help!

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Vivek Singh
      Posted by Vivek Singh
      on Apr 24 2012 08:35 AM
      Intellectual2250 points

      Hi,

      Sometime I have seen this happening due to stack overflow.  Please check if same thing is happening in your case too.

      Regards,

      Vivek Singh

       

      If my reply answers your question please click on the green button "Verify Answer".

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Santosh Athuru
      Posted by Santosh Athuru
      on Apr 24 2012 13:57 PM
      Expert7660 points

      Hi,

      few questions:-

      How are you disabling the watchDOG? are you using driverlib/headerfiles provided function call? which device is this question on? Can you copy paste the code that you are using to disable watchdog? Are you doing any debug reset after you disable watchdog? are you setting WDOVERRIDE bit after you disable watchDOG - just to be sure that this is not being reset in any interrupt?

      Also make sure that device is not getting reset when you are trying to write to this location, check for WDCHK bits and WDOVERRIDE bits.

       

      Best Regards

      Santosh

       

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Investigator
      Posted by Investigator
      on Apr 26 2012 09:14 AM
      Intellectual500 points

      Dear Santosh,

      1. I disable the watchdog by setting the WDDIS bit to 1 (code excerpt below).
      2. I am not using the "driverlib/headerfiles" to disable the watchdog.
      3. What is a debug reset?
      4. I do not set the WDOVERRIDE bit, and I can see it stays at 1 even after the watchdog got re-enabled.

      I don't understand your last phrase.

      To the first reply: the stack size is large (0x1000), and using the memory viewer, I can see that only the first few dozen words are used.

      Best regards

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Investigator
      Posted by Investigator
      on Apr 26 2012 09:36 AM
      Intellectual500 points

      I forgot to give the excerpt of my source code to disable the watchdog. Here it is:


      // Bits in the WDCR register
      const Uint16 kWdcrWdchk  = 0x0028;
      const Uint16 kWdcrWddis  = 0x0040;
      const Uint16 kWdcrWdflag = 0x0080;


      void WatchdogInit()
      {
          EALLOW;

          // WDCR register
          //  WDPS=0   - Watchdog prescaler: will be set later
          //  WDCHK    - Fixed value used for control
          //  WDDIS=1  - Disable the watchdog for now
          //  WDFLAG=1 - Reset the watchdog flag
          SysCtrlRegs.WDCR = kWdcrWdchk | kWdcrWddis | kWdcrWdflag;

          EDIS();
      }

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Santosh Athuru
      Posted by Santosh Athuru
      on Apr 26 2012 11:21 AM
      Expert7660 points

      Which device is this?

      can you quickly try the below code instead of yours and let us know if it works. Also are you running the code from flash and in stand-alone mode (without debugger)? Debug reset, is the target reset that you initiate via CCS.

      EALLOW;

      SysCtrlRegs.WDCR = 0x0068; // Disable watchdog module

      EDIS;

       

      Best Regards

      Santosh

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Investigator
      Posted by Investigator
      on Apr 27 2012 03:27 AM
      Intellectual500 points

      Dear Santosh,

      It's a TMS320F28335.

      I tried WDCR=0x68 as suggested, which does not work. That was to be expected because that's what I was doing before.

      If there a way to put a breakpoint to when this register is changed? I am using CCS 4.2.4 with an XDS100 emulator.

      Many thanks for your help!

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Santosh Athuru
      Posted by Santosh Athuru
      on Apr 27 2012 09:55 AM
      Expert7660 points

      Hi,

      Are you able to identify which part of your code is causing watchDOG to re-enable. I think this is just a symptom not cause. WatchDOG is a pretty stable module and exists across all C28x devices. If you have any other F28335 device/board with you can you try on that. If you don't see issue on anyother device then this one is a bad device (I highly doubt this would be the case, but just to strike off another variable out of equation).

      I suspect something else is going wrong in your device and is getting reset and on reset WatchDOG is being reenabled automatically. Here is what you can do...

      After you connect the device, do a debug reset and in dis-assmebly window put a break point whereever the PC is at - at reset. If you do that you will be able to catch if device is getting reset. Now load your program and put a break point afer you write to WDCR to disable watchDOG and run. Check WDCR register in memory window and run, see if it hits reset.

      Now, do you enable PIE in your application? if so what does your iTRAP handlers  and unsupported interrupt handlers do? do they enable watchDOG? do enable watchDOG in any part of your applicaiton code?

      Regarding below, I haven't explored that option - break on memory location value change, I always miss that and always find another way to debug the issue.

      Investigator

      If there a way to put a breakpoint to when this register is changed? I am using CCS 4.2.4 with an XDS100 emulator.

       

      Best Regards

      Santosh

       

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Investigator
      Posted by Investigator
      on Apr 30 2012 11:20 AM
      Intellectual500 points

      Dear Santosh,

      I tried your first suggestion. I swapped my board for a colleague's, and the problem disappeared! So it looks like a hardware problem on our side.

      That should have been for me the first thing to try... My apologies for wasting your time...

      Best regards,

        Fabrice

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use