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.

Compiler/CC2652P: Change Tx power on CC2652P

Part Number: CC2652P
Other Parts Discussed in Thread: CC2652R, CC1352P

Tool/software: TI C/C++ Compiler

Hi,

For a new hardware that integrates a CC2652P, we have developed an application using simple_peripheral_oad_offchip (version C13XP_2) code example and the SDK 3_30_00_03.

In the project, the variant “CC2652P1F” has been set and the “rfDriverCallback” procedure has been updated to drive the RF switch MASWSS0136.

In the application, we use HCI_EXT_SetTxPowerCmd to change the Tx power.

Unfortunately, the power doesn’t change and always remains constant, valid for dBm values with normal PA and high power PA.

The rfDriverCallback is called and the new RF_TxPowerTable_Value read in this procedure has the correct value.

With the same software running on the CC2652R, the power changes correctly.

 

Could you help me?

 

Regards,

Nicolas

  • Hi,

    I just bought a LaunchPad CC1352P-2 kit (that’s the reason for the delay in this answer) to test the change of the Tx power.

    I modified the simple_peripheral_oad_offchip code example and included the change of TX power every 10 seconds. The wanted value toggles between -20 dBm and +20 dBm. 

    The RSSI value is measured with a professional test equipment from Frontline.

    The result is the same as explained above: the first call to HCI_EXT_SetTxPowerCmd correctly sets the initial Tx power. But subsequent calls to HCI_EXT_SetTxPowerCmd have no effect on the measured value, the TX power doesn’t change.

     

    Thanks in advance for your response.

     

    Regards,

    Nicolas

  • Hi,

    Can you try calling  HCIExt_EndModemTestCmd and then set new power level by calling HCI_EXT_SetTxPowerCmd.

    Thanks

  • Hi,

    Your workaround only works when the circuit remains in advertising role.

    When a connection has been established, the TX power doesn't change anymore.

     

    The CC13x2, CC26x2 SimpleLinkTM Wireless MCU Technical Reference Manual explains that the TX power can be changed by sending commands to the RF core.

     

    Do you have a working code example which can be integrated in the simple_peripheral_oad_offchip project and

    -       creates a new client instance of the RF driver with RF_open

    -       sends a TX power command (CMD_SET_TX_POWER, CMD_SET_TX20_POWER )

    -       closes the client instance with RF_close

     

    Thanks in advance for your response.

     

    Regards,

    Nicolas

  • Hi,

    You can look into the EasyLink_setRfPower(int8_t i8TxPowerDbm) API in the EasyLink example in the SDK.

    The entries of the txPowerTable[] are in the file ti_radio_config.c. 

    Regards,

  • Hi,

    Did the above approach work for you?

    Thanks

  • Hi,

     

    I have written the following procedure:

     

    void setTxPower(int8_t txPowerDbm) {

        rfc_CMD_UPDATE_RADIO_SETUP_t RF_cmdUpdate =

        {

           .commandNo = 0x0001,

           .__dummy0 = 0,

           .pRegOverride = NULL,

        };

     

        RF_Params rfParams;

        RF_Object rfObject;

        RF_Handle rfHandle;

        RF_Stat stat;

     

        RF_Params_init(&rfParams);

     

        rfHandle = RF_open(&rfObject, &RF_modeBle, (RF_RadioSetup*)&RF_cmdUpdate, &rfParams);

        if (rfHandle != NULL) {

            RF_TxPowerTable_Value value = RF_TxPowerTable_findValue(RF_BLE_txPowerTable, txPowerDbm);

            stat = RF_setTxPower(rfHandle, value);

            RF_close(rfHandle);

        }

    }

     

    The CC1352P-2 responds as follows :

    -       for the Tx Power values from 14 to 20 dBm, the return value of RF_setTxPower is always RF_StatInvalidParamsError

    -       for Tx Power values from -20 to 5 dBm, the return value of RF_setTxPower is RF_StatSuccess

    -       for all Tx power values, the measured power value doesn’t change

     

    Thanks in advance for your response.

     

    Regards,

    Nicolas

  • Hello Nicolas,

    That is interesting.

    1) For the easylink example the CONFIG_CC1352P_2_LAUNCHXL does not seem to be defined which might cause the tx table not being setup for PA and up to 20dBm?

    if (rfHandle != NULL) {

            RF_TxPowerTable_Value value = RF_TxPowerTable_findValue(RF_BLE_txPowerTable, txPowerDbm);

    if(value != RF_TxPowerTable_INVALID_VALUE) {

            stat = RF_setTxPower(rfHandle, value);

    }

            RF_close(rfHandle);

    2) Did you try the latest SDK? There was a fix in SDK 3.40 that might be related:

    BLE_AGAMA-1471 Add support to configure Tx power in Adv. via Tx Power field in GapAdv_params_t

    There were also multiple fixes related to PA mode and CC1352P in the related fix

  • Hello Eirik,

    You mentioned the easylink example, but our software is based on the simple_peripheral_oad_offchip (version C1352P_2) example and the tx table is defined with the “normal” and the “high” PA values.

     

    I tried with the last sdk 3.40 (both HCI_EXT_SetTxPowerCmd and my procedure named setTxPower) and the results are the same as explained above with the sdk 3.30.

     

    Thanks in advance for your response.

     

    Regards,

    Nicolas

     

  • Hello Nicolas,

    Please investigate these 2 items before we need to dig deeper:

    1) Can you try to define CC13X2P in the application project in Projects options- compiler - Predefined Symbols?

    2) Argument passed in HCI_EXT_SetTxPowerCmd 

    https://e2e.ti.com/support/wireless-connectivity/bluetooth/f/538/p/697671/2573175#2573175

  • Hello Eirik,

    I defined CC13X2P as Predefined Symbols and checked if it changes anything: nothing, always the same result as described above.

    I can confirm that the index value of the tx table entry (index values between  LL_EXT_TX_POWER_MINUS_20_DBM and LL_EXT_TX_POWER_20_DBM) is passed as parameter to HCI_EXT_SetTxPowerCmd.

    Thanks in advance for your response.

    Regards,

    Nicolas

     

  • Hello Nicolas,

    Sorry for the delay,

    I will find a board next week and try it out myself.

  • Hello Nicolas,

    I tested on a CC1352P-2 Launchpad (which is the equivalent to the CC1352P) on simplelink_cc13x2_26x2_sdk_3_30_00_03 and it worked to set the output power to 20 dBm:

    static void SimplePeripheral_processGapMessage(gapEventHdr_t *pMsg)
    {
      switch(pMsg->opcode)
      {
        case GAP_DEVICE_INIT_DONE_EVENT:
        {
          bStatus_t status = FAILURE;
    
          gapDeviceInitDoneEvent_t *pPkt = (gapDeviceInitDoneEvent_t *)pMsg;
    
          if(pPkt->hdr.status == SUCCESS)
          {
    
            // Set output power to 20dBm
            HCI_EXT_SetTxPowerCmd(LL_EXT_TX_POWER_20_DBM);

  • Hello Eirik,

    Yes, I agree, the first call to HCI_EXT_SetTxPowerCmd correctly sets the initial Tx power. But subsequent calls to HCI_EXT_SetTxPowerCmd have no effect on the measured value, the TX power doesn’t change (already explained in my post of Jan 29th).

    On the CC2652R, the power changes correctly at each call to HCI_EXT_SetTxPowerCmd.

    Thanks in advance for your response.

     

    Regards,

    Nicolas

  • I see, my bad.

    Just to clarify.

    1) Do you set the power in the same manner for both CC2652R and CC2652P when testing?

    2) Do you change the power while a GAP role is active or passive? 

    Then I can test and file a bug if I can reproduce it on my end.

  • Hello Eirik,

    Yes, the power is defined in the same manner for the CC2652R and CC2652P: HCI_EXT_SetTxPowerCmd is called.

    In our project, the CC2652x device has the GAP role “Peripheral” and the power is changed during the “Advertising” state or when the peripheral is connected.

     

    Thanks in advance for your response.

     

    Regards,

    Nicolas

  • Hello Nicolas,

    I added a menu item in simple_peripheral (simplelink_cc13x2_26x2_sdk_3_30_00_03 - CC13X2P_2)  to change the output power between 0 dBm and 20 dBm during a connection and it works like a charm here. What kind of front end configuration do you use?

    MENU_OBJ(spMenuSetPwr, "Set Output Power", 2, &spMenuPerConn)
    MENU_ITEM_ACTION(spMenuSetPwr,0,"20 dBm", SimplePeripheral_setOutputPower)
    MENU_ITEM_ACTION(spMenuSetPwr,1,"0 dBm", SimplePeripheral_setOutputPower)
    MENU_OBJ_END
    bool SimplePeripheral_setOutputPower(uint8 index)
    {
        bool status = TRUE;
        switch(index)
        {
            case 0:
                HCI_EXT_SetTxPowerCmd(LL_EXT_TX_POWER_20_DBM);
                break;
            case 1:
                HCI_EXT_SetTxPowerCmd(LL_EXT_TX_POWER_0_DBM);
                break;
            default:
                break;
        }
        return status;
    }

  • Hi Eirik,

    Have you measured the rssi value with an iOS/Android app (e.g. nRF Connect)?

    Do you notice a change in the rssi value when you modify the TX power?

     

    For me, the rssi value doesn’t change (or only slightly) and that’s the problem.

     

    Thanks in advance for your response.

     

    Regards,

    Nicolas

  • Hello Nicolas,

    I use an RF coaxial cable between two launchpads with 60 dB attenuation and start RSSI measurements (feature in central example). I clearly see a delta in 20 dB between the two settings.

    Have you considered the RSSI saturation level on your phone might be reached?