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: How to get contiki-os ble advertising on the cc2640F128 4x4mm chip on custom board

Part Number: CC2640

Hello,

Due to tirtos not being supported on Linux, I have been trying to get contiki to work on my cc2640f128 on my custom board. Specifically, the cc26x0-demo example from their platform-specific code: https://github.com/contiki-ng/contiki-ng/blob/develop/examples/platform-specific/cc26x0-cc13x0/cc26x0-demo.c.
Now I have been running into a few problems but most importantly the fact that i can see my chip boot-up and yet not advertise, the changes i made where as follows:

- Used the srf06 platform with the cc2640 board as a base and started removing any button/led hal related code on there since i am using my custom board (which to start is only powering my chip, no buttons or leds are being used)

- Altered the board.h file since the contiki one defines it for a 7x7mm packageand therefore used https://github.com/contiki-os/contiki/issues/2114 this post to guide me on the changes i need to make.

- Turned off the rom bootloader just as has been done on tirtos in order to eliminate any problems going wrong over there.

the platform.c file i used is shown below:

/*
 * Copyright (c) 2014, Texas Instruments Incorporated - http://www.ti.com/
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the copyright holder nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 */
/*---------------------------------------------------------------------------*/
/**
 * \addtogroup cc26xx-platforms
 * @{
 *
 * \defgroup cc26xx-srf-tag SmartRF+CC13xx/CC26xx EM, SensorTags and LaunchPads
 *
 * This platform supports a number of different boards:
 * - A standard TI SmartRF06EB with a CC26xx EM mounted on it
 * - A standard TI SmartRF06EB with a CC1310 EM mounted on it
 * - The TI CC2650 SensorTag
 * - The TI CC1350 SensorTag
 * - The TI CC2650 LaunchPad
 * - The TI CC1310 LaunchPad
 * - The TI CC1350 LaunchPad
 * @{
 */
#include "ti-lib.h"
#include "contiki.h"
#include "contiki-net.h"
#include "lpm.h"
#include "dev/leds.h"
#include "dev/gpio-hal.h"
#include "dev/oscillators.h"
#include "ieee-addr.h"
#include "ble-addr.h"
#include "vims.h"
#include "dev/cc26xx-uart.h"
#include "dev/soc-rtc.h"
#include "dev/serial-line.h"
#include "rf-core/rf-core.h"
#include "sys_ctrl.h"
#include "uart.h"
#include "sys/clock.h"
#include "sys/rtimer.h"
#include "sys/node-id.h"
#include "sys/platform.h"
#include "lib/random.h"
#include "lib/sensors.h"
#include "button-sensor.h"
#include "dev/serial-line.h"
#include "dev/button-hal.h"
#include "net/mac/framer/frame802154.h"
#include "board-peripherals.h"

#include "driverlib/driverlib_release.h"

#include <stdio.h>
/*---------------------------------------------------------------------------*/
/* Log configuration */
#include "sys/log.h"
#define LOG_MODULE "CC26xx/CC13xx"
#define LOG_LEVEL LOG_LEVEL_MAIN
/*---------------------------------------------------------------------------*/
/** \brief Board specific iniatialisation */
void board_init(void);
/*---------------------------------------------------------------------------*/
#ifdef BOARD_CONF_HAS_SENSORS
#define BOARD_HAS_SENSORS BOARD_CONF_HAS_SENSORS
#else
#define BOARD_HAS_SENSORS 1
#endif
/*---------------------------------------------------------------------------*/
// static void
// fade(leds_mask_t l)
// { //*** you fade
//   volatile int i;
//   int k, j;
//   for (k = 0; k < 800; ++k)
//   {
//     j = k > 400 ? 800 - k : k;

