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

Separate transmit power setting for BLE and Thread when using MPSL

Hello,

I have a design where I am using an nRF52840 along with a SKY66112-11 and am using Zephyr/MPSL for both BLE and Thread. Some questions:

1) The .dts node has pa_gain_db and lna_gain_db parameters, which default to ~20dBm and ~11dBm for the skyworks part. What are these parameters actually used for by the MPSL library? Do they affect CSMA thresholds, etc?

2) How do I reduce BLE transmit power such that BLE still operates at ~0dBm (which is our desired operation for BLE) while still allowing the Thread packets to transmit at high power?

I noticed that there is a CONFIG_BT_CTLR_TX_PWR setting in Zephyr but that does not seem to have any effect.

Thanks

Jon

  • Update: I have also tried the following code in an attempt to alter the BLE TX power (tested by monitoring advertisement power levels). However, this code has no effect:

    static mpsl_tx_power_envelope_t sEnvelope =
    {
    .phy = MPSL_PHY_BLE_1M,
    .envelope = {-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6}
    };
    
    mpsl_tx_power_channel_map_set(&sEnvelope);

    FYI - I am using NCS/Zephyr along with OpenThread

    Jon

  • Honestly speaking, I have not tried to control power with BLE/Thread combo in Zephyr, but CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL should expose HCI commands to write and read the TX power. Can you give me your project and your attempt of writing these HCI commands so that I can try to dig into it and figure out what else needs to enabled for this feature to work.

  • I don't think I can provide our project since it part of the CHIP (Matter) SDK development. If there is a BLE/Thread (on Zephyr) example you can point me to with the correctly-configured setup that I can evaluate I can probably work from there. Specifically, I need an example that:

    a) Configures Thread transmit power at +0dBm

    b) Configures BLE transmit power at -20dBm (e.g., advertisements are transmitted at -20dBm)

    or alternatively

    a) Provides some sort of callback from MPSL to the application layer before any Thread or BLE operations such that the the application can change power and/or reconfigure PA/LNA on FEM differently between BLE and Thread packets.

  • Okay, here is a project with a similar architecture to the project I am working on:

    https://github.com/project-chip/connectedhomeip/tree/master/examples/lock-app/nrfconnect

    The easiest way to get this project built (a summary of the Readme.md) is by performing the following steps on a Ubuntu or MacOS machine with docker installed:

    1. mkdir ~/WORK_DIR

    2. cd ~/WORK_DIR

    3. git clone https://github.com/project-chip/connectedhomeip.git

    4. mkdir nrfconnect

    2. cd connecdhomeip

    3. git submodule update --init

    4. docker pull nordicsemi/nrfconnect-chip

    5. docker run --rm -it -e RUNAS=$(id -u) -v ~/WORK_DIR/nrfconnect:/var/ncs -v ~/WORK_DIR/connectedhomeip:/var/chip \
    -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" nordicsemi/nrfconnect-chip

    [In the docker container]

    A. $ cd /var/chip

    B. $ setup

    C. $ python3 scripts/setup/nrfconnect/update_ncs.py --update

    D. $ cd examples/lock-app/nrfconnect

    E. $ west build -b nrf52840dk_nrf52840

    The built target code will be in (on the host machine):

    ~/WORK_DIR/connectedhomeip/examples/lock-app/nrfconnect/build/zephyr/zephyr.hex

    and will be in (inside the docker container):

    /var/chip/connectedhomeip/examples/lock-app/nrfconnect/build/zephyr/zephyr.hex

    Once this code is flashed onto a nrf52840-DK, pressing BUTTON 4 on the DK will place the BLE into advertising mode.

    I have found that the BLE advertisements ALWAYS are being sent at 0dBm.

    Things I have tried:

    a. setting BT_CTLR_TX_PWR_MINUS_20 in menuconfig

    b. setting BT_CTLR_TX_PWR_DYNAMIC_CONTROL in menuconfig

     

    Jon

  • Jon, We are thinly staffed due to summer vacation and I did not manage to test this yet and will be away second half of the day, so i will test this tomorrow earliest. Sorry for delays and I appreciate your patience.

Related