Dynamic Power Control for Advertising - Difference between wanted and actual TX power

Hello everyone,

I am doing some testing regaring advertising TX power on peripheral side with BLE.

I am using NCS version 2.6.1.

Hardware: nRF52840 Dev Kit

My tests have so far been based on the given sample: HCI power control. The function of interest is:

static void set_tx_power(uint8_t handle_type, uint16_t handle, int8_t tx_pwr_lvl)

At the very end of the function I have added a log message to log the argument of the function tx_pwr_lvl and the actual TX power level as supplied in the response:

printk("TX - tried to set: %d, actual: %d\n", tx_pwr_lvl, rp->selected_tx_power);

Expected: That both the TX power I am trying to set and the TX power in the response are identical.

Instead, both numbers differ:

TX - tried to set: -10, actual: -10
TX - tried to set: 5, actual: 2
TX - tried to set: 20, actual: 18
TX - tried to set: -40, actual: -30
TX - tried to set: 0, actual: -2

Now I have some questions:

  • Why is there a difference between the TX power I try to set and the actual TX power configured by the controller?
  • Where does this difference come from?
  • What can I do to get a minimal difference between wanted and actual TX power?
  • Where can I find documentation regarding this behaviour? I expect I have to look into the softdevice specification? But I was not able to find a link from the application interface ov the BLE stack to the softdevice specification. Example:

Thank you for your help!

Markus

Parents
  • Hi, 

    The nRF52840 supports -40 to +8 dBm TX power, configurable in 4 dB steps and set by the TXPOWER register for the radio peripheral. See nRF52840 Product Specification

    It seems the controller attempted to set the TX power to the requested value, but if it's not possible, it will set the closest possible value. This is why you might see a difference between the requested and actual TX power.

    If you run the unmodified sample, you should be able to get this result:

    *** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
    Starting Dynamic Tx Power Beacon Demo
    [00:00:00.000,427] <inf> bt_sdc_hci_driver: SoftDevice Controller build revision: 
                                                36 f0 e5 0e 87 68 48 fb  02 fd 9f 82 cc 32 e5 7b |6....hH. .....2.{
                                                91 b1 5c ed                                      |..\.             
    [00:00:00.002,868] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
    [00:00:00.002,899] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
    [00:00:00.002,929] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 54.58864 Build 1214809870
    [00:00:00.003,814] <inf> bt_hci_core: Identity: EF:06:74:2A:38:07 (random)
    [00:00:00.003,845] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x118f, manufacturer 0x0059
    [00:00:00.003,875] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0x118f
    Bluetooth initialized
    Dynamic Tx power Beacon started
    Get Tx power level ->-> default TXP = 0
    Set Tx power level to 4
    Actual Tx Power: 4
    Get Tx power level -> TXP = 4
    Set Tx power level to 0
    Actual Tx Power: 0
    Get Tx power level -> TXP = 0
    Set Tx power level to -3
    Actual Tx Power: -4
    Get Tx power level -> TXP = -4
    Set Tx power level to -8
    Actual Tx Power: -8
    Get Tx power level -> TXP = -8
    Set Tx power level to -15
    Actual Tx Power: -16
    Get Tx power level -> TXP = -16
    Set Tx power level to -18
    Actual Tx Power: -20
    Get Tx power level -> TXP = -20
    Set Tx power level to -23
    Actual Tx Power: -40
    Get Tx power level -> TXP = -40
    Set Tx power level to -30
    Actual Tx Power: -40

    Regards,
    Amanda H.

  • Thank you for the clarification.

    One note regarding the step size of the available TX powers. In the product specification v1.8 on page 347, there are more options listed ranging from -40 dBm to +8 dBm.

Reply Children
No Data
Related