I have some code running upon ARM7,first I create start task in main using OSTaskCreateExt, then it will create some sub tasks in start task, i.e. Usage of AppTaskCreate. but then It never be called back and run the next line again after enter into OSStatInit. From debugging I find that when enter into OSStatInit once, Task of Start is deleted from the ready task table of os schedule, and steply there is no time tick response which is in charge of change the state of ready task table. so it will never schedul the start task again. After finding that I debug deeply into time manager in uc/os-ii kernel. when run the code in OSTmr_Task, it keep a break and stop at the line of "OSSemPend(OSTmrSemSignal, 0, &err);" by waiting some singal. so I think there is lack of some singal to invoke that. by the end, I want to ask what is the reason may be cause my proplem?
some code is listed below:
int main (void)
{
BSP_IntDisAll();
OSInit(); /* Initialize "uC/OS-II, The Real-Time Kernel" */
err = OSTaskCreateExt(AppTaskStart,
(void *)0,
(OS_STK *)&AppTaskStartStk[APP_TASK_START_STK_SIZE - 1],
APP_TASK_START_PRIO,
APP_TASK_START_PRIO,
(OS_STK *)&AppTaskStartStk[0],
APP_TASK_START_STK_SIZE,
(void *)0,
OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);
if(err != OS_NO_ERR) {
return 0;
}
#if (OS_TASK_NAME_SIZE > 13)
OSTaskNameSet(APP_TASK_START_PRIO, "Start Task", &err);
#endif
OSStart();
return 0;
}
static void AppTaskStart (void *p_arg)
{
(void)p_arg;
p_arg = p_arg; //avoid warning
BSP_Init(); /* Initialize BSP functions*/
OSStatInit(); /* Determine CPU capacity*/
AppTaskCreate(); /* Create application tasks */
OSTimeDlyHMSM(0,0,0,10);
OSTaskDel(OS_PRIO_SELF);
}
Thanks to @D Krueger and @Clifford. The proplem has an answer, Because I forgot to initialize the timer tick manager on bsp. just that's it.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments