Other Parts Discussed in Thread: , CC2650STK, , LAUNCHXL-CC2650, CC2650
Tool/software: TI-RTOS
Environment:
CC2640F128 (our custom board based on LSR SaBLE x R3)
ti\simplelink\ble_sdk_2_02_02_25
TI RTOS 2.21.1.08
Compiler TI v 16.9.11 LTS
CCS 8.2.0.00007
Added watchdog driver from the TI-RTOS to SimplePeripheral example. Also added the following piece of code.
in the Application
static Watchdog_Handle wdtHandle=NULL;
#define ENABLE_WDT 1
#define WDT_TICKS (200)
// 1200000 ==> 1 min ??
// 15000 ==> 1sec (WDT runs always at 48MHz/32)
// 2000 ==> timeout period to 100 ms ?
void watchdogTimerCallback(UArg handle)
{
Watchdog_clear(wdtHandle);
// Perform the equivalent of a PIN Reset (hard reset).
// The cc26xx system has not been design to handle soft reset.
// Making a soft reset can make the system unstable.
// All soft reset needs to be replace by Hard reset.
SysCtrlSystemReset(); // SysCtrlSystemReset() instead of HAL_SYSTEM_RESET()
}
void watchdogtimer_init()
{
Watchdog_Params wdParams;
uint32_t tickValue;
// open watchdog
Watchdog_init();
Watchdog_Params_init(&wdParams);
wdParams.resetMode = Watchdog_RESET_OFF; // or Watchdog_RESET_OFF ??
wdParams.debugStallMode = Watchdog_DEBUG_STALL_ON; // or Watchdog_DEBUG_STALL_ON ??
wdParams.callbackFxn = watchdogTimerCallback;
wdtHandle = Watchdog_open(Board_WATCHDOG, &wdParams); // CC2650STK_WATCHDOG0
tickValue = Watchdog_convertMsToTicks(wdtHandle, WDT_TICKS);
Watchdog_setReload(wdtHandle, tickValue);
}
Board header file
/*!
* @def CC2650STK_WatchdogName
* @brief Enum of Watchdogs on the CC2650STK dev board
*/
typedef enum CC2650STK_WatchdogName {
CC2650STK_WATCHDOG0 = 0,
CC2650STK_WATCHDOGCOUNT
} CC2650STK_WatchdogName;
/* Generic Watchdog instance identifiers */
#define Board_WATCHDOG CC2650STK_WATCHDOG0
Board c file
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_SECTION(Watchdog_config, ".const:Watchdog_config")
#pragma DATA_SECTION(watchdogCC26XXHWAttrs, ".const:watchdogCC26XXHWAttrs")
#endif
#include "WatchdogCC26XX.h"
WatchdogCC26XX_Object watchdogCC26XXObjects[CC2650STK_WATCHDOGCOUNT];
const WatchdogCC26XX_HWAttrs watchdogCC26XXHWAttrs[CC2650STK_WATCHDOGCOUNT] = {
{
.baseAddr = WDT_BASE,
.intNum = INT_WDT_IRQ,
.reloadValue = 1000 /* Reload value in milliseconds */
},
};
const Watchdog_Config Watchdog_config[CC2650STK_WATCHDOGCOUNT] = {
{
.fxnTablePtr = &WatchdogCC26XX_fxnTable,
.object = &watchdogCC26XXObjects[Board_WATCHDOG], /* CC2650STK_WATCHDOG0 */
.hwAttrs = &watchdogCC26XXHWAttrs[Board_WATCHDOG] /* CC2650STK_WATCHDOG0 */
},
};
const uint_least8_t Watchdog_count = CC2650STK_WATCHDOGCOUNT;
This does not work.
Same code, with small relevant modifications (like, board LAUNCHXL instead of CC2650STK) in the CC2640R2F , LAUNCHXL-CC2640R2 eval board environment - simplelink_cc2640r2_sdk_2_40_00_32, compiler TI v 18.1.5 LTS, SimpleLink R2 SDK 2.40.0.32
is working. I am able to see oscilloscope probing the RED / GREEN LEDs .. that there are watchdog resets happening.
What's the solution? (for our custom board - having already designed on CC2640F128 )