Hello,
I have a problem with the embedded program in the NIOS II/f with µCosII system. Could you please help me ?
I have several semaphores but when I initialize more than 5 semaphores with OSemCreate(0) (whatever the semaphores are), the program crashes.
To be more precise some tasks will execute normally whereas some others will stop during execution without reason, far after the OSemCreate call.
For this Reason, I used the semaphores without initialization (directly with OSSemPost and OSSemPend and it worked
But now I want to create a queue and just adding
OS_EVENT* long_commands_event;
makes the program crash the same way
Here is the main program and don't hesitate to ask me other parts.
Thanks a lot,
Sincerely
BDufo
OS_EVENT *m_ETHRxSemaphore;
OS_EVENT *m_ETHTxSemaphore;
OS_EVENT *m_RandomSemaphore;
OS_EVENT *m_dhcpSemaphore;
OS_EVENT *m_AGCSemaphore;
OS_EVENT *m_booting;
OS_EVENT* m_RandomSemaphore;
OS_EVENT* long_commands_event;
/** ... **/
int main(void)
{
OSInit();
m_ETHRxSemaphore = OSSemCreate(0);
m_ETHTxSemaphore = OSSemCreate(0);
m_AGCSemaphore = OSSemCreate(0);
m_booting = OSSemCreate(0);
m_dhcpSemaphore = OSSemCreate(0);
m_RandomSemaphore = OSSemCreate(0);
//long_commands_event = OSQCreate(&long_commands_fifo[0], LONG_COMMANDS_FIFO_SIZE);
/** ...**/
OSTaskCreateExt(TaskStart, NULL, (void*)&TaskStart_stk[START_TASK_SIZE-1], TASK_TaskStart_PRIORITY, TASK_TaskStart_PRIORITY,
(void*)&TaskStart_stk[0], START_TASK_SIZE, &TaskUserData[TASK_TaskStart_ID] , OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);
OSStart();
}
Link Copied
For more complete information about compiler optimizations, see our Optimization Notice.