Skip to content

Commit 709482e

Browse files
tomchynvlsianpu
authored andcommitted
fix: Offset application start address by mrm1x
Signed-off-by: Tomasz Chyrowicz <[email protected]>
1 parent 0a19e33 commit 709482e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-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 (

0 commit comments

Comments
 (0)