diff --git a/doc/nrf/libraries/debug/memfault_ncs.rst b/doc/nrf/libraries/debug/memfault_ncs.rst index 156200c870b..573d4b8c75e 100644 --- a/doc/nrf/libraries/debug/memfault_ncs.rst +++ b/doc/nrf/libraries/debug/memfault_ncs.rst @@ -70,7 +70,7 @@ If at any point the network is lost during the retry process, the library waits This feature is useful when you want to post the coredump as soon as possible after a crash and it is not desirable to wait for the next periodic upload set by :kconfig:option:`CONFIG_MEMFAULT_HTTP_PERIODIC_UPLOAD_INTERVAL_SECS`. Alternatively, you can manually trigger the coredump upload by calling the function :c:func:`memfault_zephyr_port_post_data`. -The :c:function:`memfault_coredump_has_valid_coredump` function can be used to check if a coredump is available. +The :c:func:`memfault_coredump_has_valid_coredump` function can be used to check if a coredump is available. Configuration options in Memfault SDK ===================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst index ad2c3540084..0d1f0155231 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -227,7 +227,7 @@ nRF Machine Learning (Edge Impulse) Serial LTE modem ---------------- -* Added overlay :file:`overlay-memfault.conf` to enable Memfault. +* Added an overlay :file:`overlay-memfault.conf` file to enable Memfault. For more information about Memfault features in |NCS|, see :ref:`mod_memfault`. * Updated the application to use the :ref:`lib_downloader` library instead of the deprecated :ref:`lib_download_client` library. @@ -618,7 +618,7 @@ Memfault integration -------------------- * Added a new feature to automatically post coredumps to Memfault when network connectivity is available. - This feature can be enabled by setting the :kconfig:option:`MEMFAULT_NCS_POST_COREDUMP_ON_NETWORK_CONNECTED` Kconfig option to ``y``. + To enable this feature, set the :kconfig:option:`MEMFAULT_NCS_POST_COREDUMP_ON_NETWORK_CONNECTED` Kconfig option to ``y``. Only supported for nRF91 Series devices. AVSystem integration diff --git a/modules/memfault-firmware-sdk/Kconfig b/modules/memfault-firmware-sdk/Kconfig index 53d6ebaf4c7..374d4a9a0d7 100644 --- a/modules/memfault-firmware-sdk/Kconfig +++ b/modules/memfault-firmware-sdk/Kconfig @@ -202,9 +202,18 @@ config MEMFAULT_NCS_POST_COREDUMP_ON_NETWORK_CONNECTED Post coredump to Memfault when the device is connected to LTE network. This option is only supported for nRF91 targets. +config MEMFAULT_NCS_POST_COREDUMP_AFTER_INITIAL_DELAY + bool "Post coredump after initial delay" + default y + help + Delay coredump posting to Memfault to avoid conflicts with the application's + TLS connection setup that occurs typically LTE network is obtained. + The delay duration is defined by CONFIG_MEMFAULT_NCS_POST_COREDUMP_RETRY_INTERVAL_SECONDS. +#ยง config MEMFAULT_NCS_POST_COREDUMP_RETRIES_MAX int "Max number of coredump post retries" default 3 + default 4 if MEMFAULT_NCS_POST_COREDUMP_AFTER_INITIAL_WAIT help Maximum number of retries to post a coredump to Memfault. diff --git a/modules/memfault-firmware-sdk/memfault_lte_coredump.c b/modules/memfault-firmware-sdk/memfault_lte_coredump.c index 8d7e174e2fb..b05b0daf720 100644 --- a/modules/memfault-firmware-sdk/memfault_lte_coredump.c +++ b/modules/memfault-firmware-sdk/memfault_lte_coredump.c @@ -119,7 +119,11 @@ static const struct smf_state states[] = { state_network_connected_run, NULL, &states[STATE_RUNNING], +#if defined(CONFIG_MEMFAULT_NCS_POST_COREDUMP_AFTER_INITIAL_DELAY) + &states[STATE_COREDUMP_SEND_BACKOFF]), +#else &states[STATE_COREDUMP_SEND_ATTEMPT]), +#endif /* CONFIG_MEMFAULT_NCS_POST_COREDUMP_AFTER_INITIAL_DELAY */ [STATE_COREDUMP_SEND_ATTEMPT] = SMF_CREATE_STATE(state_coredump_send_attempt_entry, state_coredump_send_attempt_run,