Part Number: CC2630
Other Parts Discussed in Thread: CC2650, TIMAC, UNIFLASH, , CC2651R3, SYSBIOS
I am working with TIMAC (tirtos_simplelink_2_11_01_09) and trying to write a simple app that blinks some LEDs. This program works as expected when during debugging sessions but when I disconnect power and plug back in it will fire a single timer event then freeze. If I go into Uniflash and issue a CPU or System reset the LEDs blink as desires. If I issue a board reset the LEDs never turn on at all. I'm working backwards from the msa_cc2650 example app so there is a lot of bloated code here, but the relevant portions are
Void main()
{
Task_Params taskParams;
// set RFC mode to support IEEE802.15.4
// Note: This must be done before the RF Core is released from reset!
SET_RFC_MODE( RFC_MODE_IEEE );
// enable iCache prefetching
VIMSConfigure(VIMS_BASE, TRUE, TRUE);
// Enable cache
VIMSModeSet( VIMS_BASE, VIMS_MODE_ENABLED );
/* Initialization for board related stuff such as LEDs
* following TI-RTOS convention */
PIN_init(BoardGpioInitTable);
// Configure task.
Task_Params_init(&taskParams);
taskParams.stack = myTaskStack;
taskParams.stackSize = MSA_TASK_STACK_SIZE;
taskParams.priority = 1;
Task_construct(&myTask, taskFxn, &taskParams, NULL);
BIOS_start(); /* enable interrupts and start SYS/BIOS */
}
/**************************************************************************************************
* GLOBAL VARIABLES
**************************************************************************************************/
/* Clock resorces */
static Clock_Params msaLed4Params;
static Clock_Struct msaLed4;
/** LED globals */
static PIN_Config ledPinTable[] = {
Board_LED1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED1 initially off */
Board_LED2 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED2 initially off */
Board_LED3 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED2 initially off */
Board_LED4 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED2 initially off */
PIN_TERMINATE /* Terminate list */
};
/* LED pin state */
static PIN_State ledPinState;
/* LED Pin Handle */
PIN_Handle ledPinHandle;
static void MSA_ClockFxn(UArg param)
{
static bool index = false;
PIN_setOutputValue(ledPinHandle, Board_LED1, index ? Board_LED_ON : Board_LED_OFF);
PIN_setOutputValue(ledPinHandle, Board_LED3, index ? Board_LED_ON : Board_LED_OFF);
PIN_setOutputValue(ledPinHandle, Board_LED2, index ? Board_LED_OFF : Board_LED_ON);
PIN_setOutputValue(ledPinHandle, Board_LED4, index ? Board_LED_OFF : Board_LED_ON);
index = !index;
}
static void MSA_Init(void)
{
UInt msaLed4Period = MSA_LED4_INITIAL_PERIOD * 1000 / Clock_tickPeriod;
ledPinHandle = PIN_open(&ledPinState, ledPinTable);
/* Initialize clock poll parameters */
Clock_Params_init(&msaLed4Params);
/* Create a periodic poll timer */
msaLed4Params.period = msaLed4Period;
msaLed4Params.startFlag = TRUE;
msaLed4Params.arg = (UArg)MSA_LED4_EVENT;
Clock_construct(&msaLed4, MSA_ClockFxn, msaLed4Period, &msaLed4Params);
}
void msa_task(void)
{
/* Initialize application */
MSA_Init();
/* No return from MSA process */
//MSA_Process();
}