You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A bunch of tests are now reported failed on Cortex-M0+ based board (nucleo_g071rb, nucleo_l073rz).
Regression occurs since merge of Cortex-R PR: #28231
To Reproduce
Steps to reproduce the behavior:
west build -p auto -b nucleo_g071rb tests/kernel/mutex/mutex_api/
west flash
See error
Logs and console output
*** Booting Zephyr OS build zephyr-v2.6.0-2072-gb055054d417b ***
Running test suite mutex_api
===================================================================
START - test_mutex_lock_unlock
E: ***** HARD FAULT *****
Environment (please complete the following information):
Analysis
Regression has been introduced in arch\arm\core\aarch32\userspace.S
by e0bed3b "arch: arm: cortex_r: Add MPU and USERSPACE support"
(PR #28231)
It introuced unintended ASM instruction " msr PSP, ip" for CONFIG_ARMV6_M_ARMV8_M_BASELINE:
code :
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
/* set stack back to unprivileged stack */
mov ip, r0
mov r0, sp
ldr r0, [r0,#12]
msr PSP, r0
/* Restore r0 */
mov r0, ip
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE) \
|| defined(CONFIG_CPU_CORTEX_R)
/* set stack back to unprivileged stack */
ldr ip, [sp,#12]
#endif
#if defined(CONFIG_CPU_CORTEX_R)
mov sp, ip
#else
msr PSP, ip
#endif
as been replaced by
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
/* set stack back to unprivileged stack */
mov ip, r0
mov r0, sp
ldr r0, [r0,#12]
msr PSP, r0
/* Restore r0 */
mov r0, ip
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE) \
|| defined(CONFIG_CPU_CORTEX_R)
/* set stack back to unprivileged stack */
ldr ip, [sp,#12]
#endif
#if defined(CONFIG_CPU_CORTEX_R)
mov sp, ip
#else
msr PSP, ip
#endif
Thus "msr PSP, ip" is present to all arch expect cortex-R whereas it was initially not present for ARMV6_M_ARMV8_M_BASELINE
ABOSTM
added a commit
to ABOSTM/zephyr
that referenced
this issue
Sep 9, 2021
Describe the bug
A bunch of tests are now reported failed on Cortex-M0+ based board (nucleo_g071rb, nucleo_l073rz).
Regression occurs since merge of Cortex-R PR: #28231
To Reproduce
Steps to reproduce the behavior:
Logs and console output
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: