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
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?