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/LAUNCHXL-CC2640R2: BLE 5 SPP Application / How to enable long range in the SPP Project ?

Part Number: LAUNCHXL-CC2640R2

Tool/software: Code Composer Studio

Dear TI BLE-5 Support Engineers,

I am using 2 x LAUNCHXL-CC2640R2 , simplelink_cc2640r2_sdk_1_35_00_33 stack, and projects example available on the GitHub.

I tested the SPP (Central and Client) Projects, I noticed that the long range not enabled. 

I need your help and your support to know  :

How to enable long range in the SPP Project ?

Regards,

Haithem.

  • Hi Haithem,

    In order to do this, you must enable long range in the build_config.opt file (in the stack project). In the application you must send a HCI_LE_SetPhyCmd() after the connection is made. Please see the long range demo for code example.
  • You are very good ! Thank you.
  • Hello.

    I'm looking into the long-range mode (or 125kbps coded Tx mode) myself. I wanted to give this 'long range demo' a try, but could not find it in the example folders of the 1.35 nor 1.40 stack.

    Also, the example code for simple-ble-peripheral includes some ifdefed-out code for enabling coded transmission.

    bool SimpleBLEPeripheral_doSetPhy(uint8 index)
    {
      uint8_t gapRoleState;
      uint16_t connectionHandle;
      static uint8_t phy[] = {
        HCI_PHY_1_MBPS, HCI_PHY_2_MBPS, HCI_PHY_1_MBPS | HCI_PHY_2_MBPS,
    
      // Note: BLE_V50_FEATURES is always defined and long range phy (PHY_LR_CFG) is
      //       defined in build_config.opt
      // To use the long range phy, HCI_PHY_CODED needs to be included
      #if (BLE_V50_FEATURES & PHY_LR_CFG)
        HCI_PHY_CODED, HCI_PHY_1_MBPS | HCI_PHY_2_MBPS | HCI_PHY_CODED,
      #endif  // PHY_LR_CFG
      };
    
      GAPRole_GetParameter(GAPROLE_STATE, &gapRoleState);
      GAPRole_GetParameter(GAPROLE_CONNHANDLE, &connectionHandle);
    
      // Set Phy Preference on the current connection. Apply the same value
      // for RX and TX.
      HCI_LE_SetPhyCmd(connectionHandle, 0, phy[index], phy[index], 0);
    
      Display_print1(dispHandle, SBP_ROW_RESULT, 0, "PHY preference: %s",
                     TBM_GET_ACTION_DESC(&sbpMenuMain, index));
    
      Display_clearLine(dispHandle, SBP_ROW_STATUS_1);
    
      return true;
    }

    Should I simply rebuild the stack and app projects, with BLE_V50_FEATURES & PHY_LR_CFG defined? Is that enough to enable the 125 kbps coded Tx mode?

    Thank you

  • Hi Koby,

    You can find the Long Range Demo on github: github.com/.../master


    If you want to use simple_peripheral, you should enable long range in the build_config.opt file (in the stack project). You don't have to define BLE_V50_FEATURES & PHY_LR_CFG anywhere else.
  • Thank you. Will give that a try.
  • Hello Marie.

    I couldn't compile the demo project, since there are missing profile files.

    #include "profiles/temperature/temperature_service.h"
    #include "profiles/throughput/throughput_service.h"

    I get this error during compilation

    "../Application/longrange_central.c", line 74: fatal error #1965: cannot open source file "profiles/temperature/temperature_service.h"

    This is the content of the 'profiles' folder under the SDK 1.40 installation, at C:\ti\simplelink_cc2640r2_sdk_1_40_00_45\source\ti\ble5stack\profiles :

    • accelerometer
    • audio
    • batt
    • battery
    • blood_pressure
    • csc
    • dev_info
    • find_me
    • glucose
    • heart_rate
    • hid_dev
    • hid_dev_kbd
    • hid_dev_kbd_cc
    • hid_dev_kb_m
    • hid_keyboard
    • hid_mouse
    • home_kit
    • keys
    • oad
    • proximity
    • roles
    • rsc
    • scan_param
    • sensor_profile
    • service_uuid
    • simple_profile
    • soft_cmd
    • thermometer

  • Sorry, found the missing profiles in the the same github project:

    github.com/.../profiles