Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manifest: sdk-zephyr: [fromlist] poweroff: nordic: streamline RAM retention strategy #19140

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions samples/bluetooth/peripheral_power_profiling/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
#include <nfc/ndef/le_oob_rec.h>

#include <helpers/nrfx_reset_reason.h>
#ifdef CONFIG_SOC_NRF54L15_CPUAPP
#include <hal/nrf_memconf.h>
#endif

#include "pwr_service.h"

Expand Down Expand Up @@ -682,14 +679,6 @@ static void system_off(void)
}
}

#ifdef CONFIG_SOC_NRF54L15_CPUAPP
/* Disable RAM retention in System OFF as it is not utilized by this sample. */
uint32_t ram_sections = 8;

nrf_memconf_ramblock_ret_mask_enable_set(NRF_MEMCONF, 0, BIT_MASK(ram_sections), false);
nrf_memconf_ramblock_ret2_mask_enable_set(NRF_MEMCONF, 0, BIT_MASK(ram_sections), false);
#endif

sys_poweroff();
#endif /* !IS_ENABLED(CONFIG_SOC_SERIES_NRF54HX) */
}
Expand Down
11 changes: 0 additions & 11 deletions samples/nfc/system_off/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
#include <nfc/ndef/text_rec.h>

#include <dk_buttons_and_leds.h>
#ifdef CONFIG_SOC_NRF54L15_CPUAPP
#include <hal/nrf_memconf.h>
#endif

#define SYSTEM_OFF_DELAY_S 3

Expand Down Expand Up @@ -150,14 +147,6 @@ static void system_off(struct k_work *work)
}
}

#ifdef CONFIG_SOC_NRF54L15_CPUAPP
/* Disable RAM retention in System OFF as it is not utilized by this sample. */
uint32_t ram_sections = 8;

nrf_memconf_ramblock_ret_mask_enable_set(NRF_MEMCONF, 0, BIT_MASK(ram_sections), false);
nrf_memconf_ramblock_ret2_mask_enable_set(NRF_MEMCONF, 0, BIT_MASK(ram_sections), false);
#endif

sys_poweroff();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/ {
sram0@2003f000 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x2003f000 DT_SIZE_K(4)>;
zephyr,memory-region = "RetainedMem";
status = "okay";

retainedmem0: retainedmem {
compatible = "zephyr,retained-ram";
status = "okay";
};
};

aliases {
retainedmemdevice = &retainedmem0;
};
};

&sram0 {
/* Shrink SRAM size to avoid overlap with retained memory region */
reg = <0x20000000 DT_SIZE_K(252)>;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/ {
sram0@20007000 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x20007000 DT_SIZE_K(4)>;
zephyr,memory-region = "RetainedMem";
status = "okay";

retainedmem0: retainedmem {
compatible = "zephyr,retained-ram";
status = "okay";
};
};

aliases {
retainedmemdevice = &retainedmem0;
};
};

&sram0 {
/* Shrink SRAM size to avoid overlap with retained memory region */
reg = <0x20000000 DT_SIZE_K(28)>;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/ {
cpuapp_sram@20017000 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x20017000 DT_SIZE_K(4)>;
zephyr,memory-region = "RetainedMem";
status = "okay";

retainedmem0: retainedmem {
compatible = "zephyr,retained-ram";
status = "okay";
};
};

aliases {
retainedmemdevice = &retainedmem0;
};
};

&cpuapp_sram {
/* Shrink SRAM size to avoid overlap with retained memory region:
* 96 - 4 = 92KB = 0x17000
*/
reg = <0x20000000 0x17000>;
ranges = <0x0 0x20000000 0x17000>;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/ {
cpuapp_sram@2002f000 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x2002f000 DT_SIZE_K(4)>;
zephyr,memory-region = "RetainedMem";
status = "okay";

retainedmem0: retainedmem {
compatible = "zephyr,retained-ram";
status = "okay";
};
};

aliases {
retainedmemdevice = &retainedmem0;
};
};

