Other Parts Discussed in Thread: CC2541
关于TI CC1310遇到一个问题,就是会出现长时间掉线的情况,我这边初步判定是程序跑死看门狗没起作用,测试发现,看门狗没起作用,不知道是我这边配置有问题还是有什么限制
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.
您好,
如果是低功耗的话使用PM3模式下,内外部的32k晶振不起作用是无法使用看门狗的。
建议您这边先使用TI提供的例程去跑看门狗程序,没问题之后,再去进行您这边的项目移植。
/*!***************************************************************************** * @file Watchdog.h * * @brief Watchdog driver interface * * @anchor ti_drivers_Watchdog_Overview * # Overview # * * A watchdog timer can be used to generate a reset signal if a system has * become unresponsive. The Watchdog driver simplifies configuring and * starting the watchdog peripherals. The watchdog peripheral can be * configured with resets either on or off and a user-specified timeout * period. * * When the watchdog peripheral is configured not to generate a reset, it * can be used to cause a hardware interrupt at a programmable interval. * The driver provides the ability to specify a user-provided callback * function that is called when the watchdog causes an interrupt. * * The Watchdog driver simplifies configuring and starting the Watchdog * peripherals. The Watchdog can be set up to produce a reset signal after a * timeout, or simply cause a hardware interrupt at a programmable interval. * The driver provides the ability to specify a callback function that is * called when the Watchdog causes an interrupt. * * When resets are turned on, it is the user application's responsibility to * call Watchdog_clear() in order to clear the Watchdog and prevent a reset. * Watchdog_clear() can be called at any time. * * @anchor ti_drivers_Watchdog_Usage * # Usage # * * This section will cover driver usage. * @anchor ti_drivers_Watchdog_Synopsis * ## Synopsis # * * Open the driver with default settings: * @code * Watchdog_Handle watchdogHandle; * * Watchdog_init(); * watchdogHandle = Watchdog_open(WATCHDOG_INDEX, NULL); * if (watchdogHandle == NULL) { * // Spin forever * while(1); * } * @endcode * * The Watchdog driver must be initialized by calling Watchdog_init(), * before any other Watchdog APIs can be called. * Once the watchdog is initialized, a Watchdog object can be created * through the following steps: * - Create and initialize the #Watchdog_Params structure. * - Assign desired values to parameters. * - Call Watchdog_open(). * - Save the Watchdog_Handle returned by Watchdog_open(). This will be * used to interact with the Watchdog object just created. * * To have a user-defined function run at the hardware interrupt caused by * a watchdog timer timeout, define a function of the following type: * @code * typedef void (*Watchdog_Callback)(uintptr_t); * @endcode * Then pass the function to Watchdog_open() through the #Watchdog_Params * structure. * * An example of the Watchdog creation process that uses a callback * function: * @anchor ti_drivers_Watchdog_example_callback * @code * void UserCallbackFxn(Watchdog_Handle handle) * { * printf("Watchdog timer triggered!\n"); * releaseResources(); * } * * ... * * Watchdog_Params params; * Watchdog_Handle watchdogHandle; * * Watchdog_init(); * * Watchdog_Params_init(¶ms); * params.resetMode = Watchdog_RESET_ON; * params.callbackFxn = (Watchdog_Callback) UserCallbackFxn; * * watchdogHandle = Watchdog_open(Board_WATCHDOG0, ¶ms); * if (watchdogHandle == NULL) { * // Error opening Watchdog * while (1); * } * * @endcode * * If no #Watchdog_Params structure is passed to Watchdog_open(), the * default values are used. By default, the Watchdog driver has resets * turned on, no callback function specified, and stalls the timer at * breakpoints during debugging. * * Options for the resetMode parameter are #Watchdog_RESET_ON and * #Watchdog_RESET_OFF. The latter allows the watchdog to be used like * another timer interrupt. When resetMode is #Watchdog_RESET_ON, it is up * to the application to call Watchdog_clear() to clear the Watchdog * interrupt flag to prevent a reset. Watchdog_clear() can be called at * any time. * * @anchor ti_drivers_Watchdog_Examples * # Examples * - @ref ti_drivers_Watchdog_Synopsis "Default Example" * - @ref ti_drivers_Watchdog_example_callback "Callback Function before watchdog reset" * * @anchor ti_drivers_Watchdog_Configuration * # Configuration * * Refer to the @ref driver_configuration "Driver's Configuration" section * for more information. * ******************************************************************************* */
在TI提供的watchdog.h中也进行了看门狗的说明
cc1310看门狗的复位时间是多少? - 低于 1GHz 论坛 - 低于 1GHz - E2E 设计支持 (ti.com)
这边给您找到了相关问题的帖子,希望能帮助到您