taskYield() hangs - help needed!

downytif wrote on Tuesday, September 29, 2009:

Hi,

I’m trying to make my application work and I encounter issues like this one. First, I’m using FreeRTOS on a AVR32 UC3 chip. I use the Atmel framwork 1.4.

I currenty have 3 task running. The main one, a startup one, the main LWIP one.

I goes like this:

main.cpp

{

    // Start the Startup Task. Done this way to start the scheduler as soon as possible!
    // The reason is simple… The scheduler enables the interrupts (used by the serial communication).
    xTaskCreate(StartupTask, (const signed portCHAR*) "STARTUP_TASK", TASK_STARTUP_STACK_SIZE, (void*)pRadarUnit, TASK_STARTUP_PRIORITY, NULL);

    // Start the OS scheduler. It should never return from there.
    vTaskStartScheduler();

    return 0;
}

So, my main task is starting a STARTUP task that will create and initialize all modules. At this point, my LWIP task is already started. Then, my startup task will try to create another task. The problem I have is that inside

signed portBASE_TYPE xTaskCreate( pdTASK_CODE pvTaskCode, const signed portCHAR * const pcName, unsigned portSHORT usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, xTaskHandle *pxCreatedTask )

the application hangs on taskYIELD(); My RTOS is configured in preemtive mode.

Not sure what to do next… If anyone can help me…
Thanks

rtel wrote on Tuesday, September 29, 2009:

Could you attempt to post the code again?  I need to work out how it is supposed to work, sometimes it seems to format correctly automatically, and other times not.  I suppose I should RTFM.

Regards.

downytif wrote on Wednesday, September 30, 2009:

There you go:

// Start the Startup Task. Done this way to start the scheduler as soon as possible!
    // The reason is simple… The scheduler enables the interrupts (used by the serial communication).
    xTaskCreate(StartupTask, (const signed portCHAR*) "STARTUP_TASK", TASK_STARTUP_STACK_SIZE, (void*)pUnit, TASK_STARTUP_PRIORITY, NULL);

    // Start the OS scheduler. It should never return from there.
    vTaskStartScheduler();

    return 0;