SaBLE-x-R2 Porting Guide
2
This app note explains how to port the simple_peripheral project to work with the SaBLE-x-R2 Development Board. The SaBLE-x-R2 module uses the CC2640R2F 5x5 mm RHB package with 15 GPIOs, and the RF front end is configured as a differential output with external bias..

Requirements

  • SaBLE-x-R2 Dev Board
  • IAR for ARM 7.80.3 or CCS 7.1
  • CC2640R2F SDK v1.35.00.33
1Prepare the Project

1

Copy simple peripheral project

Copy the simple_peripheral project folder from the source folder to the destination folder:

  • FROM: C:\TI\simplelink_cc2640r2_sdk_1_35_00_33 \examples\rtos\CC2640R2_LAUNCHXL\ble5stack
  • TO: C:\TI\simplelink_cc2640r2_sdk_1_35_00_33 \examples\rtos\SABLE-X-R2_DEV_BOARD\ble5stack

2

Download the board file

Download the board file package and extract its contents to the SDK install directory:

  • C:\TI\simplelink_cc2640r2_sdk_1_35_00_33.

Download the board file package here.

The SaBLE-x-R2 module contains the CC2640R2F 5x5 mm RHB package with 15 GPIOs. The RF frontend is configured as differential output with external bias.

Using the Laird board file and following the steps in this poring guide includes the correct defines in software to ensure correct operation of the SaBLE-x-R2 with the 5x5 chipset.

All TI examples in the SDK are setup to use the larger 7x7 mm package that has more GPIO pins. When writing your own board file please make sure to #define CC2650EM_5XD and remove #define CC2650EM_7ID.

3

Edit CCFG Options

To ensure the user can still bootload the module with the UART bootloader, replace the ccfg_app_ble.c with the one included.

Replace the ccfg file with the file located here. Place it in the following directory:

  • examples\rtos\SABLE-X-R2_DEV_BOARD\ble5stack\simple_peripheral\tirtos\iar\config\ccfg_app_ble.c
2Porting with IAR

1

Include SaBLE-x-R2 Board File

Open the IAR project and open the board.c file.

2

Modify board.c

Add the following code to the board.c file:

#if defined(CC2640R2DK_CXS) || defined (CC2640R2DK_4XS) \
      || defined (CC2640R2DK_5XD) ||  defined (CC2640R2DK_7ID)
    #include "./cc2640r2em/cc2640r2em_board.c"
#elif defined(CC2640R2_LAUNCHXL)
    #include "./cc2640r2lp/cc2640r2lp_board.c"
#elif defined(CC2640R2_RC)
    #include "./cc2640r2rc/cc2640r2rc_board.c"
#elif defined(SABLEXR2_DEV_BOARD)
    #include "./sablexr2_module/sablexr2_module_board.c"
#else // unknown board
    #error "***ERROR*** Invalid Board Specified! Please see board.h for options."
#endif 

3

Replace Defines

Next, replace the CC2640R2_LAUNCHXL preprocessor define with SABLEXR2_DEV_BOARD.

4

Set Default TX Power

Set the default TX power by editing the DEFAULT_TX_POWER variable in ble_user_config.c. A value of 12 is equivalent to a max power of 5dBm for the SaBLE-x-R2 module.

NOTE: If using the 2Mbps PHY rate in Japan, set the max power to 4dBm or DEFAULT_TX_POWER = 11

Note that the DEFAULT_TX_POWER value is an index into a power table in ble_user_config.c.

5

Edit code to include SABLEXR2_DEV_BOARD

To make the simple_peripheral example work as it would on the CC2640R2_LAUNCHXL board, replace the dev board define anywhere it is mentioned in code.

  • Find:
    	defined(CC2640R2_LAUNCHXL)
    
  • Add:
    	|| defined(SABLEXR2_DEV_BOARD)
    

This only requires a few changes to simple_peripheral.c and board_key.c. The user can search for all places CC2640R2_LAUNCHXL is used.

There are six locations where SABLEXR2_DEV_BOARD needs to be added.

The following is an example of adding the define for the SABLEXR2_DEV_BOARD:

6

Build and Run the Application

Now the user can build and run the application. Please see the simple_peripheral documentation in the TI SDK for more information on how the simple_peripheral example works. The readme for the simple_peripheral will be located at the following directory:

  • C:/TI/simplelink_cc2640r2_sdk_1_35_00_33/examples/rtos/CC2640R2_LAUNCHXL/ble5stack/simple_peripheral/README.html
2Porting with CCS

1

When porting with CCS, all the same steps apply, only the UI varies slightly.

To replace the CC2640R2_LAUNCHXL preprocessor define with SABLEXR2_DEV_BOARD, look at this location in the project properties.