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.

CC2640 WatchDog導致不廣播和Timer停止

Other Parts Discussed in Thread: CC2650, SYSBIOS

我開啟看門狗後,除了看門狗可以正常動作,其他任務感覺都停止了,想請問解決的方式,因為我是做整個系統,如果一個停止我要的功能就都不會工作了

IDE:ARM8.30

BLE SDK:tirtos_cc13xx_cc26xx_2_21_01_08

CC26XX_LAUNCHXL.h

/*!
* @def CC2650_WatchdogName
* @brief Enum of Watchdogs on the CC2650 dev board
*/
typedef enum CC2650_WatchdogName {
CC2650_WATCHDOG0 = 0,
CC2650_WATCHDOGCOUNT
} CC2650_WatchdogName;

/*!
* @def SENSORTAG_CC2650_WatchdogName
* @brief Enum of Watchdogs on the SENSORTAG_CC2650 dev board
*/
typedef enum SENSORTAG_CC2650_WatchdogName {
SENSORTAG_CC2650_WATCHDOG0 = 0,
SENSORTAG_CC2650_WATCHDOGCOUNT
} SENSORTAG_CC2650_WatchdogName;

CC26XX_LAUNCHXL.c

* ============================= WatchDog Begin===========================
*/
#include <ti/drivers/Watchdog.h>
#include <ti/drivers/watchdog/WatchdogCC26XX.h>

/* Watchdog objects */
WatchdogCC26XX_Object watchdogCC26XXObjects[SENSORTAG_CC2650_WATCHDOGCOUNT];

/* Watchdog configuration structure */
const WatchdogCC26XX_HWAttrs watchdogCC26XXHWAttrs[SENSORTAG_CC2650_WATCHDOGCOUNT] = {
// SENSORTAG_CC2650_WATCHDOG0 with 1 sec period at default CPU clock freq
{WDT_BASE, INT_NMI_FAULT},
};

const Watchdog_Config Watchdog_config[] = {
{&WatchdogCC26XX_fxnTable, &watchdogCC26XXObjects[Board_WATCHDOG0], &watchdogCC26XXHWAttrs[Board_WATCHDOG0]},
{NULL, NULL, NULL},
};

/*
* ============================= WatchDog End============================

WatchDog相關函數

/*********************************************************************
* INCLUDES
*/
#include "board.h"
#include "board_watchdog.h"
#include <ti/sysbios/knl/Clock.h>
/*********************************************************************
* GLOBAL VARIABLES
*/
Watchdog_Handle g_watchdogHandle;
void watchdogCallback(uintptr_t handle);
/*********************************************************************
* LOCAL FUNCTIONS
*/

/**
@brief 软件看门狗的定时回调函数
@param none
@return none
*/
void watchdogCallback(uintptr_t handle)
{
GPIO_setOutputEnableDio(27,GPIO_OUTPUT_ENABLE);
GPIO_toggleDio(27);
Watchdog_clear((Watchdog_Handle)handle); // 喂狗
}

/*********************************************************************
* PUBLIC FUNCTIONS
*/

/**
@brief 软件看门狗的初始化函数
@param none
@return none
*/
void Watchdog_Init(void)
{
Watchdog_Params params;
uint32_t tickValue;
Watchdog_init();
Watchdog_Params_init(&params);
params.callbackFxn = watchdogCallback;
params.debugStallMode = Watchdog_DEBUG_STALL_ON;
params.resetMode = Watchdog_RESET_ON;

g_watchdogHandle = Watchdog_open(Board_WATCHDOG0, &params);
if(g_watchdogHandle == NULL)
{
/* Error opening Watchdog */
while (1) {}
}
Watchdog_setReload(g_watchdogHandle, 1500000); // 1sec (WDT runs always at 48MHz/32)
//tickValue = Watchdog_convertMsToTicks(g_watchdogHandle, 1000);
//Watchdog_setReload(g_watchdogHandle, tickValue);
}

/*************************************END OF FILE*************************************/

Simple_peripheal.c

init中的函數呼叫

Watchdog_Init();

在WatchDog觸發復位後,我的廣播還有其他行程都停止了,想請問為什麼會這樣