Skip to content

Conversation

nvlsianpu
Copy link
Contributor

@nvlsianpu nvlsianpu commented Sep 18, 2025

For case when the zephyr-rtos application is the bootloader and booted target application had suspended the device, the resume operation would be initiated by the bootloader which could redirect execution to the application S2RAM routines directly.

Thanks to that target application would resume using compiled in S2RAM routines. Such scheme allows the zephyr-rtos based bootloader to not mock the application while does S2RAM resume operation. Therefore no need for keeping compatibility with S2RAM resume mechanism in application. No need to enable PM nor PM_S2RAM anymore in the bootloader.

Advantages:

  • less program NVM consumed (~0.5 KB)
  • unnecessary PM and PM_S2RAM code opt-out - code-derisk

Cons:
* low-level patch in start-up ARM code

ref.: NCSDK-35391
zephyr-rtos: zephyrproject-rtos/zephyr#96290
zephyr-rtos: zephyrproject-rtos/zephyr#96962
Turned to [nrf noup] Patch can't be accepted upstream.
reworked to the hook branch in reset.S of cortex_m startup code

also this nrf fromlist commit is reverted as now it's code can be moved to the hook implementation

manifest-pr-skip

@nvlsianpu nvlsianpu force-pushed the s2ram_resume_inter branch 2 times, most recently from 077fd10 to 95cbf6b Compare September 19, 2025 14:28
@nvlsianpu nvlsianpu changed the title S2ram resume inter arch/arm/cortex_m: support for bridge to the next image S2RAM routinesS2ram resume inter Sep 19, 2025
@nvlsianpu nvlsianpu changed the title arch/arm/cortex_m: support for bridge to the next image S2RAM routinesS2ram resume inter [nrf fromlist] arch/arm/cortex_m: support for bridge to the next image S2RAM routinesS2ram resume inter Sep 19, 2025
@nvlsianpu nvlsianpu marked this pull request as ready for review September 19, 2025 15:40
@nvlsianpu nvlsianpu changed the title [nrf fromlist] arch/arm/cortex_m: support for bridge to the next image S2RAM routinesS2ram resume inter [nrf noup] arch/arm/cortex_m: support for bridge to the next image S2RAM routinesS2ram resume inter Sep 26, 2025
Copy link
Contributor

@carlescufi carlescufi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bjarki-andreasen would you be able to propose a solution that can actually work for both up and downstream?

@nvlsianpu nvlsianpu changed the title [nrf noup] arch/arm/cortex_m: support for bridge to the next image S2RAM routinesS2ram resume inter [nrf noup] arch/arm/cortex_m: support for bridge to the next image S2RAM resume routines Sep 30, 2025
@nvlsianpu nvlsianpu force-pushed the s2ram_resume_inter branch 3 times, most recently from 44c6ac8 to 84bf948 Compare October 3, 2025 12:47
@nvlsianpu nvlsianpu changed the title [nrf noup] arch/arm/cortex_m: support for bridge to the next image S2RAM resume routines [nrf fromlist] arch/arm/cortex_m: support for bridge to the next image S2RAM resume routines Oct 3, 2025
@nvlsianpu nvlsianpu force-pushed the s2ram_resume_inter branch 2 times, most recently from e69b330 to 7a11b57 Compare October 6, 2025 15:51
@tomchy tomchy requested a review from carlescufi October 7, 2025 07:23
@nvlsianpu nvlsianpu changed the title [nrf fromlist] arch/arm/cortex_m: support for bridge to the next image S2RAM resume routines [nrf fromtree] arch/arm/cortex_m: support for bridge to the next image S2RAM resume routines Oct 7, 2025
This reverts commit cc5a1b4.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Introduce hook for customize reset.S code even before stack is
initialized or RAM is accessed. Hook can be enabled using
CONFIG_SOC_EARLY_RESET_HOOK=y.
Hook implementation is by soc_early_reset_hook() function which should
be provided by custom code.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>

(cherry picked from commit 418eed0f90781a0d6d70f4e79c0006ce3955823f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants