The debug module intends to improve the overall debugging experience in the application. By default, it subscribes to all the events in the system and implements support for Memfault through the Memfault module integrated in nRF Connect SDK.
To enable the debug module, you must include the
../overlay-debug.conf overlay configuration file when building the application.
This section documents the various features implemented by the module.
Memfault SDK provides the functionality to collect information from devices in the form of coredumps, error traces, metrics, logs and more. Information that is collected from the device can be sent to Memfault’s cloud solution for further analysis.
The debug module uses Memfault SDK to track nRF Connect SDK specific metrics such as LTE and stack metrics. In addition, the following types of custom Memfault metrics are defined and tracked when compiling in the debug module:
GnssTimeToFix- Time duration between the start of a GNSS search and obtaining a fix.
GnssTimeoutSearchTime- Time duration between the start of a GNSS search and a search timeout.
GnssSatellitesTracked- Number of satellites tracked during a GNSS search window.
The debug module also implements Memfault SDK software watchdog, which is designed to trigger an assert before an actual watchdog timeout. This enables the application to be able to collect coredump data before a reboot occurs.
To enable Memfault, you must include the
../overlay-memfault.conf when building the application.
To get started with Memfault, see Using Memfault SDK.
- CONFIG_DEBUG_MODULE_MEMFAULT_USE_EXTERNAL_TRANSPORT - Configuration for transfer of Memfault data
This option, if enabled, makes the debug module trigger events carrying Memfault data. This data can be routed through an external transport to Memfault cloud, for example, through AWS IoT, Azure IoT Hub, or nRF Cloud.
- CONFIG_DEBUG_MODULE_MEMFAULT_HEARTBEAT_INTERVAL_SEC - Configuration for nRF Connect SDK Memfault metrics tracking interval
This option sets the time interval for tracking nRF Connect SDK Memfault metrics.
- CONFIG_DEBUG_MODULE_MEMFAULT_CHUNK_SIZE_MAX - Configuration for maximum size of transmitted packets
This option sets the maximum size of packets transmitted over the configured custom transport.
To enable Memfault, you must set the following mandatory options:
To get detailed stack traces in coredumps sent to Memfault, you can increase the values for the following options:
CONFIG_PM_PARTITION_SIZE_MEMFAULT_STORAGE- For example, you can increase the value to
CONFIG_MEMFAULT_COREDUMP_STACK_SIZE_TO_COLLECT- For example, you can increase the value to
For extended documentation regarding nRF Connect SDK Memfault integration, see Memfault module.
This module has no internal states.
asset_tracker_v2/src/events/debug_module_event.h header file contains a list of various events sent by the module.
This application uses the following nRF Connect SDK libraries and drivers:
- group debug_module_event
Debug module event.
Event carrying memfault data that should be forwarded via the configured cloud backend to Memfault cloud. Only sent if CONFIG_DEBUG_MODULE_MEMFAULT_USE_EXTERNAL_TRANSPORT is enabled. Payload is of type debug_module_memfault_data.
The payload is heap allocated and must be freed after use.
Event sent after boot when building for QEMU x86. This event acts as a placeholder for MODEM_EVT_INITIALIZED which is not sent due to the modem module being disabled for QEMU x86 builds.
Event sent when the application is built for QEMU x86. When built for QEMU x86 it is assumed that the application is connected to the network.
An irrecoverable error has occurred in the debug module. Error details are attached in the event structure.
- enumerator DEBUG_EVT_MEMFAULT_DATA_READY
- #include <debug_module_event.h>
- enum debug_module_event_type