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++

always waiting for "heapsem"

Altera_Forum
Honored Contributor II
934 Views

Hi, 

In my uC/OS project, I have the following task. In this task , I try to allocate a heap by using memalign function.  

void ButtonLed1(void) 

OS_STK * task5_stk = (OS_STK *)memalign(TASK_STACKSIZE*sizeof(OS_STK)); 

while(1) 

if(led_button_status & 0x01)  

led_button_status &= 0xFE; 

bLedStatus = 0; 

IOWR_ALTERA_AVALON_PIO_DATA(LED_PIO_BASE,bLedStatus);  

}  

OSTimeDlyHMSM(0, 0, 1, 0); 

 

But I failed. It stopped at the following position. 

/* wait on the other task to yield the heap, then claim ownership of it */ 

OSSemPend( alt_heapsem, 0, &err ); 

 

I'm sure that I didn't call any function to allocate heap in other tasks. So why it always be waiting heapsem? 

 

Could anyone help? 

 

Thanks in advance, 

David
0 Kudos
0 Replies
Reply