Issues with peripheral_mds with CONFIG_MEMFAULT_NCS_DEVICE_ID_RUNTIME=y

I am trying to test with Dynamic device ID at run time and The chunks are not uploaded to memfault cloud  through anroid nrf memfault application (See the attached screenshot). Things are working fine with if statice Device ID  is used.

following are the logs from the NRF52840DK (As seen in the logs chunks are sent successfully)

uart:~$ *** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
Starting Bluetooth Memfault example
Bluetooth initialized
Advertising successfully started


[00:00:00.005,950] <inf> mflt: Reset Reason, RESETREAS=0x1
[00:00:00.006,011] <inf> mflt: Reset Causes:
[00:00:00.006,042] <inf> mflt: Pin Reset
[00:00:00.006,988] <inf> mflt: GNU Build ID: d701d1cef41e4674fd3393ea0e8d881a5aea868b
[00:00:00.037,109] <err> settings: set-value failure. key: bt/name error(-2)
uart:~$ Connected 98:0D:6F:A9:25:CA (public)
Security changed: 98:0D:6F:A9:25:CA (public) level 2
[00:00:20.576,171] <dbg> mds: data_export_ccc_changed: MDS Data Export CCCD changed, handle: 31, value: 0x0001
[00:00:22.076,049] <dbg> mds: device_identifier_read: MDS Device Identifier characteristic read, handle: 24, conn: 0x20002740
[00:00:22.196,075] <dbg> mds: data_uri_read: MDS Data URI characteristic read, handle: 26, conn: 0x20002740
[00:00:22.285,919] <dbg> mds: authorization_read: MDS Authorization characteristic read, handle: 28, conn: 0x20002740
[00:00:22.406,097] <dbg> mds: data_export_write: MDS Data Export characteristic write, handle 30, conn: 0x20002740
[00:00:22.406,738] <dbg> mds: mds_data_send: Memfault diagnostic data chunk 0 successfully sent

Android App screenshot below

Code diff is given below:

C:\Users\mahes\git\ws\nrf\samples>git diff
diff --git a/samples/bluetooth/peripheral_mds/prj.conf b/samples/bluetooth/peripheral_mds/prj.conf
index e4cbed98f..ba7904afe 100644
--- a/samples/bluetooth/peripheral_mds/prj.conf
+++ b/samples/bluetooth/peripheral_mds/prj.conf
@@ -37,12 +37,15 @@ CONFIG_HEAP_MEM_POOL_SIZE=256

CONFIG_MEMFAULT=y
CONFIG_MEMFAULT_SHELL=y
+CONFIG_MEMFAULT_NCS_PROJECT_KEY=""

-CONFIG_MEMFAULT_NCS_PROJECT_KEY=""
-CONFIG_MEMFAULT_NCS_DEVICE_ID=""
-
+#CONFIG_MEMFAULT_NCS_DEVICE_ID="NRF52840DK"
+CONFIG_MEMFAULT_NCS_DEVICE_ID_RUNTIME=y
CONFIG_MEMFAULT_NCS_BT_METRICS=y

+CONFIG_MEMFAULT_LOG_LEVEL_DBG=y
+CONFIG_MEMFAULT_NCS_LOG_LEVEL_DBG=y
+
# Enable bonding
CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
@@ -53,3 +56,4 @@ CONFIG_SETTINGS=y

# This example requires more stack
CONFIG_MAIN_STACK_SIZE=1152
+CONFIG_BT_MDS_LOG_LEVEL_DBG=y
diff --git a/samples/bluetooth/peripheral_mds/src/main.c b/samples/bluetooth/peripheral_mds/src/main.c
index bbbc08957..685949274 100644
--- a/samples/bluetooth/peripheral_mds/src/main.c
+++ b/samples/bluetooth/peripheral_mds/src/main.c
@@ -20,6 +20,7 @@
#include <memfault/core/trace_event.h>

#define DEVICE_NAME CONFIG_BT_DEVICE_NAME
+//#define DEVICE_NAME "DBG-MEMFAULT"
#define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)

