Commit b02f246
committed
feat: make Memfault project key optional
### Summary
In cases where an upstream device uploads data to Memfault on behalf
of a downstream device, the project key is not required. This change
allows the project key to be optional in those cases, which for the
NCS Memfault sources is when we are not using MDS or the Memfault
Zephyr HTTP client.
### Test Plan
Confirmed that before this change, the build fails if the project key
is not set for a generic cortex-m application where Memfault is enabled:
```
west build -b qemu_cortex_m3 -p always zephyr/samples/hello_world -- \
-DCONFIG_MEMFAULT=y \
-DCONFIG_MEMFAULT_NCS_FW_TYPE=\"test-app\" \
-DCONFIG_MEMFAULT_NCS_DEVICE_ID=\"my-test-device\"
```
Confirmed after this change, the build succeeds with this same build command.
Also confirmed that after this change, the build still fails if the project key
is not set for projects where MDS or the Memfault Zephyr HTTP client
are used:
```
west build --pristine always --board nrf52840dk/nrf52840 \
nrf/samples/bluetooth/peripheral_mds
...
/Users/gminnehan/projects/memfault-sdk-nrf-workspace/zephyr/include/zephyr/toolchain/gcc.h:87:36: error: static assertion failed: "Memfault Project Key not configured. Please visit https://goto.memfault.com/create-key/nrf91 "
87 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert((EXPR), "" MSG)
| ^~~~~~~~~~~~~~
/Users/gminnehan/projects/memfault-sdk-nrf-workspace/nrf/modules/memfault-firmware-sdk/memfault_integration.c:40:1: note: in expansion of macro 'BUILD_ASSERT'
40 | BUILD_ASSERT(sizeof(CONFIG_MEMFAULT_NCS_PROJECT_KEY) > 1,
| ^~~~~~~~~~~~
```
```
west build -b thingy91/nrf9160/ns -p always \
nrf/applications/asset_tracker_v2 -- \
-DOVERLAY_CONFIG=overlay-memfault.conf
...
/Users/gminnehan/projects/memfault-sdk-nrf-workspace/zephyr/include/zephyr/toolchain/gcc.h:87:36: error: static assertion failed: "Memfault Project Key not configured. Please visit https://goto.memfault.com/create-key/nrf91 "
87 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert((EXPR), "" MSG)
| ^~~~~~~~~~~~~~
/Users/gminnehan/projects/memfault-sdk-nrf-workspace/nrf/modules/memfault-firmware-sdk/memfault_integration.c:40:1: note: in expansion of macro 'BUILD_ASSERT'
40 | BUILD_ASSERT(sizeof(CONFIG_MEMFAULT_NCS_PROJECT_KEY) > 1,
| ^~~~~~~~~~~~
```1 parent 6e4a44d commit b02f246
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
0 commit comments