Hello,
I'm trying to log user data via memfault sdk. As I understand here I have to use
Hello,
I'm trying to log user data via memfault sdk. As I understand here I have to use
CONFIG_MEMFAULT=y CONFIG_MEMFAULT_COREDUMP_COLLECT_DATA_REGIONS=y CONFIG_MEMFAULT_HEAP_STATS=y CONFIG_MEMFAULT_LOGGING_ENABLE=y CONFIG_MEMFAULT_LOGGING_RAM_SIZE=1000 CONFIG_BT_MDS=y CONFIG_MEMFAULT_NCS_BT_METRICS=y
static int memfault_custom_init(const struct device *dev) { ARG_UNUSED(dev); int err = 0; memfault_log_boot(s_log_buf_storage, sizeof(s_log_buf_storage)); return err; } SYS_INIT(memfault_custom_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY);
#define MEMFAULT_LOG_DEBUG(...) \ MEMFAULT_LOG_SAVE(kMemfaultPlatformLogLevel_Debug, __VA_ARGS__) #define MEMFAULT_LOG_INFO(...) \ MEMFAULT_LOG_SAVE(kMemfaultPlatformLogLevel_Info, __VA_ARGS__) #define MEMFAULT_LOG_WARN(...) \ MEMFAULT_LOG_SAVE(kMemfaultPlatformLogLevel_Warning, __VA_ARGS__) #define MEMFAULT_LOG_ERROR(...) \ MEMFAULT_LOG_SAVE(kMemfaultPlatformLogLevel_Error, __VA_ARGS__)
Hi,
Have you tried setting the desired log level as well? CONFIG_MEMFAULT_LOG_LEVEL_*.
You can also send logs over BLE using the Bluetooth: NUS shell transport. The Shell is automatically enabled as a logging backend when this is included in the application.
Best regards,
Jørgen
Hi Jørgen,
I tried to add CONFIG_MEMFAULT_LOG_LEVEL_INF=y but same result, no log data in the dashboard.
Regarding NUS shell transport, I tried to test the sample shell_bt_nus, and I could send some shell commands using a smartphone, but I didn't /couldn't receive the logs via the BLE. Is there any configuration needed to enable logs in the prj.conf
now I tried to add the next
and I added a delayable work to print logs frequently but I didn't receive those logs by BLE.
something like that!
Regards,
I see that MEMFAULT logging is marked as experimental, which may be why you are not able to see logs properly.
Did you enable the NUS logger shell by setting "CONFIG_SHELL_BT_NUS=y" and "CONFIG_SHELL_LOG_BACKEND=y" as well?
Edit: It seems you need to set "CONFIG_LOG_MODE_DEFERRED=y" to enable logging with the shell, as CONFIG_LOG_MODE_MINIMAL is incompatible with CONFIG_SHELL_LOG_BACKEND.
Thanks Jørgen,
Still no log output via BLE
the prj.conf
CONFIG_NCS_SAMPLES_DEFAULTS=y CONFIG_HEAP_MEM_POOL_SIZE=2048 CONFIG_BT=y CONFIG_BT_SMP=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DEVICE_NAME="BT_NUS_shell" CONFIG_BT_DEVICE_APPEARANCE=833 CONFIG_SHELL_LOG_BACKEND=y CONFIG_BT_MAX_CONN=2 CONFIG_BT_MAX_PAIRED=2 CONFIG_LOG_MODE_DEFERRED=y # Enable the BT NUS shell CONFIG_SHELL_BT_NUS=y