//     leds_on(l);
//     for (i = 0; i < j; ++i)
//     {
//       __asm("nop");
//     }
//     leds_off(l);
//     for (i = 0; i < 400 - j; ++i)
//     {
//       __asm("nop");
//     }
//   }
// }
/*---------------------------------------------------------------------------*/
static void
set_rf_params(void)
{
  uint8_t ext_addr[8];

#if MAC_CONF_WITH_BLE
  ble_eui64_addr_cpy_to((uint8_t *)&ext_addr);
  NETSTACK_RADIO.set_object(RADIO_PARAM_64BIT_ADDR, ext_addr, 8);
#else
  uint16_t short_addr;
  ieee_addr_cpy_to(ext_addr, 8);

  short_addr = ext_addr[7];
  short_addr |= ext_addr[6] << 8;

  NETSTACK_RADIO.set_value(RADIO_PARAM_PAN_ID, IEEE802154_PANID);
  NETSTACK_RADIO.set_value(RADIO_PARAM_16BIT_ADDR, short_addr);
  NETSTACK_RADIO.set_value(RADIO_PARAM_CHANNEL, IEEE802154_DEFAULT_CHANNEL);
  NETSTACK_RADIO.set_object(RADIO_PARAM_64BIT_ADDR, ext_addr, 8);
#endif
}
/*---------------------------------------------------------------------------*/
void platform_init_stage_one()
{
  /* Enable flash cache and prefetch. */
  ti_lib_vims_mode_set(VIMS_BASE, VIMS_MODE_ENABLED);
  ti_lib_vims_configure(VIMS_BASE, true, true);

  ti_lib_int_master_disable();

  /* Set the LF XOSC as the LF system clock source */
  oscillators_select_lf_xosc();

  lpm_init();

  board_init();

  gpio_hal_init();

  // leds_init();
  // fade(LEDS_RED);

  /*
   * Disable I/O pad sleep mode and open I/O latches in the AON IOC interface
   * This is only relevant when returning from shutdown (which is what froze
   * latches in the first place. Before doing these things though, we should
   * allow software to first regain control of pins
   */
  ti_lib_aon_ioc_freeze_disable();
  HWREG(AON_SYSCTL_BASE + AON_SYSCTL_O_SLEEPCTL) = 1;
  ti_lib_sys_ctrl_aon_sync();

  ti_lib_int_enable(INT_AON_GPIO_EDGE);
  ti_lib_int_master_enable();

  soc_rtc_init();
  // fade(LEDS_YELLOW);
}
/*---------------------------------------------------------------------------*/
void platform_init_stage_two()
{
  random_init(0x1234);

  /* Character I/O Initialisation */
#if CC26XX_UART_CONF_ENABLE
  cc26xx_uart_init();
#endif

  serial_line_init();

#if BUILD_WITH_SHELL
  cc26xx_uart_set_input(serial_line_input_byte);
#endif

  /* Populate linkaddr_node_addr */
#if MAC_CONF_WITH_BLE
  uint8_t ext_addr[8];
  ble_eui64_addr_cpy_to((uint8_t *)&ext_addr);
  memcpy(&linkaddr_node_addr, &ext_addr[8 - LINKADDR_SIZE], LINKADDR_SIZE);
#else
  ieee_addr_cpy_to(linkaddr_node_addr.u8, LINKADDR_SIZE);
#endif

  // button_hal_init();

  //fade(LEDS_GREEN);
}
/*---------------------------------------------------------------------------*/
void platform_init_stage_three()
{
  radio_value_t chan = 0;
  radio_value_t pan = 0;

  set_rf_params();

  NETSTACK_RADIO.get_value(RADIO_PARAM_CHANNEL, &chan);

  LOG_DBG("With DriverLib v%u.%u\n", DRIVERLIB_RELEASE_GROUP,
          DRIVERLIB_RELEASE_BUILD);
  // LOG_INFO(BOARD_STRING "\n");
  LOG_DBG("IEEE 802.15.4: %s, Sub-GHz: %s, BLE: %s, Prop: %s\n",
          ti_lib_chipinfo_supports_ieee_802_15_4() == true ? "Yes" : "No",
          ti_lib_chipinfo_chip_family_is_cc13xx() == true ? "Yes" : "No",
          ti_lib_chipinfo_supports_ble() == true ? "Yes" : "No",
          ti_lib_chipinfo_supports_proprietary() == true ? "Yes" : "No");
  // LOG_INFO(" RF: Channel %d", chan);

  if (NETSTACK_RADIO.get_value(RADIO_PARAM_PAN_ID, &pan) == RADIO_RESULT_OK)
  {
    // LOG_INFO_(", PANID 0x%04X", pan);
  }
  // LOG_INFO_("\n");

  // #if BOARD_HAS_SENSORS
  //   process_start(&sensors_process, NULL);
  // #endif

  //fade(LEDS_ORANGE);
}
/*---------------------------------------------------------------------------*/
void platform_idle()
{
  /* Drop to some low power mode */
  lpm_drop();
}
/*---------------------------------------------------------------------------*/
/**
 * @}
 * @}
 */

