哪位大神有Renesas M16C65系列 UCOS2 移植经验的 求解答,谢谢
IDE: IAR
Hardware: Renesas M16C65
OS: ucos2.56
我从官网上下载了M16C62P的例程做参考,移植了快1周,任务建立也成功,在OSStart()单步调试到RETI后,程序飞了,什么原因,请大神指点,谢谢
.EVEN
OSStartHighRdy:
JSR OSTaskSwHook
MOV.W OSTCBHighRdy, A0 ; ISP = OSTCBHighRdy->OSTCBStkPtr
LDC [A0], ISP
MOV.B #01H, OSRunning ; OSRunning = TRUE
POPM R0,R1,R2,R3,A0,A1,SB,FB
REIT
[解决办法]
LZ先到UCOS的官网找找
:)
[解决办法]
OSStart()后应该会有个死循环
[解决办法]
是否初始堆栈(非任务堆栈,main函数使用的堆栈)设置的太小了,你在main函数的初始化函数里用了太多的局部变量导致堆栈溢出了。
初始堆栈一般是在启动汇编中设置的。
[解决办法]
INT32S main (void)
{
CPU_INT08U os_err;
os_err = os_err; /* prevent warning... */
/* Note: óéóúê1ó?UCOS, ?úOS??DD???°??DD,×¢òa±eê1?üè?o??D??. */
IntDisAll(); /* Disable all ints until we are ready to accept them. */
OSInit(); /* Initialize "uC/OS-II, The Real-Time Kernel". */
os_err = OSTaskCreateExt((void (*)(void *)) App_TaskStart, /* Create the start task. */
(void * ) 0,
(OS_STK * )&App_TaskStartStk[APP_TASK_START_STK_SIZE - 1],
(INT8U ) APP_TASK_START_PRIO,
(INT16U ) APP_TASK_START_PRIO,
(OS_STK * )&App_TaskStartStk[0],
(INT32U ) APP_TASK_START_STK_SIZE,
(void * )0,
(INT16U )(OS_TASK_OPT_STK_CLR
[解决办法]
OS_TASK_OPT_STK_CHK));
#if OS_TASK_NAME_EN > 0
OSTaskNameSet(APP_TASK_START_PRIO, (CPU_INT08U *)"Start Task", &os_err);
#endif
OSStart(); /* Start multitasking (i.e. give control to uC/OS-II). */
return (0);
}
static void App_TaskStart (void *p_arg)
{
(void)p_arg;
/*************** Init hardware ***************/
OS_CPU_SysTickInit(SystemCoreClock/1000); /* Initialize the SysTick. */
#if (OS_TASK_STAT_EN > 0)
OSStatInit(); /* Determine CPU capacity. */
#endif
/******************************/
App_TaskCreate(); /* Create application tasks. */
for(;;)
{
OSTimeDlyHMSM(0, 1, 0, 0); /* Delay One minute */
}
}