Note: lists.zephyrproject.org will be down for maintenance on Monday, September 26th, starting at 9AM Pacific Time (4PM Monday September 26, 2022 UTC), for approximately one hour.
Phil Erwin Jr
In v2.3 when building with CONFIG_USERSPACE enabled, I see that we do not do a context switch a short time after POR. I've chased this back and found the the cpus.nested has incremented to 6, so the code in z_arm_int_exit() thinks we are in a nested interrupt, and does not switch to another task.
The flaw is because of our syscall path. On each syscall, we increment the nested count upon entry to the SVC (z_arm_svc in swap_helper.S), but then we go through z_arm_do_syscall (userspace.S) and return from the syscall without ever decrementing nested.
The Cortex M code appears to work the same way to me.
It seems to me that the system call should exit by means of branching to z_arm_exc_exit, as is done elsewhere.