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.

Task does not create dynamically on CC2640

Other Parts Discussed in Thread: CC2640, CC2650, SYSBIOS

Hello,

When I ran bellow code on CC2650 + smartrf06 evolution board its fine means Task created dynamically and its run. but same code ran on CC2640 (other board my project developed board). TaskFxn does not work. I have changed board files as per my needs. What should I change to run same code on my developed board. Any guidance would be appreciated. 


#include "Board.h"
#include "delay.h"

#include <stdint.h>
#include <xdc/runtime/Error.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/knl/Task.h>
#include "LED_Blinking.h"
#include <ti/drivers/PIN.h>
#include <ti/drivers/pin/PINCC26XX.h>

static char uartTaskStack[512];
static Task_Struct uartTask;

Task_Handle task;
Task_Params tp;
Error_Block eb;

static PIN_Handle ledPinHandle;
static PIN_State ledPinState;

#define DELAY 1000

void LEDTaskFxn(UArg arg0, UArg arg1)
{
ledPinHandle = PIN_open(&ledPinState, BoardGpioInitTable);
uint8_t i;
for (i=0; i<4; i++)
{
PIN_setOutputValue(ledPinHandle, PIN_ID(Board_LED1),Board_LED_ON);
delay_ms(DELAY);
PIN_setOutputValue(ledPinHandle, PIN_ID(Board_LED1),Board_LED_OFF);
delay_ms(DELAY);
}
}

void LED_Task()
{
Error_init(&eb);
Task_Params_init(&tp);
tp.stack = uartTaskStack;
tp.stackSize = sizeof(uartTaskStack);
tp.priority = 3;
task = Task_create(LEDTaskFxn, &tp, &eb);
if (task == NULL) {
System_printf("Task create failed");
}
else {
System_printf("Task created");
}
}

When I debugging this code on CC2640 its print highlighted part but does not run LEDTaskFxn.

I have attached main.c file

/**
  @file  main.c
  @brief main entry of the BLE stack sample application.

  <!--
  Copyright 2013 - 2014 Texas Instruments Incorporated. All rights reserved.

  IMPORTANT: Your use of this Software is limited to those specific rights
  granted under the terms of a software license agreement between the user
  who downloaded the software, his/her employer (which must be your employer)
  and Texas Instruments Incorporated (the "License").  You may not use this
  Software unless you agree to abide by the terms of the License. The License
  limits your use, and you acknowledge, that the Software may not be modified,
  copied or distributed unless embedded on a Texas Instruments microcontroller
  or used solely and exclusively in conjunction with a Texas Instruments radio
  frequency transceiver, which is integrated into your product.  Other than for
  the foregoing purpose, you may not use, reproduce, copy, prepare derivative
  works of, modify, distribute, perform, display or sell this Software and/or
  its documentation for any purpose.

  YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
  PROVIDED ``AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
  INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
  NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
  TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
  NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
  LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
  INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
  OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
  OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
  (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.

  Should you have any questions regarding your right to use this Software,
  contact Texas Instruments Incorporated at www.TI.com.
  -->
*/

#include <xdc/std.h>

#include <xdc/runtime/Error.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/family/arm/cc26xx/Power.h>
#include <ti/sysbios/family/arm/cc26xx/PowerCC2650.h>
#include <ti/sysbios/BIOS.h>
#ifdef POWER_SAVING
#include <ti/sysbios/hal/Hwi.h>
#include <ti/sysbios/knl/Clock.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/knl/Swi.h>
#include <stdbool.h>
#include <driverlib/aon_rtc.h>
#include <driverlib/aon_wuc.h>
#include <driverlib/aux_wuc.h>
#endif
#include <driverlib/ioc.h>
#include "ICall.h"
#include "Board.h"

#include "bcomdef.h"
#include "peripheral.h"
#include "dataloggerSensor.h"
#include "Modbus.h"
//#include "LED_Blinking.h"

/* Header files required to enable instruction fetch cache */
#include <inc/hw_memmap.h>
#include <driverlib/vims.h>

#ifndef USE_DEFAULT_USER_CFG

#include "bleUserConfig.h"

// BLE user defined configuration
bleUserCfg_t user0Cfg = BLE_USER_CFG;

#endif // USE_DEFAULT_USER_CFG

/**
 * Exception handler
 */
void exceptionHandler()
{
	volatile uint8_t i = 1;
    while(i){}
}

#ifdef FEATURE_OAD_BIM
extern uint32_t __vector_table;
#endif //FEATURE_OAD_BIM

/*
 *  ======== main ========
 */
// void uart_createTask();
   
Void main()
{
  PIN_init(BoardGpioInitTable);

  //enable iCache prefetching
   VIMSConfigure(VIMS_BASE, TRUE, TRUE);
   
   // Enable cache
   VIMSModeSet(VIMS_BASE, VIMS_MODE_ENABLED);

#ifndef POWER_SAVING
    /* Set constraints for Standby, powerdown 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();
    
    LED_Task();
        
#ifdef FEATURE_OAD_BIM
    {
      uint8_t counter;
      uint32_t *vectorTable =  (uint32_t*) 0x20000000;
      uint32_t *flashVectors = &__vector_table;
      
      // Write image specific interrupt vectors into RAM vector table.
      for(counter = 0; counter < 15; ++counter)
      {
        *vectorTable++ = *flashVectors++;
      }
    }
#endif //FEATURE_OAD_BIM
    
    /* enable interrupts and start SYS/BIOS */
    BIOS_start();
}

/**
 * Error handled to be hooked into TI-RTOS
 */
Void smallErrorHook(Error_Block *eb)
{
  for (;;);
}

/**
 * HAL assert handler required by OSAL memory module.
 */
void halAssertHandler(void)
{
  for (;;);
}