NCS sample peripheral_power_profiling gives build warning

Using NCS SDK v2.1.0 

Example Project: nrf/samples/bluetooth/peripheral_power_profiling

Building the example project gives build warnings:

Could you help me understand the second warning and how to fix it.

I am new to the nRF Connect SDK so I am trying to understand how the kconfig files work and all the dependencies. It appears this build has defined the acceptable range for this value as 1...0 which is non-sensical. The acceptable range is defined in Kconfig to be 1...BT_L2CAP_TX_MTU but I don't know where this value (BT_L2CAP_TX_MTU) comes from.

  • Hi Michael,

    As you can see from .config file located in the your_application_folder\build\zephyr, the value of BT_L2CAP_TX_MTU is set to 65, i.e. CONFIG_BT_L2CAP_TX_MTU=65. You get this value because CONFIG_BT_SMP is enabled in prj.conf. You can find all possible values for CONFIG_BT_L2CAP_TX_MTU in the KConfig documentation.

    I have tested the peripheral power profiling sample using nRF52840dk_nrf52840 as the build target, but I could not reproduce your issue. In other words, I did not get the warning related to BT_POWER_PROFILING_DATA_LENGTH.

    Peripheral power profiling sample supports several build targets. Could you specify which build target did you use? Is there any difference when you use other build targets?

    Best regards,
    Dejan

  • I am using the same target board: 

    This is looking more like a bug with VS code. When I look at the build output I only see the one warning about ASSERT. The other warning about BT_POWER_PROFILING_DATA_LENGTH does not appear in the build output. I even created a fresh new project and I get the same build warning in the "Problems" tab in VS code. 

    is there some way to clear this out? Or do I need to reinstall VS code?

    Note that I created new build configurations and tried different boards but always get the same 'phantom' build warning. 

  • Hi Michael,

    I used VS Code (v1.72.0) to build the sample and there was no warning related to BT_POWER_PROFILING_DATA_LENGTH. If you do not see this warning when you build the sample using command line, you could consider reinstalling VS Code.

    Best regards,
    Dejan

  • Reinstalling VS Code did not solve the problem. Further testing shows the same issue with each workspace I create. Basically the items in the 'Problems' tab never go away. As you can image this makes it very difficult to write code and compile with VS Code.

    To dupe the problem you would need to first change the code so it will generate build errors/warnings. Then fix the code and build again. The Problems tab should clear when you run the 2nd build but in my case it does not. 

    Microsoft reported this on their GitHub forum page for VS Code:

    Problems view gets updated automatically when an error is added/removed/updated. In your case, it means the corresponding extension is not updating. So please file issue against the extension.

    You can find similar issues by searching for "vs code problems refresh". Here is the page where I found the comment from Microsoft: 

    https://github.com/microsoft/vscode/issues/111443

    Note I am building on M1 Mac with the latest version of VS code and nRF Connect plugin: v2022.10.30

    Thanks for looking into this. 

  • Hi Michael,

    Can you try adding CONFIG_BT_L2CAP_TX_MTU=65 to your prj.conf before building? 

    Best regards,
    Dejan

Related