The application example code that i am using is shown below:

/*
 * Copyright (c) 2014, Texas Instruments Incorporated - http://www.ti.com/
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the copyright holder nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 */
/*---------------------------------------------------------------------------*/
/**
 * \addtogroup cc26xx-platforms
 * @{
 *
 * \defgroup cc26xx-examples CC26xx Example Projects
 *
 * Example projects for CC26xx-based platforms.
 * @{
 *
 * \defgroup cc26xx-demo CC26xx Demo Project
 *
 *   Example project demonstrating the CC13xx/CC26xx platforms
 *
 *   This example will work for the following boards:
 *   - cc26x0-cc13x0: SmartRF06EB + CC13xx/CC26xx EM
 *   - CC2650 and CC1350 SensorTag
 *   - CC1310, CC1350, CC2650 LaunchPads
 *
 *   This is an IPv6/RPL-enabled example. Thus, if you have a border router in
 *   your installation (same RDC layer, same PAN ID and RF channel), you should
 *   be able to ping6 this demo node.
 *
 *   This example also demonstrates CC26xx BLE operation. The process starts
 *   the BLE beacon daemon (implemented in the RF driver). The daemon will
 *   send out a BLE beacon periodically. Use any BLE-enabled application (e.g.
 *   LightBlue on OS X or the TI BLE Multitool smartphone app) and after a few
 *   seconds the cc26xx device will be discovered.
 *
 * - etimer/clock : Every CC26XX_DEMO_LOOP_INTERVAL clock ticks the LED defined
 *                  as CC26XX_DEMO_LEDS_PERIODIC will toggle and the device
 *                  will print out readings from some supported sensors
 * - sensors      : Some sensortag sensors are read asynchronously (see sensor
 *                  documentation). For those, this example will print out
 *                  readings in a staggered fashion at a random interval
 * - Buttons      : CC26XX_DEMO_TRIGGER_1 button will toggle CC26XX_DEMO_LEDS_BUTTON
 *                - CC26XX_DEMO_TRIGGER_2 turns on LEDS_REBOOT and causes a
 *                  watchdog reboot
 *                - The remaining buttons will just print something
 *                - The example also shows how to retrieve the duration of a
 *                  button press (in ticks). The driver will generate a
 *                  sensors_changed event upon button release
 * - Reed Relay   : Will toggle the sensortag buzzer on/off
 *
 * @{
 *
 * \file
 *     Example demonstrating the cc26xx platforms
 */
#include "contiki.h"
#include "sys/etimer.h"
#include "sys/ctimer.h"
#include "dev/leds.h"
#include "dev/watchdog.h"
#include "dev/button-hal.h"
#include "random.h"
#include "button-sensor.h"
#include "batmon-sensor.h"
#include "board-peripherals.h"
#include "rf-core/rf-ble.h"

#include "ti-lib.h"

#include <stdio.h>
#include <stdint.h>
/*---------------------------------------------------------------------------*/
#define CC26XX_DEMO_LOOP_INTERVAL (CLOCK_SECOND * 20)
#define CC26XX_DEMO_LEDS_PERIODIC LEDS_YELLOW
#define CC26XX_DEMO_LEDS_BUTTON LEDS_RED
#define CC26XX_DEMO_LEDS_REBOOT LEDS_ALL
/*---------------------------------------------------------------------------*/
// #define CC26XX_DEMO_TRIGGER_1 BOARD_BUTTON_HAL_INDEX_KEY_LEFT
// #define CC26XX_DEMO_TRIGGER_2 BOARD_BUTTON_HAL_INDEX_KEY_RIGHT

