Showing posts with label CC2538EM. Show all posts
Showing posts with label CC2538EM. Show all posts

Wednesday, August 26, 2015

How to create a periodic event in TI Z-Stack or BLE-Stack

The following codes are example to start PERIODIC_EVT every second and you can do any periodic processing in PERIODIC_EVT.

//Put where you want to start PERIODIC_EVT
osal_start_timerEx( XXX_TaskID, SENSOR_READ_EVT, 1000 );

//For Z-Stack, create PERIODIC_EVT processing in zcl_XXX_event_loop
//For BLE-Stack, create PERIODIC_EVT processing in xxx_ProcessEvent
  if( events & PERIODIC_EVT )
  {
    //Do things that need periodic processing here!
    ...
    osal_start_timerEx( XXX_TaskID, PERIODIC_EVT, 1000 );
    return (events ^ PERIODIC_EVT);
  }

Friday, August 21, 2015

How to build Contiki 6lbr Slip Radio on CC2538EM with USB Drivers

1. Git the latest Contiki code by running "git clone --recursive https://github.com/contiki-os/contiki"
2. Open Makefile under examples/ipv6/slip-radio/ and set SMALL=0
3. Open contiki-conf.h under platform/cc2538dk/ and make the following changes:
     #define UART_CONF_ENABLE            0
     #define SLIP_ARCH_CONF_USB         1
     #define DBG_CONF_USB                     1
     #define CC2538_RF_CONF_CHANNEL              25
     #define IEEE802154_CONF_PANID                    0xABCD
4. Build the Slip-Radio (examples/ipv6/slip-radio/) with “make TARGET=cc2538dk”
5. Program slip-radio.bin to the CC2538EM with SmartRF06 board and Flash Programmer.