ASSERTION FAIL in define stack for user-mode thread after migrating project to SDK 1.9

Hi,

I have a problem after migrating project from SDK 1.8 to 1.9.

I create thread in user mode by:

k_thread_create(&user_eventloop_thread, user_eventloop_stack,
				K_THREAD_STACK_SIZEOF(user_eventloop_stack),
				user_eventloop, NULL, NULL, NULL,
				-1, K_USER, K_FOREVER);
and corresponding stack by:
K_THREAD_STACK_DEFINE(user_eventloop_stack, USER_EVENTLOOP_STACKSIZE);
and I get this:
ASSERTION FAIL [(options & ((1UL << (2)))) == 0U || z_stack_is_user_capable(stack)] @ WEST_TOPDIR/zephyr/kernel/thread.c:514

  user thread 0x2001bd10 with kernel-only stack 0x2002ce00

[00:00:08.251,464] <err> os: r0/a1:  0x00000004  r1/a2:  0x00000202  r2/a3:  0x00000000
[00:00:08.251,953] <err> os: r3/a4:  0x00000000 r12/ip:  0x80000000 r14/lr:  0x0008642d
[00:00:08.252,441] <err> os:  xpsr:  0x61000000
[00:00:08.252,807] <err> os: s[ 0]:  0x00000000  s[ 1]:  0x00000000  s[ 2]:  0x00000000  s[ 3]:  0x00000000
[00:00:08.253,448] <err> os: s[ 4]:  0x00000000  s[ 5]:  0x00000000  s[ 6]:  0x00000000  s[ 7]:  0x00000000
[00:00:08.254,058] <err> os: s[ 8]:  0x00000000  s[ 9]:  0x00000000  s[10]:  0x00000000  s[11]:  0x00000000
[00:00:08.254,699] <err> os: s[12]:  0x00000000  s[13]:  0x00000000  s[14]:  0x00000000  s[15]:  0x00000000
[00:00:08.255,340] <err> os: fpscr:  0x00000000
[00:00:08.255,676] <err> os: Faulting instruction address (r15/pc): 0x00086446
[00:00:08.261,138] <err> os: >>> ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0
[00:00:08.261,566] <err> os: Current thread: 0x2001c0d0 (main)
Why I'm get this? In SDK 1.8 everything works fine.
Parents Reply Children
  • Hi Mateusz

    I tried to copy your code snippets into the basic blinky example without any issues. 

    Have you tried to figure out if the error occurs at some particular point in your code? 

    Does it happen during initialization, or after the thread has been running for some time?

    If you don't do anything in the thread function will it still happen?

    Best regards
    Torbjørn

Related