// #if BOARD_SENSORTAG
// #define CC26XX_DEMO_TRIGGER_3 BOARD_BUTTON_HAL_INDEX_REED_RELAY
// #endif
/*---------------------------------------------------------------------------*/
static struct etimer et;
/*---------------------------------------------------------------------------*/
PROCESS(cc26xx_demo_process, "cc26xx demo process");
AUTOSTART_PROCESSES(&cc26xx_demo_process);
/*---------------------------------------------------------------------------*/
#if BOARD_SENSORTAG
/*---------------------------------------------------------------------------*/
/*
 * Update sensor readings in a staggered fashion every SENSOR_READING_PERIOD
 * ticks + a random interval between 0 and SENSOR_READING_RANDOM ticks
 */
#define SENSOR_READING_PERIOD (CLOCK_SECOND * 20)
#define SENSOR_READING_RANDOM (CLOCK_SECOND << 4)

// #define printf ()

static struct ctimer bmp_timer, opt_timer, hdc_timer, tmp_timer, mpu_timer;
/*---------------------------------------------------------------------------*/
static void init_bmp_reading(void *not_used);
static void init_opt_reading(void *not_used);
static void init_hdc_reading(void *not_used);
static void init_tmp_reading(void *not_used);
static void init_mpu_reading(void *not_used);
/*---------------------------------------------------------------------------*/
static void
print_mpu_reading(int reading)
{
  if (reading < 0)
  {
    printf("-");
    reading = -reading;
  }

  printf("%d.%02d", reading / 100, reading % 100);
}
/*---------------------------------------------------------------------------*/
static void
get_bmp_reading()
{
  int value;
  clock_time_t next = SENSOR_READING_PERIOD +
                      (random_rand() % SENSOR_READING_RANDOM);

  value = bmp_280_sensor.value(BMP_280_SENSOR_TYPE_PRESS);
  if (value != CC26XX_SENSOR_READING_ERROR)
  {
    printf("BAR: Pressure=%d.%02d hPa\n", value / 100, value % 100);
  }
  else
  {
    printf("BAR: Pressure Read Error\n");
  }

  value = bmp_280_sensor.value(BMP_280_SENSOR_TYPE_TEMP);
  if (value != CC26XX_SENSOR_READING_ERROR)
  {
    printf("BAR: Temp=%d.%02d C\n", value / 100, value % 100);
  }
  else
  {
    printf("BAR: Temperature Read Error\n");
  }

  SENSORS_DEACTIVATE(bmp_280_sensor);

  ctimer_set(&bmp_timer, next, init_bmp_reading, NULL);
}
/*---------------------------------------------------------------------------*/
static void
get_tmp_reading()
{
  int value;
  clock_time_t next = SENSOR_READING_PERIOD +
                      (random_rand() % SENSOR_READING_RANDOM);

  value = tmp_007_sensor.value(TMP_007_SENSOR_TYPE_ALL);

  if (value == CC26XX_SENSOR_READING_ERROR)
  {
    printf("TMP: Ambient Read Error\n");
    return;
  }

  value = tmp_007_sensor.value(TMP_007_SENSOR_TYPE_AMBIENT);
  printf("TMP: Ambient=%d.%03d C\n", value / 1000, value % 1000);

  value = tmp_007_sensor.value(TMP_007_SENSOR_TYPE_OBJECT);
  printf("TMP: Object=%d.%03d C\n", value / 1000, value % 1000);

  SENSORS_DEACTIVATE(tmp_007_sensor);

  ctimer_set(&tmp_timer, next, init_tmp_reading, NULL);
}
/*---------------------------------------------------------------------------*/
static void
get_hdc_reading()
{
  int value;
  clock_time_t next = SENSOR_READING_PERIOD +
                      (random_rand() % SENSOR_READING_RANDOM);

  value = hdc_1000_sensor.value(HDC_1000_SENSOR_TYPE_TEMP);
  if (value != CC26XX_SENSOR_READING_ERROR)
  {
    printf("HDC: Temp=%d.%02d C\n", value / 100, value % 100);
  }
  else
  {
    printf("HDC: Temp Read Error\n");
  }

  value = hdc_1000_sensor.value(HDC_1000_SENSOR_TYPE_HUMID);
  if (value != CC26XX_SENSOR_READING_ERROR)
  {
    printf("HDC: Humidity=%d.%02d %%RH\n", value / 100, value % 100);
  }
  else
  {
    printf("HDC: Humidity Read Error\n");
  }

  ctimer_set(&hdc_timer, next, init_hdc_reading, NULL);
}
/*---------------------------------------------------------------------------*/
static void
get_light_reading()
{
  int value;
  clock_time_t next = SENSOR_READING_PERIOD +
                      (random_rand() % SENSOR_READING_RANDOM);

  value = opt_3001_sensor.value(0);
  if (value != CC26XX_SENSOR_READING_ERROR)
  {
    printf("OPT: Light=%d.%02d lux\n", value / 100, value % 100);
  }
  else
  {
    printf("OPT: Light Read Error\n");
  }

  /* The OPT will turn itself off, so we don't need to call its DEACTIVATE */
  ctimer_set(&opt_timer, next, init_opt_reading, NULL);
}
/*---------------------------------------------------------------------------*/
static void
get_mpu_reading()
{
  int value;
  clock_time_t next = SENSOR_READING_PERIOD +
                      (random_rand() % SENSOR_READING_RANDOM);

  printf("MPU Gyro: X=");
  value = mpu_9250_sensor.value(MPU_9250_SENSOR_TYPE_GYRO_X);
  print_mpu_reading(value);
  printf(" deg/sec\n");

  printf("MPU Gyro: Y=");
  value = mpu_9250_sensor.value(MPU_9250_SENSOR_TYPE_GYRO_Y);
  print_mpu_reading(value);
  printf(" deg/sec\n");

  printf("MPU Gyro: Z=");
  value = mpu_9250_sensor.value(MPU_9250_SENSOR_TYPE_GYRO_Z);
  print_mpu_reading(value);
  printf(" deg/sec\n");

  printf("MPU Acc: X=");
  value = mpu_9250_sensor.value(MPU_9250_SENSOR_TYPE_ACC_X);
  print_mpu_reading(value);
  printf(" G\n");

  printf("MPU Acc: Y=");
  value = mpu_9250_sensor.value(MPU_9250_SENSOR_TYPE_ACC_Y);
  print_mpu_reading(value);
  printf(" G\n");

  printf("MPU Acc: Z=");
  value = mpu_9250_sensor.value(MPU_9250_SENSOR_TYPE_ACC_Z);
  print_mpu_reading(value);
  printf(" G\n");

  SENSORS_DEACTIVATE(mpu_9250_sensor);

  ctimer_set(&mpu_timer, next, init_mpu_reading, NULL);
}
/*---------------------------------------------------------------------------*/
static void
init_bmp_reading(void *not_used)
{
  SENSORS_ACTIVATE(bmp_280_sensor);
}
/*---------------------------------------------------------------------------*/
static void
init_opt_reading(void *not_used)
{
  SENSORS_ACTIVATE(opt_3001_sensor);
}
/*---------------------------------------------------------------------------*/
static void
init_hdc_reading(void *not_used)
{
  SENSORS_ACTIVATE(hdc_1000_sensor);
}
/*---------------------------------------------------------------------------*/
static void
init_tmp_reading(void *not_used)
{
  SENSORS_ACTIVATE(tmp_007_sensor);
}
/*---------------------------------------------------------------------------*/
static void
init_mpu_reading(void *not_used)
{
  mpu_9250_sensor.configure(SENSORS_ACTIVE, MPU_9250_SENSOR_TYPE_ALL);
}
#endif
/*---------------------------------------------------------------------------*/
// static void
// get_sync_sensor_readings(void)
// {
//   int value;

