Altera_Forum
Honored Contributor
20 years agoalways waiting for "heapsem"
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