- SaBLE-x-R2 Dev Board
- IAR for ARM 7.80.3 or CCS 7.1
- CC2640R2F SDK v1.35.00.33
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
Download the board file
Download the board file package and extract its contents to the SDK install directory:
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:
Include SaBLE-x-R2 Board File
Open the IAR project and open the board.c file.
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
Next, replace the CC2640R2_LAUNCHXL preprocessor define with SABLEXR2_DEV_BOARD.
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.
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.
- Replace with:
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:
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:
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.