User Details
- User Since
- Oct 8 2020, 1:38 PM (215 w, 18 m)
Jul 30 2021
i will try to revert the patch that is mentioned above and report here.
Jul 28 2021
Hi Kevin.
Jul 16 2021
Jun 3 2021
As you know, for secure and non-secure side are closely related in TF-M. In latest TF-M v1.3 release, FP support (in secure side either non-secure side) are not official announced, so the problem you reported is not a TF-M bug.
Jun 1 2021
Hi Feder,
Honestly, I've only faced this issue when doing some advance scheduling manipulations on the Non-Secure side (modifying LSPACT, FPCA, etc.), so not in mainline TF-M/RTOS use-cases. Please disregard it for now.
May 31 2021
Any updates here, Feder?
May 27 2021
However, this is only a partial solution. That is because a Secure thread re-scheduling will clear the .FPCA flag, but leave the LSPACT set, meaning that a NS IRQ with FP instructions will trigger again an FP stacking. But this FP stacking will be done on the memory where FPCAR is pointing at, and FPCAR is only updated in exception entry, if .FPCA is set. As a result, it does not seem that you avoid a stack corruption.
Hi Feder, correct; setting CPACR_S solves the problem of Secure No-Coprocessor Usage Fault.
May 26 2021
Anton, could you please, suggest an assignee for this one? Thanks!
Hi Feder,
May 18 2021
I tried this on my side on STM32L562e_dk board with TF-M repo: enable "-mfloat-abi=softfp" in NS side and use TF-M default "-mfloat-abi=soft" option, and changed FP registers in non-secure thread first, then do PSA call. When system is in secure thread mode, no crash found even FPCCR_S.LSPACT = 1.
Do you have FP instruction in secure thread? If there is no FP instruction, the processor will not stack FP registers even LSPACT flag is set.
I tried this on my side on STM32L562e_dk board with TF-M repo: enable "-mfloat-abi=softfp" in NS side and use TF-M default "-mfloat-abi=soft" option, and changed FP registers in non-secure thread first, then do PSA call. When system is in secure thread mode, no crash found even FPCCR_S.LSPACT = 1.
May 13 2021
TF-M currently support "-mfloat-abi=soft" as default, but doesn't support the setting in Zephyr "-mfloat-abi=softfp". Because they are totally different things.
Yes, it crashes even without Lazy Stacking. It is a bit more deterministic as is. It crashes in the first secure exception entry, after the transition to secure domain from non-secure.
But for Zephyr, are you using soft FP or hardware FP?
May 12 2021
Hi Feder,
May 3 2021
Setting this to High for now - but feel free to re-triage this was not appropriate.
Hi Feder,