This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] LAUNCHXL-F2800137:F2800137看门狗计时器溢出 MCU 复位

Guru**** 2318830 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1516260/launchxl-f2800137-f2800137-watch-dog-timer-overflow-mcu-reset

器件型号:LAUNCHXL-F2800137

工具/软件:

TI 团队大家好、
                     目前 我在看门狗计时器上工作。 我从 F2800137的驱动程序库示例中选择代码。  看门狗计时器溢出后 MCU 复位。 当我使用调试模式来执行代码时、在 看门狗计时器溢出时间->调试暂停。 我认为 MCU 应该复位。 仅使用 USB 电缆为 LaunchPad 上电并且未使用调试模式时、MCU 不会执行任何任务、例如切换引脚。 是在没有调试模式的情况下使用 LaunchPad 且 MCU 仅通过为电路板供电才能正常工作的任何方法。
此致、
Deepak
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

    Unknown 说:
    at watchdog timer overflow time->调试暂停。 我认为 MCU 应该被重置。

    调试被暂停意味着什么? 您是否暂停了?

    Unknown 说:
    当我只使用 USB 电缆为 LaunchPad 上电但不使用调试模式时、MCU 不会执行任何诸如切换引脚
    之类的任务

    您是否正确设置了引导模式、以便设备通过重置循环并引导至应用程序? 有关更多详细信息、请参阅"Bootrom"一章

    是任何在无调试模式下使用 LaunchPad 且 MCU 仅通过为电路板供电即可正常工作的方法。

    无论是否有调试器看门狗、看门狗的工作原理都是一样的。 对于以下调试模式看门狗行为、需要牢记一些注意事项:  

    谢谢

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    你说什么?"侯龙涛一皱眉,问道。 您是否暂停了?

    Deepak:不、我不会暂停处理。 当看门狗计时器溢出以复位 MCU 时、C28xx_CPU1自动从运行状态变为停止状态。

    //#############################################################################
    //
    // FILE:   empty_driverlib_main.c
    //
    //! \addtogroup driver_example_list
    //! <h1>Empty Project Example</h1> 
    //!
    //! This example is an empty project setup for Driverlib development.
    //!
    //
    //#############################################################################
    //
    //
    // $Copyright:
    // Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com/
    //
    // Redistribution and use in source and binary forms, with or without 
    // modification, are permitted provided that the following conditions 
    // are met:
    // 
    //   Redistributions of source code must retain the above copyright 
    //   notice, this list of conditions and the following disclaimer.
    // 
    //   Redistributions in binary form must reproduce the above copyright
    //   notice, this list of conditions and the following disclaimer in the 
    //   documentation and/or other materials provided with the   
    //   distribution.
    // 
    //   Neither the name of Texas Instruments Incorporated nor the names of
    //   its contributors may be used to endorse or promote products derived
    //   from this software without specific prior written permission.
    // 
    // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
    // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
    // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
    // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
    // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
    // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
    // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
    // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    // $
    //#############################################################################
    
    //
    // Included Files
    //
    #include "driverlib.h"
    #include "device.h"
    #include "board.h"
    #include "c2000ware_libraries.h"
    
    //
    // Globals
    //
    uint32_t wakeCount;
    uint32_t loopCount;
    
    //
    // Function Prototypes
    //
    __interrupt void wakeupISR(void);
    //
    // Main
    //
    void main(void)
    {
    
        //
        // Initialize device clock and peripherals
        //
        Device_init();
    
        //
        // Disable pin locks and enable internal pull-ups.
        //
        Device_initGPIO();
    
        //
        // Initialize PIE and clear PIE registers. Disables CPU interrupts.
        //
        Interrupt_initModule();
    
        //
        // Initialize the PIE vector table with pointers to the shell Interrupt
        // Service Routines (ISR).
        //
        Interrupt_initVectorTable();
    
        //
        // PinMux and Peripheral Initialization
        //
        Board_init();
    
        //
        // C2000Ware Library initialization
        //
        C2000Ware_libraries_init();
    
       //
        // Re-map watchdog wake interrupt signal to call the ISR function in this
        // example
        //
        //Interrupt_register(INT_WAKE, &wakeupISR);
    
        //
        // Clear the counters
        //
        wakeCount = 0;
        loopCount = 0;
    
        //
        // Set the watchdog to generate an interrupt signal or a reset signal
        //
        //SysCtl_setWatchdogMode(SYSCTL_WD_MODE_INTERRUPT);
         SysCtl_setWatchdogMode(SYSCTL_WD_MODE_RESET);
    
        //
        // Enable the watchdog wake interrupt signal
        //
        //Interrupt_enable(INT_WAKE);
        //
        // Enable Global Interrupt (INTM) and real time interrupt (DBGM)
        //
        EINT;
        ERTM;
    
        //
        // Reset the watchdog counter
        //
        SysCtl_serviceWatchdog();
    GPIO_writePin(myGPIO_OUT5, 1);
    
        //
        // Enable the watchdog
        //
        SysCtl_enableWatchdog();
    
        while(1)
        {
            loopCount++;
        if(loopCount>500)
          GPIO_writePin(myGPIO_OUT5, 0);  
        //GPIO_togglePin(myGPIO_OUT5);
        if(loopCount<1000)
        {
          DEVICE_DELAY_US(12000);
          SysCtl_serviceWatchdog();
        }
        else if(loopCount>=1000)
          DEVICE_DELAY_US(15000);    
            //
            // Uncomment SysCtl_serviceWatchdog to just loop here.
            // Comment SysCtl_serviceWatchdog to have watchdog timeout and trigger
            // an interrupt signal to execute the wakeupISR
            //
             //SysCtl_serviceWatchdog();        
        }
    }
    
    //
    // Wakeup ISR - The interrupt service routine called when the watchdog
    //              triggers the wake interrupt signal
    //
    /*
    __interrupt void
    wakeupISR(void)
    {
        wakeCount++;
    if(wakeCount>1000)
      SysCtl_setWatchdogMode(SYSCTL_WD_MODE_RESET);
        //
        // Acknowledge this interrupt located in group 1
        //
        Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);
    }
    */
    //
    // End of File
    //
    

    Prathan Bhatt 说: 您是否正确设置了引导模式、使设备通过重置循环并引导至应用程序? 有关更多详细信息、请参阅"Bootrom"一章?

    Deepak:-我将引导模式用作闪存。就像我在 F2800137 LaunchPad 上 S3的两个跳线(GPIO24、GPIO32)上切换一样。

    感谢您的反馈、

    Deepak

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    c28xx_CPU1在看门狗计时器溢出以复位 MCU 时自动从运行状态变为停止阶段。

    好的、它在重置矢量上吗?

    这看起来像因为调试器已连接、您需要将仿真引导模式设置为闪存。

    您可以在此处查看此 e2e 帖子: https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1416246/tms320f280049c-280049c/5439795?tisearch=e2e-sitesearch&keymatch=emulation%2520boot%2520mode%2520scripts%2520prarthan%2520bhatt#5439795 

    谢谢

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    2天前我自己解决了这个问题。

    谢谢  

    Deepak