Skip to content

Commit 36452d3

Browse files
committed
[nrf noup] boot/zephyr/socs: nrf54h20 prj.conf for S2RAM
Added configuration which pre-configures MCUboot so It is able to support operation of resuming the App from S2RAM by the application itself. Offset application start address by mrm1x. Implementation is able to support only MCUboot modes with a swap. Direct-XIP is not handled as it require a way to run-time recognization of active application slot. Signed-off-by: Tomasz Chyrowicz <[email protected]>
1 parent 7bc79fd commit 36452d3

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

boot/zephyr/nrf54h20_custom_s2ram.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,17 @@
2020
* `zephyr,memory-region` compatible DT node with nodelabel `mcuboot_s2ram`.
2121
*/
2222
__attribute__((section(DT_PROP(DT_NODELABEL(mcuboot_s2ram), zephyr_memory_region))))
23-
struct mcuboot_resume_s _mcuboot_resume;
23+
volatile struct mcuboot_resume_s _mcuboot_resume;
2424
#else
2525
#error "mcuboot resume support section not defined in dts"
2626
#endif
2727

28+
#define FIXED_PARTITION_ADDR(node_label) \
29+
(DT_REG_ADDR(DT_NODELABEL(node_label)) + \
30+
COND_CODE_0(DT_FIXED_PARTITION_EXISTS(DT_NODELABEL(node_label)), (0), \
31+
(DT_REG_ADDR(DT_GPARENT(DT_NODELABEL(node_label))))))
32+
33+
2834
int soc_s2ram_suspend(pm_s2ram_system_off_fn_t system_off)
2935
{
3036
(void)(system_off);
@@ -61,7 +67,7 @@ bool pm_s2ram_mark_check_and_clear(void)
6167

6268
// s2ram boot
6369
struct arm_vector_table *vt;
64-
vt = (struct arm_vector_table *)(FIXED_PARTITION_OFFSET(slot0_partition) + 0x800);
70+
vt = (struct arm_vector_table *)(FIXED_PARTITION_ADDR(slot0_partition) + 0x800);
6571

6672
// Jump to application
6773
__asm__ volatile (
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2025 Nordic Semiconductor ASA
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
6+
# Configuration which is needed for supporting resume the application execution
7+
# after suspend to RAM (S2RAM) requested by the application.
8+
# MCUboot does not support S2RAM itself, but serves as an immediate actor while waking up
9+
# from suspension.
10+
CONFIG_PM=y
11+
CONFIG_PM_S2RAM=y
12+
CONFIG_PM_S2RAM_CUSTOM_MARKING=y
13+
CONFIG_SOC_NRF54H20_PM_S2RAM_OVERRIDE=y

0 commit comments

Comments
 (0)