//   printf("-----------------------------------------\n");

//   value = batmon_sensor.value(BATMON_SENSOR_TYPE_TEMP);
//   printf("Bat: Temp=%d C\n", value);

//   value = batmon_sensor.value(BATMON_SENSOR_TYPE_VOLT);
//   printf("Bat: Volt=%d mV\n", (value * 125) >> 5);

// #if BOARD_SMARTRF06EB
//   SENSORS_ACTIVATE(als_sensor);

//   value = als_sensor.value(0);
//   printf("ALS: %d raw\n", value);

//   SENSORS_DEACTIVATE(als_sensor);
// #endif

//   return;
// }
/*---------------------------------------------------------------------------*/
// static void
// init_sensors(void)
// {
//   SENSORS_ACTIVATE(batmon_sensor);
// }
/*---------------------------------------------------------------------------*/
// static void
// init_sensor_readings(void)
// {
// #if BOARD_SENSORTAG
//   SENSORS_ACTIVATE(hdc_1000_sensor);
//   SENSORS_ACTIVATE(tmp_007_sensor);
//   SENSORS_ACTIVATE(opt_3001_sensor);
//   SENSORS_ACTIVATE(bmp_280_sensor);

//   init_mpu_reading(NULL);
// #endif
// }
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(cc26xx_demo_process, ev, data)
{

  PROCESS_BEGIN();

  // printf("CC26XX demo\n");

  // init_sensors();

  /* Init the BLE advertisement daemon */
  rf_ble_beacond_config(0, BOARD_STRING);
  rf_ble_beacond_start();

  etimer_set(&et, CC26XX_DEMO_LOOP_INTERVAL);
  //get_sync_sensor_readings();
  //init_sensor_readings();

  while (1)
  {

    PROCESS_YIELD();

    if (ev == PROCESS_EVENT_TIMER)
    {
      if (data == &et)
      {
        // leds_toggle(CC26XX_DEMO_LEDS_PERIODIC);

        //get_sync_sensor_readings();

        etimer_set(&et, CC26XX_DEMO_LOOP_INTERVAL);
      }
    }
    // else if (ev == button_hal_periodic_event)
    //{
    // button_hal_button_t *button = data;

    // printf("%s periodic event, duration %d seconds\n",
    //        BUTTON_HAL_GET_DESCRIPTION(button),
    //        button->press_duration_seconds);
    //}
    //else if (ev == button_hal_release_event)
    //{
    //   button_hal_button_t *btn = (button_hal_button_t *)data;

    // printf("%s release event\n", BUTTON_HAL_GET_DESCRIPTION(btn));

    //       if (btn->unique_id == CC26XX_DEMO_TRIGGER_1)
    //       {
    //         // leds_toggle(CC26XX_DEMO_LEDS_BUTTON);
    //       }
    //       else if (btn->unique_id == CC26XX_DEMO_TRIGGER_2)
    //       {
    //         // leds_on(CC26XX_DEMO_LEDS_REBOOT);
    //         // watchdog_reboot();
    // #if BOARD_SENSORTAG
    //       }
    //       else if (btn->unique_id == CC26XX_DEMO_TRIGGER_3)
    //       {
    //         if (buzzer_state())
    //         {
    //           buzzer_stop();
    //         }
    //         else
    //         {
    //           buzzer_start(1000);
    //         }
    //       }
    //     }
    //     else if (ev == sensors_event)
    //     {
    //       if (data == &bmp_280_sensor)
    //       {
    //         get_bmp_reading();
    //       }
    //       else if (data == &opt_3001_sensor)
    //       {
    //         get_light_reading();
    //       }
    //       else if (data == &hdc_1000_sensor)
    //       {
    //         get_hdc_reading();
    //       }
    //       else if (data == &tmp_007_sensor)
    //       {
    //         get_tmp_reading();
    //       }
    //       else if (data == &mpu_9250_sensor)
    //       {
    //         get_mpu_reading();
    // #endif
    //  }
    //}
  }

  PROCESS_END();
}
/*---------------------------------------------------------------------------*/
/**
 * @}
 * @}
 * @}
 */

I am not sure why my chip is not advertising, I have hooked it up and downloaded tirtos stack and simple periphiral app in windows and got it to work, yet I have not been successful on linux/contiki, can anyone offer any help/direction on what to try? I am running out of ideas!

Thanks guys!

Asma