DA14683: At what point during power up is the BLE TX Power Level Set?

Hardware:

Custom DA14683 Board

Latest SDK = 1.0.14.1081 (Last updated in 2018)

 

Situation:

This question applies to any demo, but lets take the BMS demo for an example.

From hw_rf.h, I can see where the tx power levels are defined in this enum:

typedef enum {
        HW_RF_PWR_LUT_0dbm = 0,   /**< TX PWR attenuation 0 dbm */
        HW_RF_PWR_LUT_m1dbm = 1,  /**< TX PWR attenuation -1 dbm */
        HW_RF_PWR_LUT_m2dbm = 2,  /**< TX PWR attenuation -2 dbm */
        HW_RF_PWR_LUT_m3dbm = 3,  /**< TX PWR attenuation -3 dbm */
        HW_RF_PWR_LUT_m4dbm = 4,  /**< TX PWR attenuation -4 dbm */
} HW_RF_PWR_LUT_SETTING;

From hw_rf.c, I can see the function that sets the TX power level:

void hw_rf_set_tx_power_ble(HW_RF_PWR_LUT_SETTING lut)
{
        RFCU->RF_TX_PWR_BLE_REG = lut;
        rf_tx_power_luts.tx_power_ble = lut;
}

...But the "hw_rf_set_tx_power_ble()" function does not appear to be called anywhere.  

...Also none of the enums from "HW_RF_PWR_LUT_SETTING" appear anywhere in the project.

It is unclear where the TX power is being defined.  It is also unclear at what point in the power up sequence the TX power is being set.

Questions:

1) Where is the default TX Power level defined? (file and line please)

2) At what point in the BLE radio initialization sequence is the TX power level set? (file and line please)

3) If I wanted to change the BLE radio TX power level, what is the correct sequence of operations to do so? (do I need to power down the radio first?, just stop advertising?, etc)

Parents Reply Children
  • Thank you for the detailed reply.

    I previously missed the //comment on the "__RETAINED" attribute definition that indeed says the data is zero-initialized.  Thank you for clarifying that.  It now makes sense that the default value is being set to 0 = HW_RF_PWR_LUT_0dbm, even if it's done in an obscure way.

    I don't feel like we will make any more progress on digging into "ad_rf_request_recommended_settings()" which I posted above, so I won't push this issue.  But I will make the comment that I don't think there is enough documentation about the registers used in that function for me to independently just go "look it up".  It's pretty clear you didn't want people playing with this part of the system.

    While the Dialog/Renesas guys don't want to support the TX Attenuator "hw_rf_set_tx_power_ble()" function, if anyone needs lower output power, as I independently determined it looks like you can call that function before ble_peripheral_start() and it works as you might expect, which is the actual answer to the title question in this thread.  I guess we are done.