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
This is another one where I'm not sure whether this is a problem with SERV, or whether I'm not understanding something fundamental about Zephyr, but my threads don't get preempted, only cooperative multithreading is possible.
I modified the hello_world example to have the following main.c:
(.venv) user@3ce4f3685fd5:~/projects/fpga/serv_mainline/0TESTING (feature/zephyr-4.0.0)$ fusesoc run --target=verilator_tb servant --uart_baudrate=57600 --firmware=zephyr/samples/hello_world/hello.hex --memsize=65535
INFO: Preparing ::serv:1.3.0
INFO: Preparing ::servile:1.3.0
INFO: Preparing ::servant:1.3.0
make: Nothing to be done for 'all'.
Loading RAM from /home/user/projects/fpga/serv_mainline/0TESTING/zephyr/samples/hello_world/hello.hex
*** Booting Zephyr OS build v4.0.0 ***
Hello World! service
Test thread
Hello World! service
Test thread
Hello World! service
Test thread
Hello World! service
Test thread
Hello World! service
Test thread
Hello World! service
Test thread
But when I go ahead now and comment out the k_msleep() in one of the processes, the other one is never scheduled again.
With msleep commented out in main:
(.venv) user@3ce4f3685fd5:~/projects/fpga/serv_mainline/0TESTING (feature/zephyr-4.0.0)$ fusesoc run --target=verilator_tb servant --uart_baudrate=57600 --firmware=zephyr/samples/hello_world/hello.hex --memsize=65535
INFO: Preparing ::serv:1.3.0
INFO: Preparing ::servile:1.3.0
INFO: Preparing ::servant:1.3.0
make: Nothing to be done for 'all'.
Loading RAM from /home/user/projects/fpga/serv_mainline/0TESTING/zephyr/samples/hello_world/hello.hex
*** Booting Zephyr OS build v4.0.0 ***
Hello World! service
Hello World! service
Hello World! service
Hello World! service
Hello World! service
Hello World! service
Hello World! service
Hello World! service
With msleep comment out in task:
(.venv) user@3ce4f3685fd5:~/projects/fpga/serv_mainline/0TESTING (feature/zephyr-4.0.0)$ fusesoc run --target=verilator_tb servant --uart_baudrate=57600 --firmware=zephyr/samples/hello_world/hello.hex --memsize=65535
INFO: Preparing ::serv:1.3.0
INFO: Preparing ::servile:1.3.0
INFO: Preparing ::servant:1.3.0
make: Nothing to be done for 'all'.
Loading RAM from /home/user/projects/fpga/serv_mainline/0TESTING/zephyr/samples/hello_world/hello.hex
*** Booting Zephyr OS build v4.0.0 ***
Hello World! service
Test thread
Test thread
Test thread
Test thread
Test thread
Test thread
Test thread
Test thread
Test thread
I checked that PREEMPT_ENABLED=1 is selected in the config. Everything looks good there as far as I can tell. Also, removing the printf along with the msleep (just a silent loop) shows that the other thread is never scheduled (just to make sure that the many prints don't hide the less often scheduled print.)
Maybe you have some minutes to look into this as well. Thanks!
The text was updated successfully, but these errors were encountered:
This is another one where I'm not sure whether this is a problem with SERV, or whether I'm not understanding something fundamental about Zephyr, but my threads don't get preempted, only cooperative multithreading is possible.
I modified the
hello_world
example to have the following main.c:When I run this, everything looks fine:
But when I go ahead now and comment out the k_msleep() in one of the processes, the other one is never scheduled again.
With msleep commented out in main:
With msleep comment out in task:
I checked that
PREEMPT_ENABLED=1
is selected in the config. Everything looks good there as far as I can tell. Also, removing the printf along with the msleep (just a silent loop) shows that the other thread is never scheduled (just to make sure that the many prints don't hide the less often scheduled print.)Maybe you have some minutes to look into this as well. Thanks!
The text was updated successfully, but these errors were encountered: