This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Dynamic TX power not possible with zephyr controller and extended advertising

Hello fellow bit jugglers!

We are developing an application for a nRF52805 on a nRF52-DK board, using NCS.

NCS version: 1.7.1

Zephyr version: 2.6.99-ncs1-1 (commit 18e072b03270436fcd58312217fa8f362abb5ccd)

BLE controller: Zephyr

IDE: SEGGER studio

OS: Windows 8

The problem we face is that we can't get dynamic TX power (TX power in dBm selectable during runtime) running under the following conditions:

- use the Zepyhr controller, not the standard Nordic controller (we need to use the Zepyhr controller due to RAM shortage)

- use extended advertising (also a given for our application)

We noted this behaviour in our application, but to demonstrate it with a minimal reproducable example, I modified the sample bluetooth/hci_pwr_ctrl.

The only changes we made to the example were:

- use the Zepyhr controller

- use extended advertising

The exact changes are attached. (Final files + git patch)

The problem we face is that the extended message appears in the nRF connect app, but the RSSI value does not change significantly (around -46 dBm).

When I change the controller back to Nordic controller (by removing CONFIG_BT_LL_SW_SPLIT=y), the RSSI value steadily decreases, as expected.

I guess the problem must be somewhere inside the Zepyhr controller, but I was not able to trace the calls through the various layers there (Ticker, Mayfly, lll, ...)

Any idea?

Cheers

Pat

git_changes.patch

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* main.c - Application main entry point */
/*
* Copyright (c) 2019 Andrei Stoica
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/types.h>
#include <stddef.h>
#include <sys/printk.h>
#include <sys/util.h>
#include <sys/byteorder.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_vs.h>
#include <bluetooth/conn.h>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
52332.prj.conf

Parents
  • Hi Pat,

    Vinayak has posted a PR upstream that you can test to see if it works for you: 

    https://github.com/zephyrproject-rtos/zephyr/pull/41133

    It would be great if you could try it out and then leave a comment in the PR itself.

  • Perfect, thank you two very much! I'll try this out this week and give you feedback then!

  • I'm sorry, but as you see, it became a bit later than a week until I finally could check this PR. I couldn't directly cherry-pick the PR because of merge conflicts, but when I manually copied the changes from the commit, it now seems to work! Meaning I can now adapt the TX power!

    So this means now, wait until the changes from official Zepyhr main are taken over by downstream Nordic Zepyhr repo, right?

    Also, thanks to you all, and a happy new year!

Reply
  • I'm sorry, but as you see, it became a bit later than a week until I finally could check this PR. I couldn't directly cherry-pick the PR because of merge conflicts, but when I manually copied the changes from the commit, it now seems to work! Meaning I can now adapt the TX power!

    So this means now, wait until the changes from official Zepyhr main are taken over by downstream Nordic Zepyhr repo, right?

    Also, thanks to you all, and a happy new year!

Children
No Data