Procedures for integrating nRF Cloud into a Bluetooth Mesh Project

Hello.

I am currently testing nRF Cloud and encountering an issue.
I encountered a build error when merging the Peripheral Memfault Diagnostic Service (MDS) sample program into my existing Bluetooth Mesh project.

In file included from C:/ncs/v3.2.1/modules/lib/memfault-firmware-sdk/ports/zephyr/common/metrics/memfault_platform_bluetooth_metrics.c:17:
C:/ncs/v3.2.1/zephyr/subsys/bluetooth/controller/ll_sw/lll.h:95:37: error: 'CONFIG_BT_CTLR_SCAN_AUX_SET' undeclared here (not in a function); did you mean 'CONFIG_BT_CTLR_ADV_SET'?
   95 |                                    (CONFIG_BT_CTLR_SCAN_AUX_SET) - 1),
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                     CONFIG_BT_CTLR_ADV_SET

C:\ncs\v3.2.1\zephyr\subsys\bluetooth\controller\ll_sw\lll.h

#if defined(CONFIG_BT_OBSERVER)
	TICKER_ID_SCAN_STOP,
	TICKER_ID_SCAN_BASE,
	TICKER_ID_SCAN_LAST = ((TICKER_ID_SCAN_BASE) + (BT_CTLR_SCAN_SET) - 1),
#if defined(CONFIG_BT_CTLR_ADV_EXT)
#if defined(CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS)
	TICKER_ID_SCAN_AUX,
#else /* !CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS */
	TICKER_ID_SCAN_AUX_BASE,
	TICKER_ID_SCAN_AUX_LAST = ((TICKER_ID_SCAN_AUX_BASE) +
				   (CONFIG_BT_CTLR_SCAN_AUX_SET) - 1),
#endif /* !CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS */

To investigate, I tried the opposite approach: adding only the required Bluetooth Mesh configurations to the MDS sample program.
However, this resulted in the exact same error.
Added settings:

CONFIG_BT_OBSERVER=y
CONFIG_BT_EXT_ADV=y
CONFIG_BT_CTLR_ADV_EXT=y

The source of the conflict is as follow:
To enable Mesh, it is necessary to enable CONFIG_BT_OBSERVERCONFIG_BT_EXT_ADV, and CONFIG_BT_CTLR_ADV_EXT.
When these are enabled, CONFIG_BT_LL_SW_SPLIT becomes a mandatory requirement.
( Specifically, both CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS and CONFIG_BT_CTLR_SCAN_AUX_SET depend on CONFIG_BT_LL_SW_SPLIT is enabled. )

Is it possible to integrate nRF Cloud without enabling CONFIG_BT_LL_SW_SPLIT?
According to the Kconfig search, CONFIG_BT_LL_SW_SPLIT is marked [EXPERIMENTAL] feature.
Unless there is a specific or mandatory reason for its use, I would like to avoid enabling it to ensure project stability.

a.da

  • Hi Edvin,

    Unfortunately, we don't provide the Memfault service over Bluetooth Mesh at this point in time. 

    It is probably still possible to add the memfault service as a BLE service (but you would need to connect to the device via Bluetooth (not mesh) to use it.

    Yes, I understand.

    I assume this is what you tried originally. Would it be possible to upload the project where you tried to add the memfault service? And what was it that you added that caused it to fail?

    Instead of my actual project, I am attaching a sample program that reproduces the exact same build error.
    I would like to keep this ticket public so that it remains accessible to others, and the issue is easily reproducible using this sample.

    light_ctrl.zip

    Specifically, I merged the 'prj.conf' from the MDS sample into the 'prj.conf' of the Lightness Controller sample.
    Please note that I have omitted the Memfault Project Key.

    Best regards,

    a.da

  • Hello, and thank you!

    I looked at your project, and you are right. I see the same error that you see.

    I am still not sure why it occurs only in this mesh project, and not if I try to enable it in e.g. a normal BLE project.

    I did find out that if I set:
    CONFIG_MEMFAULT_METRICS_BLUETOOTH=n

    it builds without the same error.

    There is a bug in the memfault libraries somewhere, and it is related to line 17 on v3.2.1\modules\lib\memfault-firmware-sdk\ports\zephyr\common\metrics\memfault_platform_bluetooth_metrics.c:

    #include "controller/ll_sw/lll.h"

    The Kconfig from the build log, CONFIG_BT_CTLR_SCAN_AUX_SET, and this line both refer to the Zephyr bluetooth controller, this name is not used in the Softdevice controller. But I am not sure why it is not triggered in a normal BLE project, but it is in the Bluetooth Mesh project. I have reached out to our Memfault team, but I have not heard back from them yet.

    You can continue to dig and see if you figure out why it fails in this Mesh project, and not e.g. in the v3.2.1\nrf\samples\bluetooth\peripheral_uart project. I will get back to you when I hear from the Memfault team.

    Best regards,

    Edvin

  • Hi Edvin, thank you for your thorough investigation.

    I did find out that if I set:
    CONFIG_MEMFAULT_METRICS_BLUETOOTH=n

    it builds without the same error.

    I have confirmed that setting 'CONFIG_MEMFAULT_METRICS_BLUETOOTH=n' allows the build to complete successfully without any errors in both the sample project and my project.

    I understand that this is a temporary workaround.
    However, I was unable to find any information in the Nordic or Memfault documentation regarding which specific metrics are affected by disabling this configuration.
    If you have any insights on this, please let me know.

    I look forward to an official fix for the Memfault libraries.

    Best regards,

    a.da

Related