This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Not able to set transmission power using s110 APIs.

Hi , I tried to change the transmission power using the s110 API and tried checking if the value of the register storing the transmission power is changed or not. Following is the portion of code code that I wrote:

#define TX_POWER_LEVEL (-8)
.
.
err_code = sd_ble_gap_tx_power_set(TX_POWER_LEVEL);
APP_ERROR_CHECK(err_code);
int tx_power_value = NRF_RADIO->TXPOWER;

when I tried to read the register storing the tx power (TXPOWER as shown above), its still showing value 0 which I guess is by default initialized by softdevice. I am not able to understand why we are not able to update the transmission power.

also the sdk version I am using is v 6.1.0 and softdevice used is 7.3.0

Thank you in advance.

Parents
  • Hi,

    When the SoftDevice is enabled, the RADIO peripheral is protected. Trying to access its registers while it is running will yield invalid values. For more information about the protected peripherals, refer to the individual SoftDevice Specification. Here is the one for S110.

    There is currently no way to retrieve the TX power through an API call, but the SoftDevice will not change this by itself (unless you disable and re-enable the SoftDevice), so the last value given to sd_ble_gap_tx_power_set() should stay valid.

Reply
  • Hi,

    When the SoftDevice is enabled, the RADIO peripheral is protected. Trying to access its registers while it is running will yield invalid values. For more information about the protected peripherals, refer to the individual SoftDevice Specification. Here is the one for S110.

    There is currently no way to retrieve the TX power through an API call, but the SoftDevice will not change this by itself (unless you disable and re-enable the SoftDevice), so the last value given to sd_ble_gap_tx_power_set() should stay valid.

Children
Related