Skip to content

Commit

Permalink
fix(ble): set device ID after BLE init when using MAC address
Browse files Browse the repository at this point in the history
  ### Summary
  The device ID when using the MAC address was Unknown after the system
  booted because the device has not been given a MAC address yet at the
  time the device ID is set (system init). This change removes the option
  for using a MAC address as the device id for BLE devices, and sets a
  static device id for the BLE sample app.

  ### Test Plan
  - Tested on a nRF52840 DK with the peripheral_mds sample app
  ```
uart:~$ *** Booting nRF Connect SDK v3.5.99-ncs1-4965-g3733e7097909 ***
Starting Bluetooth Memfault example
Bluetooth initialized
Advertising successfully started
uart:~$ mflt get_device_info
[00:00:03.995,544] <inf> mflt: S/N: nrf-ble-testdevice
[00:00:03.995,605] <inf> mflt: SW type: nrf-ble-fw
[00:00:03.995,666] <inf> mflt: SW version: 0.0.1+688c47
[00:00:03.995,727] <inf> mflt: HW version: nrf52840dk_nrf52840
  ```
  • Loading branch information
gminn committed Sep 5, 2024
1 parent 6b6426a commit 5c83056
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions modules/memfault-firmware-sdk/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ config MEMFAULT_NCS_DEVICE_ID_IMEI
config MEMFAULT_NCS_DEVICE_ID_NET_MAC
bool "Use network interface MAC address as device ID"
select HW_ID_LIBRARY
depends on !BT
help
Use the device's network interface MAC address as Memfault device ID

Expand Down
2 changes: 1 addition & 1 deletion samples/bluetooth/peripheral_mds/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ See `Memfault SDK`_ for more information.

To send data to the Memfault cloud through a Bluetooth gateway, you must configure a project key using the :kconfig:option:`CONFIG_MEMFAULT_NCS_PROJECT_KEY` Kconfig option.
You can find your project key in the project settings at `Memfault Dashboards`_.
You also need to set the :kconfig:option:`CONFIG_MEMFAULT_NCS_DEVICE_ID` static Kconfig option for this sample
Use :kconfig:option:`CONFIG_MEMFAULT_NCS_DEVICE_ID` to set a static device ID. For this sample, the device id is ``ncs-ble-testdevice`` by default.

Building and running
********************
Expand Down
4 changes: 3 additions & 1 deletion samples/bluetooth/peripheral_mds/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ CONFIG_HEAP_MEM_POOL_SIZE=256

CONFIG_MEMFAULT=y
CONFIG_MEMFAULT_SHELL=y
CONFIG_MEMFAULT_LOGGING_ENABLE=y
CONFIG_MEMFAULT_LOG_LEVEL_INF=y

CONFIG_MEMFAULT_NCS_PROJECT_KEY=""
CONFIG_MEMFAULT_NCS_DEVICE_ID=""
CONFIG_MEMFAULT_NCS_DEVICE_ID="nrf-ble-testdevice"

CONFIG_MEMFAULT_NCS_BT_METRICS=y

Expand Down

0 comments on commit 5c83056

Please sign in to comment.