k_thread_user_mode_enter() usage

Vakul Garg <vakul.garg@...>


I want my application auto-launched at zephyr startup to drop its privileges to become user mode app.
So I moved my applications entry point to app_main() and invoked it from k_thread_user_mode_enter(app_main, NULL, NULL, NULL) from function void main().

Now, before app_main() could get called, I get following error:

***** BUS FAULT *****
Executing thread ID (thread): 0x20002eec
Faulting instruction address: 0x12da
Precise data bus error
Address: 0x20011208
Fatal fault in thread 0x20002eec! Aborting.
***** Stack Check Fail! *****
Current thread ID = 0x20002eec
Faulting instruction address = 0x2a290

I checked that the stack sentinel check is failing in function _check_stack_sentinel().

Can someone advise what I am doing wrong?



Join users@lists.zephyrproject.org to automatically receive all group messages.