Skip to content

Conversation

@erwango
Copy link
Member

@erwango erwango commented Nov 6, 2024

By default, libc malloc allocated area is using all available RAM. For some yet unknown reason, this conflicts with TF-M resulting in a Hard Fault before jumping in the non secure application.

Fow now, define a Libc malloc area defined to 2048 which is the default in some other typical applications (ARMv7 targets enabling USERSPACE).

Fixes #77847

Thanks to @norrathep for the hint.

Copy link
Contributor

@mathieuchopstm mathieuchopstm left a comment

Choose a reason for hiding this comment

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

LGTM functionally, but I would document in the files themselves why we're doing this (e.g., by linking to the issue).

@erwango erwango changed the title boards: st: stm32l5: Fix TF-M by restricting Libc malloc aera boards: st: stm32l5: Fix TF-M by restricting Libc malloc area Nov 6, 2024
mathieuchopstm
mathieuchopstm previously approved these changes Nov 6, 2024
Copy link
Contributor

@mathieuchopstm mathieuchopstm left a comment

Choose a reason for hiding this comment

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

Minor non-blockers:

By default, libc malloc allocated area is using all available RAM.
For some yet unknown reason, this conflicts with TF-M resulting in a
Hard Fault before jumping in the non secure application.

For now, define a Libc malloc area defined to 2048 which is the default in
some other typical applications (ARMv7 targets enabling USERSPACE).

Fixes zephyrproject-rtos#77847

Signed-off-by: Erwan Gouriou <[email protected]>
@mmahadevan108 mmahadevan108 merged commit b2c9db7 into zephyrproject-rtos:main Nov 8, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform: STM32 ST Micro STM32

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nucleo L552ZEQ TFM-IPC HardFault

5 participants