Skip to content

Conversation

@Vge0rge
Copy link
Contributor

@Vge0rge Vge0rge commented Sep 30, 2025

Add the tfm_platform_system_off APIs in a similar manner as the existing tfm_platform_system_reset. This API should enable implementations to allow setting the TF-M to the lowest power mode using custom their own HAL APIs.

Right now this will work for isolation level 1 (SFN mode). In the IPC mode there is a need for better TF-M support for this. There is a discussion with the TF-M owners to add logic to TF-M so that it can inform all the partitions in order to make sure that it is safe to go to system off mode.

* \details Requests the system to enter a low-power state.
*/
TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_PLATFORM", "PSA-ROT")
void tfm_platform_hal_system_off(void);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be int-return for failure conditions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I converted it to an enum tfm_platform_err_t as the other functions.

@Vge0rge Vge0rge requested a review from a team November 26, 2025 11:22
@Vge0rge Vge0rge force-pushed the tfm_system_off branch 2 times, most recently from 3e47305 to 4a42770 Compare November 26, 2025 15:11
Copy link
Collaborator

@tomi-font tomi-font left a comment

Choose a reason for hiding this comment

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

Is this expected to then go upstream?

Copy link
Contributor

@frkv frkv left a comment

Choose a reason for hiding this comment

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

LGTM (only nits left)

@Vge0rge
Copy link
Contributor Author

Vge0rge commented Nov 27, 2025

Is this expected to then go upstream?

Not as is, there was a discussion with the TF-M maintainers and we both agree that something like this needs to be added upstream. Not sure if the naming will be the same.

Add the tfm_platform_system_off APIs in a similar manner
as the existing tfm_platform_system_reset. This API
should enable implementations to allow setting the
TF-M to the lowest power mode using their own
HAL APIs.

Right now this will work for isolation level 1 (SFN mode).
In the IPC mode there is a need for better TF-M support for
this. There is a discussion with the TF-M owners to add logic
to TF-M so that it can inform all the partitions in order
to make sure that it is safe to go to system off mode.

Signed-off-by: Georgios Vasilakis <georgios.vasilakis@nordicsemi.no>
@rlubos rlubos merged commit df48857 into nrfconnect:main Nov 28, 2025
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