Showing results for 
Search instead for 
Did you mean: 

PSoC™ 5, 3 & 1

Not applicable

I am trying to get uCos to work, I have a small keypad program as a set-up to build from.  I have no errors that I can see yet uCos never leaves my lowest priotiy task.  


I have three tasks Start Task (priority 2) which initializes several things including timers and starts Keypad Task and Display Task.


Keypad Task (priority 5) scans the keypad and includes calls to OSTimeDly and OSSemPost, both functions run without errors, however the task never returns once it is started.    


This pervents my main Display Task (priority 4) from running.  The Display Task which makes a call to OSSemPend on the flag from Keypad Task never gets reached because Keypad_Init never returns, instead Keypad Task constantly scans the keypad and posting semphore which go unchecked by Display Task.  All three tasks have OSTimeDly's.


I will include the code for Keypad_Init, hopefully someone who is familiar with uCos can help me.


    void KeyInit(void){   
     OS_ERR err;   
     OS_TCB UcosKey_KeyTask_TCB;   
     Keypad_Write(0x00);    /* Preset all rows to zero    */   
        OSSemCreate(&Key.flag,"Flag Semaphore",0,&err);   
     OSTaskCreate((OS_TCB      *)&UcosKey_KeyTask_TCB,   
               (CPU_CHAR    *)"Scan Keypad",   
                     (OS_TASK_PTR  )KeyTask,    
                     (void        *)0,   
                     (OS_PRIO      )KEYTASK_PRIO,   
                     (CPU_STK     *)&KeyTaskStk[0],   
                     (CPU_STK_SIZE )KEY_STK_SIZE_LIMIT,   
                     (CPU_STK_SIZE )KEY_STK_SIZE,   
                     (OS_MSG_QTY   )0u,   
                     (OS_TICK      )0u,   
                     (void        *)0,   
                     (OS_OPT       )(OS_OPT_TASK_NONE),   
                     (OS_ERR      *)&err);   
     if(err != OS_ERR_NONE){   
     LCD_Disp_PrintString("ERR IN KEYINIT");   
    Thank you.   
3 Replies
Not applicable

I see the "KeyTask" being created within KeyInit function. Can you try moving this to the main function where Start task(priority-2) is created and before OSStart is called?.


Are you using the micrium port for CY8CKIT-001?. Did you need to make any changes to the code to work on the developer challenge kit(new one)?.


FYI, I am not using uCOS-III at this moment but planning to integrate my standalone code to it some time.



Not applicable

Also try declaring Key Task TCB(UcosKey_KeyTask_TCB) as Global and Static...

Not applicable

 Sorry to bring up an old thread but I felt obliged to at least give some form of follup.


It turned out that using an unregistered version of keil was my main problem (I think), somehow files stopped linking correctly after reimplementing things from my home computer everything finally started moving along.


I was able to implement a keypad, clock, and a basic texter program (for a class), and now that spring break has arrived I look forward to digging in my heels and getting communication going  between the VS1053 mp3 decoder and the Wifly GSX using queues.  Hopefully I'll have something to show before the deadline.