#define RUN_STATUS_LED DK_LED1
@@ -324,7 +325,6 @@ int main(void)
return 0;
}
}
-
err = bt_le_adv_start(BT_LE_ADV_CONN, ad, ARRAY_SIZE(ad),
sd, ARRAY_SIZE(sd));
if (err) {
diff --git a/samples/matter/lock/child_image/mcuboot/boards/nrf52840dk_nrf52840.overlay b/samples/matter/lock/child_image/mcuboot/boards/nrf52840dk_nrf52840.overlay
index 69bf97573..9ded0688d 100644
--- a/samples/matter/lock/child_image/mcuboot/boards/nrf52840dk_nrf52840.overlay
+++ b/samples/matter/lock/child_image/mcuboot/boards/nrf52840dk_nrf52840.overlay
@@ -9,3 +9,4 @@
nordic,pm-ext-flash = &mx25r64;
};
};
+
\ No newline at end of file
diff --git a/samples/matter/lock/prj.conf b/samples/matter/lock/prj.conf
index 0d717cd98..28e1a948b 100644
--- a/samples/matter/lock/prj.conf
+++ b/samples/matter/lock/prj.conf
@@ -29,10 +29,9 @@ CONFIG_THREAD_NAME=y
CONFIG_MPU_STACK_GUARD=y
CONFIG_RESET_ON_FATAL_ERROR=n
CONFIG_CHIP_LIB_SHELL=y
-
# Reduce application size
CONFIG_USE_SEGGER_RTT=n

# Enable Factory Data feature
CONFIG_CHIP_FACTORY_DATA=y
-CONFIG_CHIP_FACTORY_DATA_BUILD=y
+#CONFIG_CHIP_FACTORY_DATA_BUILD=y

Appreciate if you can help with this quickly

Thanks,

Mahesh

  • Hello,

    Can you please zip and upload your application? And does it work as expected in the unmodified sample? 

    Did you try the iOS version of the app as well? Does it fail the same way?

    I was not aware of this app before now, so I have not tested it, but you are saying that the issue is that the chunks are not uploading, right?

    Does this have anything to do with Matter? (I see that there are some mentions of the Matter door lock sample in your diff).

    Best regards,

    Edvin

  • Can you please zip and upload your application? And does it work as expected in the unmodified sample? 

    <Mahesh> Unmodified sample works fine as expected, But it need runtime  deviceid support to use it on multiple devices

    It's sample app avaialble at nrf/samples/bluetooth/peripheral_mds, and only change neeeed is to define 

     CONFIG_MEMFAULT_NCS_DEVICE_ID_RUNTIME=y

    Did you try the iOS version of the app as well? Does it fail the same way?

    <Mahesh> Unfortunately I don't have iphone to try it out

    I was not aware of this app before now, so I have not tested it, but you are saying that the issue is that the chunks are not uploading, right?

    <Mahesh> Chunks are expected to be uploaded  to memfault cloud for further debugging

    Does this have anything to do with Matter? (I see that there are some mentions of the Matter door lock sample in your diff).

    <Mahesh> This is not related to  matter, you can ignore the lock diff(I was checking matter lock sample in the same ws)

    Thnaks,

    Mahesh

  • Hello,

    I understand,

    When I try to change only these CONFIGs from the unmodified samples:

    CONFIG_MEMFAULT_NCS_PROJECT_KEY="E9wKuEnlseZG9kKjE8XCqTywtwkW9ssP"
    CONFIG_MEMFAULT_NCS_DEVICE_ID="NRF53DK"
    CONFIG_MEMFAULT_NCS_DEVICE_ID_RUNTIME=y
    I am not able to remain connected using the iOS app. Are you seeing the same? Or does it remain connected?
    What does the log from the nRF52 say?
    Best regards,
    Edvin
  • I am using NRF52840DK,  Able to connect and chunks are being pushed to memfault app, but  the chunks are not uploaded to cloud. 

    1) All the chunks received are under pending 

    2) The Device Id is empty

    Thanks,

    Mahesh

  • Hello,

    Sorry for the late reply. 

    Did you try to investigate why the chunks doesn't have a Device ID? They are supposed to have that, right, even though you are setting it runtime? Did you find an API to set it during runtime? Are they uploaded to cloud if you populate the Device ID?

    BR,
    Edvin

Related