[uC/OS-II] RTOS for XMEGA

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

A while (years?) ago I posted demo projects for running uC/OS-II and uC/OS-III on the XMEGA Xplained and Xplain boards. The links to those project files on my website have been dead for a while - so I now have instead uploaded the complete projects to Github (plus the compiled HEX binaries if you simple want to play without compiling!)

I created these demo projects after using uC/OS in a XMEGA-based robotics project... I have since drifted a bit more towards FreeRTOS for my projects - nevertheless, I think some people may find these useful :)

uC/OS-II:
https://github.com/nickdademo/xm...

uC/OS-III:
https://github.com/nickdademo/xm...

Cheers,
Nick

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i dmginc,

I use this os in xmega128A1U. I would like to thank you for your works.

 

Let me ask you a question.

Among three tasks, one task does not work happens.

 

Project files is here:  https://sourceforge.jp/projects/...

 

Would you tell me the solution to operate this task?

 

I made 3 tasks.


void MenuTask(void *p_arg);
void RFRecvTask(void *p_arg);
void OperTask(void *p_arg);

A task "OperTask" does not work at all.

 

 

 

Setting of three tasks



void TaskStartCreateTasks(void)
{
	// Task1: PRIORITY=3
	OSTaskCreateExt((void (*)(void *)) MenuTask,
	(void           *) 0,
	(OS_STK         *)&TaskStk[0][APP_CFG_TASK_STK_SIZE - 1],
	(INT8U           ) 3,
	(INT16U          ) 3,
	(OS_STK         *)&TaskStk[0][0],
	(INT32U          ) APP_CFG_TASK_STK_SIZE , 
	(void           *) 0,
	(INT16U          )(OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR));

	// Task2: PRIORITY=4
	OSTaskCreateExt((void (*)(void *)) RFRecvTask,
	(void           *) 0,
	(OS_STK         *)&TaskStk[1][APP_CFG_TASK_STK_SIZE - 1],
	(INT8U           ) 4,
	(INT16U          ) 4,
	(OS_STK         *)&TaskStk[1][0],
	(INT32U          ) APP_CFG_TASK_STK_SIZE,
	(void           *) 0,
	(INT16U          )(OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR));

	// Task2: PRIORITY=4
	OSTaskCreateExt((void (*)(void *)) OperTask,
	(void           *) 0,
	(OS_STK         *)&TaskStk[2][APP_CFG_TASK_STK_SIZE - 1],
	(INT8U           ) 5,
	(INT16U          ) 5,
	(OS_STK         *)&TaskStk[2][0],
	(INT32U          ) APP_CFG_TASK_STK_SIZE,
	(void           *) 0,
	(INT16U          )(OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR));

} 

 

Only OperTask does not break through at all when I break through by each task with a ICE debuggeroid MainTask(void *p_arg);

 

I would like to tell me the number of upper limit's the task in ucos.

Is it 3 tasks?

void MainTask(void *p_arg);
void MenuTask(void *p_arg);
void RFRecvTask(void *p_arg);
void OperTask(void *p_arg);

 

 

I hope a solution or something advise.

 

Thanks

 

 

 

 

 

 

 

kenji maehara

Last Edited: Tue. Feb 17, 2015 - 04:38 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi BlackZoro,

 

Did you end up fixing your issue?

 

Without seeing your entire code it's hard to guess...

A) Is the TaskStk array big enough to hold your 4 tasks?

B) What does each task look like? (in particular, OperTask)

 

EDIT: I just noticed you posted a link to your code - I'll take a look.

 

EDIT #2: OK, try adding some delay calls (OSTimeDlyHMSM) to MenuTask and RFRecvTask. Both these tasks have a higher priority than OperTask and because they are always ready to run (they never sleep!), OperTask will never get scheduled. Actually, I'd be surprised if RFRecvTask actually gets scheduled as well - does it?

 

Cheers,

Nick

Last Edited: Fri. Mar 13, 2015 - 04:24 AM