Forum Discussion
Altera_Forum
Honored Contributor
21 years agoI too have had difficulty printing before tasking is started with uC/OS-II.
I believe it will always cause uC/OS-II to hang if a pend call is made from main. This happens because the scheduler ends up getting started in the pend call. So it is almost equivalent to calling OSStart (without initializing properly). Labrosse (author of uC/OS-II) suggests that one shouldn't start tasks from within main, but rather from within a task. This would also fix your problem. The reason Labrosse suggests it, is because the statistics task won't work properly if the tasks are started before OSStart. In my application we have a short lived task which is basicly the equivalent of your main and we only start the one task from within main. Hope this helps.