Skip to content

Commit 25c4178

Browse files
ArekBalysNordicrlubos
authored andcommitted
samples: matter: Enable RAM power-down feature for Matter samples
Enabled the RAM power-down feature to disable some RAM banks if possible. Thanks to that we can reduce power consumption. Signed-off-by: Arkadiusz Balys <[email protected]>
1 parent 3f82a88 commit 25c4178

File tree

7 files changed

+33
-0
lines changed

7 files changed

+33
-0
lines changed

doc/nrf/protocols/matter/getting_started/low_power_configuration.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,3 +258,12 @@ Configure radio transmitter power
258258
:end-before: radio_power_end
259259

260260
See :ref:`ug_matter_gs_transmission_power` for more information.
261+
262+
Disable unused RAM sections
263+
***************************
264+
265+
The :ref:`lib_ram_pwrdn` library allows you to disable unused sections of RAM and save power in low-power applications.
266+
Unused sections of RAM depend on the SoC architecture and the total amount of used static RAM.
267+
In Matter, you can use this feature by setting the :kconfig:option:`CONFIG_RAM_POWER_DOWN_LIBRARY` Kconfig option to ``y``.
268+
269+
Once the feature is enabled, the :c:func:`power_down_unused_ram` function is called automatically in the :file:`matter_init.cpp` file during the initialization process.

doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,9 @@ Keys samples
329329
Matter samples
330330
--------------
331331

332+
* Updated all Matter samples that support low-power mode to enable the :ref:`lib_ram_pwrdn` feature.
333+
It is enabled by default for the release configuration of the :ref:`matter_lock_sample`, :ref:`matter_light_switch_sample`, :ref:`matter_smoke_co_alarm_sample`, and :ref:`matter_window_covering_sample` samples.
334+
332335
* :ref:`matter_template_sample` sample:
333336

334337
* Updated the internal configuration for the :ref:`zephyr:nrf54l15dk_nrf54l15` target to use the DFU image compression and provide more memory space for the application.

samples/matter/common/src/app/matter_init.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
#include "test/test_shell.h"
4343
#endif
4444

45+
#ifdef CONFIG_RAM_POWER_DOWN_LIBRARY
46+
#include <ram_pwrdn.h>
47+
#endif
48+
4549
#include <app/InteractionModelEngine.h>
4650
#include <app/clusters/network-commissioning/network-commissioning.h>
4751
#include <app/server/OnboardingCodesUtil.h>
@@ -229,6 +233,11 @@ void DoInitChipServer(intptr_t /* unused */)
229233
/* Set External Flash into sleep mode */
230234
ExternalFlashManager::GetInstance().DoAction(ExternalFlashManager::Action::SLEEP);
231235

236+
/* Disable unused RAM blocks to reduce power consumption */
237+
#ifdef CONFIG_RAM_POWER_DOWN_LIBRARY
238+
power_down_unused_ram();
239+
#endif
240+
232241
/* Initialize CHIP server */
233242
#ifdef CONFIG_CHIP_FACTORY_DATA
234243
if (sLocalInitData.mFactoryDataProvider) {

samples/matter/light_switch/prj_release.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ CONFIG_CHIP_BLE_ADVERTISING_DURATION=60
2121
# Add support for LEDs and buttons on Nordic development kits
2222
CONFIG_DK_LIBRARY=y
2323

24+
# Try to disable unused RAM blocks to reduce power consumption
25+
CONFIG_RAM_POWER_DOWN_LIBRARY=y
26+
2427
# Bluetooth Low Energy configuration
2528
CONFIG_BT_DEVICE_NAME="MatterSwitch"
2629

samples/matter/lock/prj_release.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ CONFIG_PM_DEVICE=y
3131
# Enable system reset on fatal error
3232
CONFIG_RESET_ON_FATAL_ERROR=y
3333

34+
# Try to disable unused RAM blocks to reduce power consumption
35+
CONFIG_RAM_POWER_DOWN_LIBRARY=y
36+
3437
# Disable all debug features
3538
CONFIG_USE_SEGGER_RTT=n
3639
CONFIG_SHELL=n

samples/matter/smoke_co_alarm/prj_release.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ CONFIG_CHIP_BLE_ADVERTISING_DURATION=60
2323
# Add support for LEDs and buttons on Nordic development kits
2424
CONFIG_DK_LIBRARY=y
2525

26+
# Try to disable unused RAM blocks to reduce power consumption
27+
CONFIG_RAM_POWER_DOWN_LIBRARY=y
28+
2629
# Bluetooth Low Energy configuration
2730
CONFIG_BT_DEVICE_NAME="MatterSmoke"
2831

samples/matter/window_covering/prj_release.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ CONFIG_CHIP_BLE_ADVERTISING_DURATION=60
2525
# Add support for LEDs and buttons on Nordic development kits
2626
CONFIG_DK_LIBRARY=y
2727

28+
# Try to disable unused RAM blocks to reduce power consumption
29+
CONFIG_RAM_POWER_DOWN_LIBRARY=y
30+
2831
# PWM support
2932
CONFIG_PWM=y
3033

0 commit comments

Comments
 (0)