&cpuapp_sram {
/* Shrink SRAM size to avoid overlap with retained memory region:
* 192 - 4 = 188KB = 0x2f000
*/
reg = <0x20000000 0x2f000>;
ranges = <0x0 0x20000000 0x2f000>;
};
43 changes: 17 additions & 26 deletions tests/benchmarks/current_consumption/system_off/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ tests:
benchmarks.current_consumption.systemoff.gpio_wakeup:
platform_allow:
- nrf54l15dk/nrf54l15/cpuapp
- nrf54l15dk/nrf54l10/cpuapp
- nrf54l15dk/nrf54l05/cpuapp
integration_platforms:
- nrf54l15dk/nrf54l15/cpuapp
extra_args: DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuapp_gpio_wakeup.overlay"
Expand All @@ -15,18 +17,16 @@ tests:
pytest_root:
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_with_wakeups"
timeout: 80
benchmarks.current_consumption.systemoff.gpio_wakeup_retained_mem:
benchmarks.current_consumption.systemoff.gpio_wakeup.retained_mem:
platform_allow:
- nrf54l15dk/nrf54l15/cpuapp
- nrf54l15dk/nrf54l10/cpuapp
- nrf54l15dk/nrf54l05/cpuapp
integration_platforms:
- nrf54l15dk/nrf54l15/cpuapp
extra_args:
- "DTC_OVERLAY_FILE=
boards/nrf54l15dk_nrf54l15_cpuapp_gpio_wakeup.overlay;
boards/nrf54l15dk_nrf54l15_cpuapp_ret_mem.overlay"
extra_args: EXTRA_DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuapp_gpio_wakeup.overlay"
extra_configs:
- CONFIG_APP_USE_RETAINED_MEM=y
- CONFIG_RETAINED_MEM=y
harness: pytest
harness_config:
fixture: ppk_power_measure
Expand All @@ -36,6 +36,8 @@ tests:
benchmarks.current_consumption.systemoff.grtc_wakeup:
platform_allow:
- nrf54l15dk/nrf54l15/cpuapp
- nrf54l15dk/nrf54l10/cpuapp
- nrf54l15dk/nrf54l05/cpuapp
integration_platforms:
- nrf54l15dk/nrf54l15/cpuapp
extra_configs:
Expand All @@ -48,50 +50,39 @@ tests:
timeout: 80
benchmarks.current_consumption.sample.boards.nrf.system_off:
platform_allow:
- nrf54l15dk/nrf54l15/cpuapp
- nrf52840dk/nrf52840
- nrf52dk/nrf52832
- nrf5340dk/nrf5340/cpuapp
integration_platforms:
- nrf54l15dk/nrf54l15/cpuapp
- nrf54l15dk/nrf54l10/cpuapp
- nrf54l15dk/nrf54l05/cpuapp
integration_platforms:
- nrf52840dk/nrf52840
- nrf52dk/nrf52832
- nrf5340dk/nrf5340/cpuapp
- nrf54l15dk/nrf54l15/cpuapp
tags: ppk_power_measure
harness: pytest
harness_config:
fixture: ppk_power_measure
pytest_root:
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_systemoff"
timeout: 90
benchmarks.current_consumption.sample.boards.nrf.system_off.nrf_retained:
benchmarks.current_consumption.sample.boards.nrf.system_off.retained_mem:
platform_allow:
- nrf52840dk/nrf52840
- nrf52dk/nrf52832
- nrf5340dk/nrf5340/cpuapp
- nrf54l15dk/nrf54l15/cpuapp
- nrf54l15dk/nrf54l10/cpuapp
- nrf54l15dk/nrf54l05/cpuapp
integration_platforms:
- nrf52840dk/nrf52840
- nrf52dk/nrf52832
- nrf5340dk/nrf5340/cpuapp
extra_configs:
- CONFIG_APP_USE_NRF_RETENTION=y
tags: ppk_power_measure
harness: pytest
harness_config:
fixture: ppk_power_measure
pytest_root:
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_systemoff"
timeout: 90
benchmarks.current_consumption.sample.boards.nrf.system_off.retained_mem:
platform_allow:
- nrf54l15dk/nrf54l15/cpuapp
integration_platforms:
- nrf54l15dk/nrf54l15/cpuapp
extra_args:
- "DTC_OVERLAY_FILE=boards/nrf54l15dk_nrf54l15_cpuapp_ret_mem.overlay"
- "-DBOARD_ROOT=${ZEPHYR_BASE}/samples/boards/nordic/system_off"
extra_configs:
- CONFIG_APP_USE_RETAINED_MEM=y
- CONFIG_RETAINED_MEM=y
tags: ppk_power_measure
harness: pytest
harness_config:
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ manifest:
# https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html
- name: zephyr
repo-path: sdk-zephyr
revision: bc80cbda202a69435c7333544c9c5359e4aef0fc
revision: pull/2313/head
import:
# In addition to the zephyr repository itself, NCS also
# imports the contents of zephyr/west.yml at the above
Expand Down
Loading