-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Closed as not planned
Closed as not planned
Copy link
Labels
StaleWaiting for responseWaiting for author's responseWaiting for author's responsearea: TF-MARM Trusted Firmware-M (TF-M)ARM Trusted Firmware-M (TF-M)bugThe issue is a bug, or the PR is fixing a bugThe issue is a bug, or the PR is fixing a bugplatform: STM32ST Micro STM32ST Micro STM32priority: lowLow impact/importance bugLow impact/importance bug
Description
Describe the bug
When using TFM (with STM32U585), the stack is limited on non-secure application.
First test based on tfm_ipc sample:
- Add several threads in tfm_ipc sample (more than 132KB as total stack)
- Run tfm_ipc sample : reboot looping after TF-M boot (non secure boot)
Second test based on tfm_ipc sample under stack limit:
- Same as first test but limit total stack to 131KB
- Run successfully
Third test without TFM:
- Remove all TFM-related from TFM_IPC sample
- Add several threads (more than 200KB as total stack)
- Run succesfully
Please also mention any information which could help others to understand
the problem you're facing:
- What target platform are you using?
STM32U585 custom board - What have you tried to diagnose or workaround this issue?
I tried to increase NS_STACK_SIZE in region_defs.h but no success. Maybe MSPLIM/PSPLIM registers could trigger stack overflow/protection.
The stack limit reached is equivalent to memory shift by an offset equal to 0x20000 (131072d) - Is this a regression? If yes, have you been able to "git bisect" it to a
specific commit?
Tested with TF-M 1.7 and TF-M 1.8 with the same result
Zephyr 3.4.99 (rebased on main)
MCU: STM32U585QI
To Reproduce
Steps to reproduce the behavior:
- Open sample TFM_IPC (in sample/tfm_integration/tfm_ipc)
- Increase main stack size and add K_THREAD_DEFINE to reach up to 131KB of stacks
- Run with TFM
- make & flash (regression.sh && west flash)
- See error
Expected behavior
MCU has 768KB of RAM and I expect to use them, at least 256KB.
Impact
showstopper
Logs and console output
[Sec Thread] Secure image initializing!
Booting TF-M v1.8.0
[INF][Crypto] Initialising HW accelerator... complete.
[WRN] This device was provisioned with dummy keys. This device is NOT SECURE
[Sec Thread] Secure image initializing!
Booting TF-M v1.8.0
[INF][Crypto] Initialising HW accelerator... complete.
[WRN] This device was provisioned with dummy keys. This device is NOT SECURE
[Sec Thread] Secure image initializing!
Booting TF-M v1.8.0
[INF][Crypto] Initialising HW accelerator... complete.
[WRN] This device was provisioned with dummy keys. This device is NOT SECURE
[Sec Thread] Secure image initializing!
Booting TF-M v1.8.0
[INF][Crypto] Initialising HW accelerator... complete.
Environment (please complete the following information):
- OS: MacOS
- Zephyr SDK 0.15.2
- Zephyr main for test (TF-M 1.8)
Metadata
Metadata
Assignees
Labels
StaleWaiting for responseWaiting for author's responseWaiting for author's responsearea: TF-MARM Trusted Firmware-M (TF-M)ARM Trusted Firmware-M (TF-M)bugThe issue is a bug, or the PR is fixing a bugThe issue is a bug, or the PR is fixing a bugplatform: STM32ST Micro STM32ST Micro STM32priority: lowLow impact/importance bugLow impact/importance bug