I'm trying to add memfault to an existing project but I'm getting this error
C:/ncs/v3.1.0/modules/lib/memfault-firmware-sdk/components/core/src/memfault_custom_data_recording.c:23: fatal error: opening dependency file modules\memfault-firmware-sdk\CMakeFiles\..__modules__lib_
__memfault-firmware-sdk__ports__zephyr.dir\C_\ncs\v3.1.0\modules\lib\memfault-firmware-sdk\components\core\src\memfault_custom_data_recording.c.obj.d: No such file or directory
23 |
|
compilation terminated.
[461/591] Building C object modules/memfault-firmware-sdk/CMakeFiles/..__modules__lib__memfault-firmware-sdk__ports__zephyr.dir/938aa1c45e674412a15b8b95d6992ab6/src/memfault_[462/591] Building C object modules/memfault-firmware-sdk/CMakeFiles/..__modules__lib__memfault-firmware-sdk__ports__zephyr.dir/938aa1c45e674412a15b8b95d6992ab6/src/memfault_[463/591] Building C object modules/mcuboot/boot/bootutil/zephyr/CMakeFiles/mcuboot_util.dir/C_/ncs/v3.1.0/bootloader/mcuboot/boot/bootutil/src/bootutil_public.c.obj [465/591] Building C object modules/memfault-firmware-sdk/CMakeFiles/..__modules__lib__memfault-firmware-sdk__ports__zephyr.dir/02d252e6128e8f5257145ffc9929f0a2/core/src/memfault_core_utils.c.obj
ninja: build stopped: subcommand failed.
[10/20] No configure step for 'mcuboot'
FAILED: _sysbuild/sysbuild/images/nrf_cloud_multi_service_2-prefix/src/nrf_cloud_multi_service_2-stamp/nrf_cloud_multi_service_2-build C:/IKIN_FIRMWARE_FILES/nrf_cloud_multi_service_2/build/_sysbuild/
I added this to my prj.conf
CONFIG_MEMFAULT=y
CONFIG_MEMFAULT_NCS_PROJECT_KEY="***************************************************"
CONFIG_MEMFAULT_USER_CONFIG_ENABLE=n
CONFIG_MEMFAULT_DEVICE_INFO_CUSTOM=y
CONFIG_MEMFAULT_NCS_DEVICE_ID_RUNTIME=y
created these file
config/memfault_platform_config.h
config/memfault_metrics_heartbeat_config.def
config/memfault_trace_reason_user_config.def
in cmakelists
zephyr_include_directories(config)
added this in my application:
#include "memfault/core/platform/device_info.h"
void memfault_platform_get_device_info(sMemfaultDeviceInfo *info) {
// !FIXME: Populate with platform device information
//
// *NOTE* All fields must be populated, and the values assigned to the fields
// must have static lifetime: the data is accessed when this function returns.
// In this example, the fields are string literals, which are placed either
// inline into .text data tables, or in .rodata, and the pointers are valid
// for the lifetime of the program
//
// See https://mflt.io/version-nomenclature for more context
*info = (sMemfaultDeviceInfo) {
// Set the device serial to a unique value.
// It is typically set to a unique identifier like a serial number
// or MAC address.
// This is used to de-deduplicate data in Memfault cloud
.device_serial = "DEMOSERIAL",
// Set the device software type.
// It can be simply "app" for a single-chip device, otherwise it
// should match the component name, eg "ble", "sensor" etc.
// This is used to filter devices in the Memfault UI
.software_type = "app-main",
// Set the device software version.
// If using Memfault OTA, this should exactly match the OTA Release
// Version name for the installed image
.software_version = "1.0.0-dev",
// Set the device hardware revision.
// This is used to filter/group devices in the Memfault UI
.hardware_version = "evt",
};
}
NCS version : 2.9.1 and 3.1.0(same error in both SDKs)