Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

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.

CCS/CC2640R2F: CC2640R2: System_printf results in bluetooth connection failed

Part Number: CC2640R2F

Tool/software: Code Composer Studio

    When I add System_printf and System_flush function into simple_peripheral project ,System_printf can print message to Console on debugger successfully. However , as long as ,System_printf is added into "case GAPROLE_CONNECTED" as shown in picture 1 ,bluetooth connection will be timeout ,as shown in picture 2 and 3.
    How to make bluetootn connection success with System_printf used at the same time ?


picture 1


picture 2


picture 3

 

My steps of adding System_printf function into simple_peripheral project is as followed:

1、Add header files , System_printf and System_flush in simple_peripheral.c:

/*********************** simple_peripheral.c ******************************/
/* XDC Module Headers */
#include <xdc/std.h>
#include <xdc/runtime/System.h>

/* BIOS Module Headers */
#include <ti/sysbios/BIOS.h>
......

2、Add System_printf  into "SimpleBLEPeripheral_processStateChangeEvt"

/*********************** simple_peripheral.c ******************************/
static void SimpleBLEPeripheral_processStateChangeEvt(gaprole_States_t newState)
{
  ......
  switch ( newState )
  {
    ......
    case GAPROLE_CONNECTED:
      {
        ......
        if ( linkDB_GetInfo( numActive - 1, &linkInfo ) == SUCCESS )
        {
          Display_print1(dispHandle, SBP_ROW_ROLESTATE, 0, "Num Conns: %d", (uint16_t)numActive);
          Display_print0(dispHandle, SBP_ROW_STATUS_1, 0, Util_convertBdAddr2Str(linkInfo.addr));

          //1 this will cause BLE connection timeout
          System_printf("Num  n Conns\n");
          System_flush();
        }
        else
        {
        ......
        }
        ......

        #ifdef PLUS_BROADCASTER
        ......
        #endif // PLUS_BROADCASTER

        //2 this will cause BLE connection timeout
        System_printf("GAPROLE_CONNECTED\n");
        System_flush();
      }
      break;
      ......
  }
}

3、Add configuring funcitons in app_ble.cfg

/*********************** app_ble.cfg ******************************/
utils.importFile("common/cc26xx/kernel/cc2640/config/cc2640_r2_csdk.cfg");
utils.importFile("common/cc26xx/kernel/cc2640/config/ble_stack_heap.cfg");

//this statement must be at the bottom of app_ble.cfg
var SysStd = xdc.useModule('xdc.runtime.SysStd');
var System = xdc.useModule('xdc.runtime.System');
System.SupportProxy = SysStd;

Attachments:
1、the positon of simple_peripheral project in my computer is as followed:
C:\ti\simplelink_cc2640r2_sdk_1_40_00_45\examples\rtos\CC2640R2_LAUNCHXL\ble5stack\simple_peripheral

2、my complete workspace can be downloaded from here:

CCSworkspace138.rar


3、you can download the project in simplelink_cc2640r2_sdk_1_40_00_45 from the following website:

4、my develop invironment:
CCS:Code Composer Studio 7.2.0
SDK:simplelink_cc2640r2_sdk_1_40_00_45
hardware:CC26640R2 develop kit