From 08c7e7d95f5635abb000a0cf9d68316558fd64a5 Mon Sep 17 00:00:00 2001 From: Gillian Minnehan Date: Tue, 22 Oct 2024 15:07:44 -0400 Subject: [PATCH] chore: update asset tracker from upstream + update memfault ### Summary This PR updates the asset tracker application to the latest upstream version using the recently synced `dogfood` branch from our NCS fork. Command used: ``` diff -duwr memfault-asset-tracker/ nrf/applications/asset_tracker_v2/ | patch -p0 ``` Updating memfault to the latest version otherwise we hit the `CONFIG_MBEDTLS_SHA1` build failure that was fixed in 1.12.0. ### Test Plan Built locally & flashed a thingy91. --- .github/workflows/build.yaml | 26 ++++- Kconfig.sysbuild | 2 +- README.rst | 5 +- boards/thingy91x_nrf9151_ns.conf | 6 +- .../memfault_metrics_heartbeat_config.def | 3 - doc/app_behavior.rst | 3 + doc/app_module.rst | 5 +- doc/asset_tracker_v2_description.rst | 3 + doc/cloud_module.rst | 5 +- doc/cloud_wrapper.rst | 5 +- doc/data_module.rst | 5 +- doc/debug_module.rst | 13 +-- doc/firmware_architecture.rst | 3 + doc/location_module.rst | 5 +- doc/lwm2m_carrier_library.rst | 4 + doc/modem_module.rst | 5 +- doc/modules.rst | 4 + doc/modules_common.rst | 5 +- doc/sensor_module.rst | 9 +- doc/ui_module.rst | 5 +- doc/unit_test.rst | 3 + doc/util_module.rst | 5 +- overlay-memfault.conf | 1 + overlay-nrf7002ek-wifi-scan-only.conf | 7 +- sample.yaml | 17 ++-- src/modules/debug_module.c | 51 ---------- src/modules/modem_module.c | 2 + src/modules/modules_common.h | 2 - tests/debug_module/src/debug_module_test.c | 95 ------------------- west.yml | 2 +- 30 files changed, 102 insertions(+), 204 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b90a127..1969346 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -19,9 +19,8 @@ jobs: build: runs-on: ubuntu-latest - # Image generated from: https://github.com/memfault/memfault-port-playground/tree/master/docker/nrf-connect-sdk container: - image: memfault/nrf-connect-sdk:2024-01-05 + image: ghcr.io/memfault/nrf-connect-sdk:2024-10-07 steps: - uses: actions/checkout@v3 @@ -35,7 +34,7 @@ jobs: run: | ${ZEPHYR_SDK_INSTALL_DIR}/setup.sh -c - - name: Build app without Memfault overlay + - name: Setup west workspace run: | cd $GITHUB_WORKSPACE cd ../ @@ -47,18 +46,35 @@ jobs: west update --narrow -o=--depth=1 -o=--recurse-submodules --path-cache ~/zephyr-thingy91-path-cache pip install -r zephyr/scripts/requirements.txt pip install -r nrf/scripts/requirements-build.txt - west build -b thingy91/nrf9160/ns -p always memfault-asset-tracker + + - name: Build app without Memfault overlay + run: | + cd $GITHUB_WORKSPACE + cd ../ + python -m venv venv + . venv/bin/activate + + # disable building meta file, it is unexpectedly causing the build to + # fail in CI + west build -b thingy91/nrf9160/ns -p always memfault-asset-tracker -- \ + -DCONFIG_BUILD_OUTPUT_META=n \ + -Dmcuboot_CONFIG_BUILD_OUTPUT_META=n - name: Build app with Memfault overlay run: | cd $GITHUB_WORKSPACE cd ../ . venv/bin/activate + + # disable building meta file, it is unexpectedly causing the build to + # fail in CI west build -b thingy91/nrf9160/ns -p always memfault-asset-tracker -- \ -DCONFIG_MEMFAULT_NCS_PROJECT_KEY=\"DUMMY_KEY\" \ -DOVERLAY_CONFIG=overlay-memfault.conf \ -DCONFIG_MEMFAULT_NCS_FW_VERSION_STATIC=y \ - -DCONFIG_MEMFAULT_NCS_FW_VERSION=\"${{ env.SOFTWARE_VERSION }}\" + -DCONFIG_MEMFAULT_NCS_FW_VERSION=\"${{ env.SOFTWARE_VERSION }}\" \ + -DCONFIG_BUILD_OUTPUT_META=n \ + -Dmcuboot_CONFIG_BUILD_OUTPUT_META=n rm -rf ~/zephyr-thingy91-path-cache cp -r ${PWD} ~/zephyr-thingy91-path-cache diff --git a/Kconfig.sysbuild b/Kconfig.sysbuild index d256f5e..3942656 100644 --- a/Kconfig.sysbuild +++ b/Kconfig.sysbuild @@ -13,7 +13,7 @@ config SECURE_BOOT_APPCORE || BOARD_NRF9151DK_NRF9151_NS \ || BOARD_NRF9161DK_NRF9161_NS -config WIFI_NRF700X +config WIFI_NRF70 default y if BOARD_THINGY91X_NRF9151_NS config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY diff --git a/README.rst b/README.rst index 5b71df8..1702f5a 100644 --- a/README.rst +++ b/README.rst @@ -7,7 +7,10 @@ Asset Tracker v2 :local: :depth: 2 -The Asset Tracker v2 is a real-time configurable ultra-low power capable application firmware for the nRF91 Series :term:`System in Package (SiP)`. +.. important:: + |ATv2_maintenance_note| + +Asset Tracker v2 is a real-time configurable ultra-low power capable application firmware for the nRF91 Series :term:`System in Package (SiP)`. See the subpages for detailed documentation on the application and its modules: diff --git a/boards/thingy91x_nrf9151_ns.conf b/boards/thingy91x_nrf9151_ns.conf index 3096f5e..921d748 100644 --- a/boards/thingy91x_nrf9151_ns.conf +++ b/boards/thingy91x_nrf9151_ns.conf @@ -30,8 +30,8 @@ CONFIG_ADXL367_ACTIVITY_TIME=0 # configs for Wi-Fi CONFIG_WIFI=y -CONFIG_WIFI_NRF700X=y -CONFIG_WIFI_NRF700X_SKIP_LOCAL_ADMIN_MAC=y +CONFIG_WIFI_NRF70=y +CONFIG_WIFI_NRF70_SKIP_LOCAL_ADMIN_MAC=y # Align this with CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT CONFIG_NRF_WIFI_SCAN_MAX_BSS_CNT=10 @@ -50,7 +50,7 @@ CONFIG_NRF_MODEM_LIB_SHMEM_TX_SIZE=4096 CONFIG_NRF_MODEM_LIB_SHMEM_RX_SIZE=4096 # Scan only using offload API -CONFIG_WPA_SUPP=n +CONFIG_WIFI_NM_WPA_SUPPLICANT=n # For nRF9160 the default is socket interface CONFIG_NET_DEFAULT_IF_ETHERNET=y diff --git a/configuration/memfault/memfault_metrics_heartbeat_config.def b/configuration/memfault/memfault_metrics_heartbeat_config.def index 403b987..ee2dbb9 100644 --- a/configuration/memfault/memfault_metrics_heartbeat_config.def +++ b/configuration/memfault/memfault_metrics_heartbeat_config.def @@ -2,7 +2,4 @@ * Please refer to https://docs.memfault.com/docs/embedded/metrics-api for more details. */ -MEMFAULT_METRICS_KEY_DEFINE(gnss_time_to_fix_ms, kMemfaultMetricType_Unsigned) -MEMFAULT_METRICS_KEY_DEFINE(gnss_satellites_tracked_count, kMemfaultMetricType_Unsigned) -MEMFAULT_METRICS_KEY_DEFINE(location_timeout_search_time_ms, kMemfaultMetricType_Unsigned) MEMFAULT_METRICS_KEY_DEFINE(battery_voltage_mv, kMemfaultMetricType_Unsigned) diff --git a/doc/app_behavior.rst b/doc/app_behavior.rst index 2fa1804..ab8d73c 100644 --- a/doc/app_behavior.rst +++ b/doc/app_behavior.rst @@ -7,6 +7,9 @@ Application behavior and functionality :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + This section describes the general functioning of the Asset Tracker v2 application. Data types diff --git a/doc/app_module.rst b/doc/app_module.rst index 2ebe5bd..092fc77 100644 --- a/doc/app_module.rst +++ b/doc/app_module.rst @@ -7,6 +7,9 @@ Application module :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The application module controls key mechanisms in the Asset Tracker v2. It decides when to sample data, what types of data to sample, and has explicit control over some aspects of the application. @@ -78,5 +81,3 @@ API documentation | Source files: :file:`asset_tracker_v2/src/events/app_module_event.c`, :file:`asset_tracker_v2/src/main.c` .. doxygengroup:: app_module_event - :project: nrf - :members: diff --git a/doc/asset_tracker_v2_description.rst b/doc/asset_tracker_v2_description.rst index 1cf39f1..6be8811 100644 --- a/doc/asset_tracker_v2_description.rst +++ b/doc/asset_tracker_v2_description.rst @@ -7,6 +7,9 @@ Application description :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The Asset Tracker v2 application is built on the following principles: * Ultra-low power by design - The application highlights the power saving features of the nRF91 Series SiP, which is critical for successfully developing small form-factor devices and products which need very long battery lifetime. diff --git a/doc/cloud_module.rst b/doc/cloud_module.rst index 6aa5fb7..ae1b415 100644 --- a/doc/cloud_module.rst +++ b/doc/cloud_module.rst @@ -7,6 +7,9 @@ Cloud module :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The cloud module establishes and maintains the connection to a supported cloud service. It uses the :ref:`Cloud wrapper API ` to integrate and handle the client libraries present in the |NCS|. @@ -258,5 +261,3 @@ API documentation :file:`asset_tracker_v2/src/modules/cloud_module.c` .. doxygengroup:: cloud_module_event - :project: nrf - :members: diff --git a/doc/cloud_wrapper.rst b/doc/cloud_wrapper.rst index 037d139..7a61f1c 100644 --- a/doc/cloud_wrapper.rst +++ b/doc/cloud_wrapper.rst @@ -7,6 +7,9 @@ Cloud wrapper API :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The cloud wrapper API is a generic API used for controlling the connection to a supported |NCS| client library through :ref:`Integration layers `. It exposes generic functions such as ``send``, ``connect``, and ``disconnect``, hiding the functionality that is specific to a single client library implementation. @@ -317,5 +320,3 @@ API documentation :file:`asset_tracker_v2/src/cloud/lwm2m_integration.c` .. doxygengroup:: cloud_wrapper - :project: nrf - :members: diff --git a/doc/data_module.rst b/doc/data_module.rst index 1fe1a02..f8bf842 100644 --- a/doc/data_module.rst +++ b/doc/data_module.rst @@ -7,6 +7,9 @@ Data module :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The data module gathers data that has been sampled by other modules in the system and stores it into ring buffers. It keeps track of data requested by the :ref:`asset_tracker_v2_app_module` and decides when data is sent to the cloud. @@ -188,5 +191,3 @@ API documentation | Source files: :file:`asset_tracker_v2/src/events/data_module_event.c`, :file:`asset_tracker_v2/src/modules/data_module.c` .. doxygengroup:: data_module_event - :project: nrf - :members: diff --git a/doc/debug_module.rst b/doc/debug_module.rst index 3cb0581..7f9b389 100644 --- a/doc/debug_module.rst +++ b/doc/debug_module.rst @@ -7,6 +7,9 @@ Debug module :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + 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 :ref:`mod_memfault` module integrated in |NCS|. @@ -22,13 +25,7 @@ This section documents the various features implemented by the module. Memfault ======== -The debug module uses `Memfault SDK`_ to track |NCS| 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: - - * ``gnss_time_to_fix_ms`` - Time duration between the start of a GNSS search and obtaining a fix. - * ``gnss_satellites_tracked_count`` - Number of satellites tracked during a GNSS search window. - * ``location_timeout_search_time_ms`` - Time duration between the start of a location search and a search timeout. - +The debug module uses `Memfault SDK`_ to track |NCS| specific metrics such as LTE, location, Bluetooth and stack metrics. 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. @@ -111,5 +108,3 @@ API documentation | Source files: :file:`asset_tracker_v2/src/events/debug_module_event.c` .. doxygengroup:: debug_module_event - :project: nrf - :members: diff --git a/doc/firmware_architecture.rst b/doc/firmware_architecture.rst index a4fa477..47b069e 100644 --- a/doc/firmware_architecture.rst +++ b/doc/firmware_architecture.rst @@ -7,6 +7,9 @@ Firmware architecture :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The Asset Tracker v2 application has a modular structure, where each module has a defined scope of responsibility. The application makes use of the :ref:`app_event_manager` to distribute events between modules in the system. The Application Event Manager is used for all the communication between the modules. diff --git a/doc/location_module.rst b/doc/location_module.rst index 5227570..c3ddad5 100644 --- a/doc/location_module.rst +++ b/doc/location_module.rst @@ -7,6 +7,9 @@ Location module :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The location module controls the GNSS, cellular and Wi-Fi positioning functionality. It can be used to retrieve the location of the device in the form of events containing a position, velocity and time (PVT) structure. @@ -155,5 +158,3 @@ API documentation | Source files: :file:`asset_tracker_v2/src/events/location_module_event.c` .. doxygengroup:: location_module_event - :project: nrf - :members: diff --git a/doc/lwm2m_carrier_library.rst b/doc/lwm2m_carrier_library.rst index 05420fe..5679659 100644 --- a/doc/lwm2m_carrier_library.rst +++ b/doc/lwm2m_carrier_library.rst @@ -3,6 +3,10 @@ Using the carrier library ######################### +.. important:: + |ATv2_maintenance_note| + + .. |application_sample_name| replace:: Asset Tracker v2 application .. include:: /includes/lwm2m_carrier_library.txt diff --git a/doc/modem_module.rst b/doc/modem_module.rst index 7e0792e..22f8400 100644 --- a/doc/modem_module.rst +++ b/doc/modem_module.rst @@ -7,6 +7,9 @@ Modem module :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The modem module communicates with the modem to control the LTE connection and retrieve information from the modem about the device and LTE network. Features @@ -137,5 +140,3 @@ API documentation | Source files: :file:`asset_tracker_v2/src/events/modem_module_event.c`, :file:`asset_tracker_v2/src/modules/modem_module.c` .. doxygengroup:: modem_module_event - :project: nrf - :members: diff --git a/doc/modules.rst b/doc/modules.rst index c1370c1..8540152 100644 --- a/doc/modules.rst +++ b/doc/modules.rst @@ -3,6 +3,10 @@ Application modules ################### +.. important:: + |ATv2_maintenance_note| + + The Asset Tracker v2 application consists of a set of modules. See :ref:`asset_tracker_v2_architecture` for more information on how the application is structured. diff --git a/doc/modules_common.rst b/doc/modules_common.rst index 07e837a..ddd73d7 100644 --- a/doc/modules_common.rst +++ b/doc/modules_common.rst @@ -7,6 +7,9 @@ Modules common API :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The Modules common API provides the functionality to administer mechanisms in the application architecture, and consist of functions that are shared between modules. The API supports the following functionalities: @@ -22,5 +25,3 @@ API documentation | Source files: :file:`asset_tracker_v2/src/modules_common.c` .. doxygengroup:: modules_common - :project: nrf - :members: diff --git a/doc/sensor_module.rst b/doc/sensor_module.rst index e5274b8..ed607d2 100644 --- a/doc/sensor_module.rst +++ b/doc/sensor_module.rst @@ -7,6 +7,9 @@ Sensor module :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The sensor module interacts with external sensors present on the `Thingy:91 `_ and Thingy:91 X. It collects environmental data and detects motion over a set threshold value. @@ -36,7 +39,7 @@ The following table lists the sensors and sensor data types supported by the mod | Acceleration (Impact) | `ADXL372`_ | +-------------------------+-----------------+ -The module controls and collects data from the sensors by interacting with their :ref:`device drivers ` using :ref:`Zephyr's generic sensor API `. +The module controls and collects data from the sensors by interacting with their :ref:`device drivers ` using :ref:`Zephyr's generic sensor API `. Thingy:91 X has a `BME688`_ gas sensor and `ADXL367`_ motion sensor that can be used by the :ref:`asset_tracker_v2_sensor_module` module. @@ -189,7 +192,7 @@ Dependencies This module uses the following Zephyr API: -* :ref:`Generic sensor API ` +* :ref:`Generic sensor API ` API documentation ***************** @@ -199,5 +202,3 @@ API documentation :file:`asset_tracker_v2/src/modules/sensor_module.c` .. doxygengroup:: sensor_module_event - :project: nrf - :members: diff --git a/doc/ui_module.rst b/doc/ui_module.rst index dd7dfbf..a88ea0d 100644 --- a/doc/ui_module.rst +++ b/doc/ui_module.rst @@ -7,6 +7,9 @@ User Interface module :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The User Interface module controls and monitors the UI elements on nRF91 Series development kits, Thingy:91, and Thingy:91 X. Features @@ -115,5 +118,3 @@ API documentation | Source files: :file:`asset_tracker_v2/src/events/ui_module_event.c`, :file:`asset_tracker_v2/src/modules/ui_module.c` .. doxygengroup:: ui_module_event - :project: nrf - :members: diff --git a/doc/unit_test.rst b/doc/unit_test.rst index 7608b3c..1654d46 100644 --- a/doc/unit_test.rst +++ b/doc/unit_test.rst @@ -7,6 +7,9 @@ Unit tests :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The internal modules of the :ref:`asset_tracker_v2` application have a set of unit tests in the :file:`asset_tracker_v2/tests` folder. Following are the modules that have unit tests: diff --git a/doc/util_module.rst b/doc/util_module.rst index 4832464..29fa256 100644 --- a/doc/util_module.rst +++ b/doc/util_module.rst @@ -7,6 +7,9 @@ Utility module :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The utility module provides the functionality to administer and monitor mechanisms in the application architecture. Features @@ -89,5 +92,3 @@ API documentation | Source files: :file:`asset_tracker_v2/src/events/util_module_event.c`, :file:`asset_tracker_v2/src/modules/util_module.c` .. doxygengroup:: util_module_event - :project: nrf - :members: diff --git a/overlay-memfault.conf b/overlay-memfault.conf index 6557818..017aaaa 100644 --- a/overlay-memfault.conf +++ b/overlay-memfault.conf @@ -9,6 +9,7 @@ CONFIG_MEMFAULT_NCS_PROJECT_KEY="" CONFIG_MEMFAULT_NCS_DEVICE_ID_IMEI=y CONFIG_MEMFAULT_NCS_LTE_METRICS=y CONFIG_MEMFAULT_NCS_STACK_METRICS=y +CONFIG_MEMFAULT_NCS_LOCATION_METRICS=y CONFIG_MEMFAULT_LOGGING_ENABLE=y CONFIG_MEMFAULT_ROOT_CERT_STORAGE_NRF9160_MODEM=y diff --git a/overlay-nrf7002ek-wifi-scan-only.conf b/overlay-nrf7002ek-wifi-scan-only.conf index 35d1507..f7ffc98 100644 --- a/overlay-nrf7002ek-wifi-scan-only.conf +++ b/overlay-nrf7002ek-wifi-scan-only.conf @@ -19,8 +19,8 @@ CONFIG_DK_LIBRARY=n # Actual configs for the Wi-Fi CONFIG_WIFI=y -CONFIG_WIFI_NRF700X=y -CONFIG_WIFI_NRF700X_SKIP_LOCAL_ADMIN_MAC=y +CONFIG_WIFI_NRF70=y +CONFIG_WIFI_NRF70_SKIP_LOCAL_ADMIN_MAC=y # Align this with CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT CONFIG_NRF_WIFI_SCAN_MAX_BSS_CNT=20 @@ -35,13 +35,14 @@ CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT=20 CONFIG_LOCATION_WORKQUEUE_STACK_SIZE=8192 # Needed to handle more scan results CONFIG_HEAP_MEM_POOL_SIZE=60000 +CONFIG_HEAP_MEM_POOL_IGNORE_MIN=y # Not for LTE throughput testing CONFIG_NRF_MODEM_LIB_SHMEM_TX_SIZE=4096 CONFIG_NRF_MODEM_LIB_SHMEM_RX_SIZE=4096 # Scan only using offload API -CONFIG_WPA_SUPP=n +CONFIG_WIFI_NM_WPA_SUPPLICANT=n # For nRF9160 the default is socket interface CONFIG_NET_DEFAULT_IF_ETHERNET=y diff --git a/sample.yaml b/sample.yaml index e310535..8063cb1 100644 --- a/sample.yaml +++ b/sample.yaml @@ -301,6 +301,7 @@ tests: - thingy91/nrf9160/ns extra_configs: - CONFIG_MEMFAULT_NCS_PROJECT_KEY="PROJECTKEY" + - CONFIG_LOG_MODE_MINIMAL=y extra_args: EXTRA_CONF_FILE="overlay-lwm2m.conf;overlay-memfault.conf" tags: ci_build sysbuild ci_applications_asset_tracker_v2 applications.asset_tracker_v2.memfault-low-power: @@ -328,8 +329,8 @@ tests: integration_platforms: - nrf9160dk/nrf9160/ns platform_allow: nrf9160dk/nrf9160/ns - extra_args: SHIELD=nrf7002ek EXTRA_CONF_FILE=overlay-nrf7002ek-wifi-scan-only.conf - SB_CONFIG_WIFI_NRF700X=y SB_CONFIG_WIFI_NRF700X_SCAN_ONLY=y + extra_args: SHIELD=nrf7002ek_nrf7000 EXTRA_CONF_FILE=overlay-nrf7002ek-wifi-scan-only.conf + SB_CONFIG_WIFI_NRF70=y SB_CONFIG_WIFI_NRF70_SCAN_ONLY=y tags: ci_build sysbuild ci_applications_asset_tracker_v2 applications.asset_tracker_v2.nrf7002ek_wifi.nrf9161dk: sysbuild: true @@ -337,8 +338,8 @@ tests: integration_platforms: - nrf9161dk/nrf9161/ns platform_allow: nrf9161dk/nrf9161/ns - extra_args: SHIELD=nrf7002ek EXTRA_CONF_FILE=overlay-nrf7002ek-wifi-scan-only.conf - SB_CONFIG_WIFI_NRF700X=y SB_CONFIG_WIFI_NRF700X_SCAN_ONLY=y + extra_args: SHIELD=nrf7002ek_nrf7000 EXTRA_CONF_FILE=overlay-nrf7002ek-wifi-scan-only.conf + SB_CONFIG_WIFI_NRF70=y SB_CONFIG_WIFI_NRF70_SCAN_ONLY=y tags: ci_build sysbuild ci_applications_asset_tracker_v2 applications.asset_tracker_v2.nrf7002ek_wifi.nrf9151dk: sysbuild: true @@ -346,8 +347,8 @@ tests: integration_platforms: - nrf9151dk/nrf9151/ns platform_allow: nrf9151dk/nrf9151/ns - extra_args: SHIELD=nrf7002ek EXTRA_CONF_FILE=overlay-nrf7002ek-wifi-scan-only.conf - SB_CONFIG_WIFI_NRF700X=y SB_CONFIG_WIFI_NRF700X_SCAN_ONLY=y + extra_args: SHIELD=nrf7002ek_nrf7000 EXTRA_CONF_FILE=overlay-nrf7002ek-wifi-scan-only.conf + SB_CONFIG_WIFI_NRF70=y SB_CONFIG_WIFI_NRF70_SCAN_ONLY=y tags: ci_build sysbuild ci_applications_asset_tracker_v2 applications.asset_tracker_v2.nrf7002ek_wifi-debug: sysbuild: true @@ -360,9 +361,9 @@ tests: - nrf9160dk/nrf9160/ns - nrf9161dk/nrf9161/ns - nrf9151dk/nrf9151/ns - extra_args: SHIELD=nrf7002ek + extra_args: SHIELD=nrf7002ek_nrf7000 EXTRA_CONF_FILE="overlay-nrf7002ek-wifi-scan-only.conf;overlay-debug.conf" - SB_CONFIG_WIFI_NRF700X=y SB_CONFIG_WIFI_NRF700X_SCAN_ONLY=y + SB_CONFIG_WIFI_NRF70=y SB_CONFIG_WIFI_NRF70_SCAN_ONLY=y tags: ci_build sysbuild ci_applications_asset_tracker_v2 # Configuration which will be used by the positioning CI integration job to verify PRs diff --git a/src/modules/debug_module.c b/src/modules/debug_module.c index ed94e93..3620533 100644 --- a/src/modules/debug_module.c +++ b/src/modules/debug_module.c @@ -33,7 +33,6 @@ #include "events/data_module_event.h" #include "events/sensor_module_event.h" #include "events/util_module_event.h" -#include "events/location_module_event.h" #include "events/modem_module_event.h" #include "events/ui_module_event.h" #include "events/debug_module_event.h" @@ -49,7 +48,6 @@ struct debug_msg_data { struct sensor_module_event sensor; struct data_module_event data; struct app_module_event app; - struct location_module_event location; struct modem_module_event modem; } module; }; @@ -160,15 +158,6 @@ static bool app_event_handler(const struct app_event_header *aeh) message_handler(&debug_msg); } - if (is_location_module_event(aeh)) { - struct location_module_event *event = cast_location_module_event(aeh); - struct debug_msg_data debug_msg = { - .module.location = *event - }; - - message_handler(&debug_msg); - } - if (is_sensor_module_event(aeh)) { struct sensor_module_event *event = cast_sensor_module_event(aeh); @@ -274,38 +263,6 @@ static void send_memfault_data(void) } } -static void add_location_metrics(uint8_t satellites, uint32_t search_time, - enum location_module_event_type event) -{ - int err; - - switch (event) { - case LOCATION_MODULE_EVT_GNSS_DATA_READY: - err = MEMFAULT_METRIC_SET_UNSIGNED(gnss_time_to_fix_ms, search_time); - if (err) { - LOG_ERR("Failed updating gnss_time_to_fix_ms metric, error: %d", err); - } - break; - case LOCATION_MODULE_EVT_TIMEOUT: - err = MEMFAULT_METRIC_SET_UNSIGNED(location_timeout_search_time_ms, search_time); - if (err) { - LOG_ERR("Failed updating location_timeout_search_time_ms metric, error: %d", - err); - } - break; - default: - LOG_ERR("Unknown location module event."); - return; - } - - err = MEMFAULT_METRIC_SET_UNSIGNED(gnss_satellites_tracked_count, satellites); - if (err) { - LOG_ERR("Failed updating gnss_satellites_tracked_count metric, error: %d", err); - } - - memfault_metrics_heartbeat_debug_trigger(); -} - static void memfault_handle_event(struct debug_msg_data *msg) { if (IS_EVENT(msg, app, APP_EVT_START)) { @@ -367,13 +324,6 @@ static void memfault_handle_event(struct debug_msg_data *msg) return; } - if ((IS_EVENT(msg, location, LOCATION_MODULE_EVT_TIMEOUT)) || - (IS_EVENT(msg, location, LOCATION_MODULE_EVT_GNSS_DATA_READY))) { - add_location_metrics(msg->module.location.data.location.satellites_tracked, - msg->module.location.data.location.search_time, - msg->module.location.type); - return; - } } /* 1 means discharging, 0 means charging, -1 means error */ @@ -494,7 +444,6 @@ APP_EVENT_LISTENER(MODULE, app_event_handler); APP_EVENT_SUBSCRIBE_EARLY(MODULE, app_module_event); APP_EVENT_SUBSCRIBE_EARLY(MODULE, modem_module_event); APP_EVENT_SUBSCRIBE_EARLY(MODULE, cloud_module_event); -APP_EVENT_SUBSCRIBE_EARLY(MODULE, location_module_event); APP_EVENT_SUBSCRIBE_EARLY(MODULE, ui_module_event); APP_EVENT_SUBSCRIBE_EARLY(MODULE, sensor_module_event); APP_EVENT_SUBSCRIBE_EARLY(MODULE, data_module_event); diff --git a/src/modules/modem_module.c b/src/modules/modem_module.c index 2134c2c..d2c2da5 100644 --- a/src/modules/modem_module.c +++ b/src/modules/modem_module.c @@ -290,6 +290,8 @@ void pdn_event_handler(uint8_t cid, enum pdn_event event, int reason) case PDN_EVENT_NETWORK_DETACH: LOG_DBG("PDN_EVENT_NETWORK_DETACH"); break; + case PDN_EVENT_CTX_DESTROYED: + LOG_DBG("PDN_EVENT_CTX_DESTROYED"); default: LOG_WRN("Unexpected PDN event!"); break; diff --git a/src/modules/modules_common.h b/src/modules/modules_common.h index e098583..e1c9616 100644 --- a/src/modules/modules_common.h +++ b/src/modules/modules_common.h @@ -91,8 +91,6 @@ struct module_data { /** @brief Purge a module's queue. * * @param[in] module Pointer to a structure containing module metadata. - * - * @return 0 if successful, otherwise a negative error code. */ void module_purge_queue(struct module_data *module); diff --git a/tests/debug_module/src/debug_module_test.c b/tests/debug_module/src/debug_module_test.c index f3afcee..9f9d664 100644 --- a/tests/debug_module/src/debug_module_test.c +++ b/tests/debug_module/src/debug_module_test.c @@ -18,7 +18,6 @@ #include "cmock_watchdog_app.h" #include "app_module_event.h" -#include "location_module_event.h" #include "debug_module_event.h" #include "data_module_event.h" @@ -29,7 +28,6 @@ extern struct event_listener __event_listener_debug_module; */ static struct app_module_event app_module_event_memory; static struct data_module_event data_module_event_memory; -static struct location_module_event location_module_event_memory; static struct debug_module_event debug_module_event_memory; #define DEBUG_MODULE_EVT_HANDLER(aeh) __event_listener_debug_module.notification(aeh) @@ -38,7 +36,6 @@ static struct debug_module_event debug_module_event_memory; * depend on these to exist. But since we are unit testing, we dont need * these subscriptions and hence these structs can remain uninitialized. */ -struct event_type __event_type_location_module_event; struct event_type __event_type_debug_module_event; struct event_type __event_type_app_module_event; struct event_type __event_type_data_module_event; @@ -108,62 +105,6 @@ void setup_debug_module_in_init_state(void) app_event_manager_free(app_module_event); } -/* Test whether the correct Memfault metrics are set upon a GNSS fix. */ -void test_memfault_trigger_metric_sampling_on_gnss_fix(void) -{ - setup_debug_module_in_init_state(); - - __cmock_memfault_metrics_heartbeat_set_unsigned_ExpectAndReturn( - MEMFAULT_METRICS_KEY(gnss_time_to_fix_ms), 60000, 0); - __cmock_memfault_metrics_heartbeat_set_unsigned_ExpectAndReturn( - MEMFAULT_METRICS_KEY(gnss_satellites_tracked_count), - 4, - 0); - __cmock_memfault_metrics_heartbeat_debug_trigger_Expect(); - - __cmock_app_event_manager_alloc_ExpectAnyArgsAndReturn(&location_module_event_memory); - __cmock_app_event_manager_free_ExpectAnyArgs(); - struct location_module_event *location_module_event = new_location_module_event(); - - location_module_event->type = LOCATION_MODULE_EVT_GNSS_DATA_READY; - location_module_event->data.location.satellites_tracked = 4; - location_module_event->data.location.search_time = 60000; - - TEST_ASSERT_EQUAL(0, DEBUG_MODULE_EVT_HANDLER( - (struct app_event_header *)location_module_event)); - app_event_manager_free(location_module_event); -} - -/* Test whether the correct Memfault metrics are set upon a GNSS timeout. */ -void test_memfault_trigger_metric_sampling_on_location_timeout(void) -{ - resetTest(); - setup_debug_module_in_init_state(); - - /* Update this function to expect the search time and number of satellites. */ - __cmock_memfault_metrics_heartbeat_set_unsigned_ExpectAndReturn( - MEMFAULT_METRICS_KEY(location_timeout_search_time_ms), - 30000, - 0); - __cmock_memfault_metrics_heartbeat_set_unsigned_ExpectAndReturn( - MEMFAULT_METRICS_KEY(gnss_satellites_tracked_count), - 2, - 0); - __cmock_memfault_metrics_heartbeat_debug_trigger_Ignore(); - - __cmock_app_event_manager_alloc_ExpectAnyArgsAndReturn(&location_module_event_memory); - __cmock_app_event_manager_free_ExpectAnyArgs(); - struct location_module_event *location_module_event = new_location_module_event(); - - location_module_event->type = LOCATION_MODULE_EVT_TIMEOUT; - location_module_event->data.location.satellites_tracked = 2; - location_module_event->data.location.search_time = 30000; - - TEST_ASSERT_EQUAL(0, DEBUG_MODULE_EVT_HANDLER( - (struct app_event_header *)location_module_event)); - app_event_manager_free(location_module_event); -} - /* Test that the debug module is able to submit Memfault data externally through events * of type DEBUG_EVT_MEMFAULT_DATA_READY carrying chunks of data. */ @@ -198,42 +139,6 @@ void test_memfault_trigger_data_send(void) k_sleep(K_SECONDS(1)); } -/* Test that no Memfault SDK specific APIs are called on GNSS module events - * that should not be handled. - */ -void test_memfault_unhandled_event(void) -{ - resetTest(); - setup_debug_module_in_init_state(); - - /* Expect no memfault APIs to be called on LOCATION_MODULE_EVT_ACTIVE */ - - __cmock_app_event_manager_alloc_ExpectAnyArgsAndReturn(&location_module_event_memory); - __cmock_app_event_manager_free_ExpectAnyArgs(); - struct location_module_event *location_module_event = new_location_module_event(); - - location_module_event->type = LOCATION_MODULE_EVT_ACTIVE; - TEST_ASSERT_EQUAL(0, DEBUG_MODULE_EVT_HANDLER( - (struct app_event_header *)location_module_event)); - - location_module_event->type = LOCATION_MODULE_EVT_INACTIVE; - TEST_ASSERT_EQUAL(0, DEBUG_MODULE_EVT_HANDLER( - (struct app_event_header *)location_module_event)); - - location_module_event->type = LOCATION_MODULE_EVT_SHUTDOWN_READY; - TEST_ASSERT_EQUAL(0, DEBUG_MODULE_EVT_HANDLER( - (struct app_event_header *)location_module_event)); - - location_module_event->type = LOCATION_MODULE_EVT_AGNSS_NEEDED; - TEST_ASSERT_EQUAL(0, DEBUG_MODULE_EVT_HANDLER( - (struct app_event_header *)location_module_event)); - - location_module_event->type = LOCATION_MODULE_EVT_ERROR_CODE; - TEST_ASSERT_EQUAL(0, DEBUG_MODULE_EVT_HANDLER( - (struct app_event_header *)location_module_event)); - app_event_manager_free(location_module_event); -} - /* Test whether the correct Memfault software watchdog APIs are called on callbacks from the * application watchdog library. */ diff --git a/west.yml b/west.yml index c51464f..0a808d5 100644 --- a/west.yml +++ b/west.yml @@ -16,6 +16,6 @@ manifest: - name: memfault-firmware-sdk url: https://github.com/memfault/memfault-firmware-sdk path: modules/lib/memfault-firmware-sdk - revision: "1.11.5" + revision: "1.15.0" self: path: firmware