Conversation
ced358c to
0811af6
Compare
af89bab to
eb04650
Compare
f543b37 to
a00571a
Compare
72b51ce to
f47d1ce
Compare
The storage module adds the ability to buffer data in a chosen backend. Currently, RAM backend is implemented. The module subscribes to a list of zbus channels and stores all the sampled data it receives on those channels, as long as there is available space. The RAM buffer acts as a ring buffer, where the oldest entry is discarded if all capacity is used. There are two operational modes: - Pass-through: Data is passed on immediately with no storage - Buffer: Data is stored and passed on when the storage module receives a message over its zbus channel to do so. Signed-off-by: Jan Tore Guggedal <jantore.guggedal@nordicsemi.no>
|
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces a comprehensive new storage module for the Asset Tracker Template, providing flexible data storage capabilities with both RAM and internal flash backends. The module implements a state machine-based architecture supporting pass-through mode for real-time data forwarding and buffer mode for persistent storage, along with a batch interface for safe concurrent data access.
- Adds a configurable storage module with Kconfig options for backend selection, memory limits, and operational modes
- Implements a modular backend interface with RAM ring buffer backend for efficient FIFO storage
- Introduces a flexible data type registration system that automatically discovers and handles multiple data types from enabled modules
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
tests/module/storage/ |
Comprehensive test suite with sample data, module tests, and configuration for validating storage functionality |
docs/modules/storage.md |
Detailed documentation covering architecture, API usage, configuration options, and implementation guidelines |
app/src/modules/storage/ |
Core storage module implementation including state machine, backend interface, data type registration, and shell commands |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.



This pull request introduces a new, configurable storage module for the application, supporting both RAM and internal flash backends. It adds Kconfig options for fine-grained control, implements a modular backend interface, and provides a RAM ring buffer backend. The changes also define a flexible system for registering and handling multiple data types for storage, and introduce new shell commands for interacting with the storage module.
New Storage Module Implementation
Kconfig.storage[1]CMakeLists.txt[2]storage_backend.h, enabling easy addition of new storage backends (RAM, flash, etc.) via a unified API. (storage_backend.happ/src/modules/storage/storage_backend.hR1-R73)backends/ram_ring_buffer_backend.capp/src/modules/storage/backends/ram_ring_buffer_backend.cR1-R365)Data Type Registration and Handling
storage_data_types.capp/src/modules/storage/storage_data_types.cR1-R86)Storage Module API and Messaging
storage.happ/src/modules/storage/storage.hR1-R122)Workflow and Build System Updates
CMakeLists.txt[1].github/workflows/sonarcloud.yml[2]