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.

CC2640R2F: HCI_EXT_SetTxPowerCmd() does not work at SDK 2.30?

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2650

Hi,

    I tested the HCI_EXT_SetTxPowerCmd() at Simple Peripheral Stack Library Example Program from SDK 2.30 and I am getting the same results from the related post. If I set any of this code below at initialization or at GAPROLE_ADVERTISING I measure around 6-7 mA current.

HCI_EXT_SetTxPowerCmd(TX_POWER_0_DBM);

HCI_EXT_SetTxPowerCmd(TX_POWER_1_DBM);

HCI_EXT_SetTxPowerCmd(TX_POWER_2_DBM);

HCI_EXT_SetTxPowerCmd(TX_POWER_3_DBM);

HCI_EXT_SetTxPowerCmd(TX_POWER_4_DBM);

HCI_EXT_SetTxPowerCmd(TX_POWER_5_DBM);

    What works is that if I change the DEFAULT_TX_POWER at ble_user_config.c from 7 to 12. I able to measure increasing current, meaning the TXPower is really being changed. But, I need to use HCI_EXT_SetTxPowerCmd() so I can change the TXPower using smart phone app since my end application is BLE Eddystone Beacon.

    I did the same test using CC2650 Launchpad and Simple Peripheral from BLE Stack 2.20. So, presumably from from BLE Stack 2.20, CC2640R2F SDK 1.00 to SDK 2.30 the HCI_EXT_SetTxPowerCmd(); does not work. So that is about 3 years the HCI_EXT_SetTxPowerCmd() is not working. There are even several post here mentioning that the HCI_EXT_SetTxPowerCmd() does not work.

    Comparing to Bluetooth Beacons out in the market example this one below that uses Nordic Semi BLE MCU, you can change the TXPower using smart phone app. I think that actual TXpower is changed since this is product is already out in the market. If I use TI CC2640R2F and set 5 DBM using HCI_EXT_SetTxPowerCmd(TX_POWER_5_DBM); the actual TXPower will not be set.

    I am making a Bluetooth Beacon product using TI CC2640R2F and the entire product development comes to stop because I am not able to change the actual TXpower using HCI_EXT_SetTxPowerCmd();. The feedback from my team members regarding this are bad. But, I believe this can be easily fixed TI side, so for now I am making excuses to continue using TI CC2640R2F. I shift my activity to other parts of the firmware such as OAD.

    I would like to know what is TI solution to this.

-kel

  • Hi,

    I will take a look at this command and get back to you asap.
  • Nevermind Christin Lee, I found the solution to the problem, see details below.

    These TXPower defines can be found at ble_user_config.h at BLE Stack 2.20, CC2640R2F SDK 1.00 to 2.30. For about 3 years it is there. Find out internally who put it there and why or what for?

    // Tx Power
    #define TX_POWER_5_DBM                   5
    #define TX_POWER_4_DBM                   4
    #define TX_POWER_3_DBM                   3
    #define TX_POWER_2_DBM                   2
    #define TX_POWER_1_DBM                   1
    #define TX_POWER_0_DBM                   0
    #define TX_POWER_MINUS_3_DBM             -3
    #define TX_POWER_MINUS_6_DBM             -6
    #define TX_POWER_MINUS_9_DBM             -9
    #define TX_POWER_MINUS_12_DBM            -12
    #define TX_POWER_MINUS_15_DBM            -15
    #define TX_POWER_MINUS_18_DBM            -18
    #define TX_POWER_MINUS_21_DBM            -21

    It says at code comment Tx Power and seems to be appropriate defines to be set at HCI_EXT_SetTxPowerCmd(). Here are sample use below.

    HCI_EXT_SetTxPowerCmd(TX_POWER_5_DBM);

    which is also equivalent to HCI_EXT_SetTxPowerCmd(5);

    There are several post at TI BLE Forum where as the poster would do this. TI Engineer and Forum members would also recommend that the Tx Power defines at ble_user_config.h should be used at HCI_EXT_SetTxPowerCmd(). So that is from BLE Stack 2.20, CC2640R2F SDK 1.00 to 2.30, which spans about 3 years.

    This below is the TX Power Table at ble_user_config.c

      // Tx Power Values (Pout, IB, GC, TC)
      const txPwrVal_t TxPowerTable[] =
      { { TX_POWER_MINUS_21_DBM, GEN_TX_POWER_VAL( 0x07, 3, 0x0C ) },
        { TX_POWER_MINUS_18_DBM, GEN_TX_POWER_VAL( 0x09, 3, 0x0C ) },
        { TX_POWER_MINUS_15_DBM, GEN_TX_POWER_VAL( 0x0B, 3, 0x0C ) },
        { TX_POWER_MINUS_12_DBM, GEN_TX_POWER_VAL( 0x0B, 1, 0x14 ) },
        { TX_POWER_MINUS_9_DBM,  GEN_TX_POWER_VAL( 0x0E, 1, 0x19 ) },
        { TX_POWER_MINUS_6_DBM,  GEN_TX_POWER_VAL( 0x12, 1, 0x1D ) },
        { TX_POWER_MINUS_3_DBM,  GEN_TX_POWER_VAL( 0x18, 1, 0x25 ) },
        { TX_POWER_0_DBM,        GEN_TX_POWER_VAL( 0x21, 1, 0x31 ) },
        { TX_POWER_1_DBM,        GEN_TX_POWER_VAL( 0x14, 0, 0x42 ) },
        { TX_POWER_2_DBM,        GEN_TX_POWER_VAL( 0x18, 0, 0x4E ) },
        { TX_POWER_3_DBM,        GEN_TX_POWER_VAL( 0x1C, 0, 0x5A ) },
        { TX_POWER_4_DBM,        GEN_TX_POWER_VAL( 0x24, 0, 0x93 ) },
        { TX_POWER_5_DBM,        GEN_TX_POWER_VAL( 0x30, 0, 0x93 ) } };

    So, HCI_EXT_SetTxPowerCmd(5); would actually set TX Power to MINUS 6 DBM and not 5 DBM

    At TI BLE Vendor Specific HCI Reference Guide Version 3.1.0 these values below should be set at HCI_EXT_SetTxPowerCmd();. Meaning the TX Power defines values at ble_user_config.h are WRONG

    I change the TX Power define values at ble_user_config.h to these below. I set TX Power from 0 dBM to 5 dBM and I am able to measure incrementing current values, which is correct. I recommend that at future CC2640R2F SDK releases that the TX Power define values at ble_user_config.h change to these below or its decimal equivalent (0-12).

    #define TX_POWER_5_DBM                   0x0C
    #define TX_POWER_4_DBM                   0x0B
    #define TX_POWER_3_DBM                   0x0A
    #define TX_POWER_2_DBM                   0x09
    #define TX_POWER_1_DBM                   0x08
    #define TX_POWER_0_DBM                   0x07
    #define TX_POWER_MINUS_3_DBM             0x06
    #define TX_POWER_MINUS_6_DBM             0x05
    #define TX_POWER_MINUS_9_DBM             0x04
    #define TX_POWER_MINUS_12_DBM            0x03
    #define TX_POWER_MINUS_15_DBM            0x02
    #define TX_POWER_MINUS_18_DBM            0x01
    #define TX_POWER_MINUS_21_DBM            0x00

    -kel

  • Thanks for finding the bug and reporting back to us. We will fix it!