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.

CC2650 SensorTag project crashes when I try to blink LED.

Other Parts Discussed in Thread: CC2650, SYSBIOS

I set up the SensorTag project in CCS according to the Debug_DevPack_User_Guide. The project works, when I connect the CC2650 through the devpack I can debug it.

I wanted to see how can I execute some of my own code, so I modified main.c like this:

int main()
{
  PIN_init(BoardGpioInitTable);

#ifndef POWER_SAVING
  /* Set constraints for Standby and Idle mode */
  Power_setConstraint(Power_SB_DISALLOW);
  Power_setConstraint(Power_IDLE_PD_DISALLOW);
#endif // POWER_SAVING

  /* Initialize ICall module */
  ICall_init();

  /* Start tasks of external images - Priority 5 */
  ICall_createRemoteTasks();

  /* Kick off profile - Priority 3 */
  GAPRole_createTask();

  /* Kick off application - Priority 1 */
  SensorTag_createTask();
  SensorTagTmp_createTask();
  SensorTagHum_createTask();
  SensorTagBar_createTask();

  SensorTag_blinkLed(Board_LED1,10);
  SensorTag_blinkLed(Board_LED2,10);

  BIOS_start();     /* enable interrupts and start SYS/BIOS */


  return 0;
}

When SensorTag_blinkLed(Board_LED1,10); gets called it turns on the red LED, then everything stops and the LED stays turned on. I tried debbuging it through breakpoints, and it seems after delay_ms(BLINK_DURATION); is called it never returns to the method that called it.

Am I doing something wrong? I tried calling SensorTag_blinkLed after BIOS_start(), but it seems the main function never executes anything after BIOS_start() is called.

  • Hi Marcin,

    I would blink the led in another function other than main.c. For example, I would put it in

    SensorTag_init() function in SensorTag.c file after the pins have been initialized ie.

    // Handling of buttons, LED, relay

    hGpioPin = PIN_open(&pinGpioState, SensortagAppPinTable);

  • I tried that, but it never gets executed. The furthest I've traced the code execute is 

    Task_construct(&sensorTagTask, SensorTag_taskFxn, &taskParams, NULL);

    After that it should call SensorTag_init() in the SensorTag_taskFxn() but that never happens. From what I can see the ti_sysbios_knl_Task_construct function never gets called.