Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12606 Discussions

Tasks dont resume after preempted

Altera_Forum
Honored Contributor II
1,017 Views

I succesfully compiled microC/OS to be run on an ARM7TDMI processor. I create a task like this one; 

 

void task1(void* pdata) { while (1) { vs_printf("Hello from task1\n"); OSTimeDlyHMSM(0, 0, 0, 5); } } void task2(void* pdata) { while (1) { vs_printf("Hello from task2\n"); //OSTimeDlyHMSM(0, 0, 0, 5); OSTimeDly(3); } } void task3(void* pdata) { while (1) { vs_printf("Hello from task3\n"); OSTimeDlyResume(4); OSTimeDlyHMSM(0, 0, 0, 5); } } int main(void) { CVPTESTPlatform platform; platform.FullPlatformInit(); OSInit(); OSTaskCreate(task1, (void *)0, &task1_stk, TASK1_PRIORITY); OSTaskCreate(task2, (void *)0, &task2_stk, TASK2_PRIORITY); OSTaskCreate(task3, (void *)0, &task3_stk, TASK3_PRIORITY); OSStart(); return 0; }  

 

The output of this code is  

 

Hello from task1 Hello from task2 Hello from task3 Hello from task1  

 

And it stops here. Anyone have any idea on this problem? 

 

Thanks for your time, 

 

Kind regards, 

Fairuz
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
307 Views

This forum is about the uc/OS operating system running on the Nios II platform. You should ask your question to a more generic uc/OS II forum, or an ARM forum... 

 

My guess would be that either vs_printf or the system console driver isn't thread-safe. 

Is there a reason why you use vs_printf instead of the regular printf?
0 Kudos
Reply