FreeRTOS Demo on Microblaze

xilmicro wrote on Monday, July 02, 2007:

Hello,

I’m using the ML403 board from Xilinx and want to run the freertos demo
on the board using the Microblaze, but it does not work.
I have the EDK 9.1 version.
After updating and implementation of the xmp project, I got only some characters and not a repeating string, and the LED aren’t flashing either. Does anybody have an idea want to do.

rtel wrote on Monday, July 02, 2007:

The Microblaze port does work really nicely with the tool version with which it was developed.  New versions of the tools have been released a couple of times since then though, so suspect this is the cause of the problem.  I would suggest stripping down the demo to its minimum to locate the cause of the problem.  Something along the following lines:

1) Write a simple program that does not use FreeRTOS.org to check that the LEDs are working as expected:

void main( void )
{
____for( ;; )
____{
________vParTestToggleLED( n );
____}
}

where ‘n’ is various LED numbers.  Stepping through on the debugger to check the LED toggles (running the program will toggle the LED too quickly to see).

2) Edit main so it starts the LED flash tasks only:

int main (void)
{
____portDISABLE_INTERRUPTS();
____prvSetupHardware();

____vStartLEDFlashTasks( mainLED_TASK_PRIORITY );

____vTaskStartScheduler();

____/* Should not get here as the processor is now under control of the
____scheduler! */

____return 0;
}

3) Set configUSE_PREEMPTION to 0 in FreeRTOS.org and run this edited main().  The LED’s should toggle as described on the FreeRTOS.org documentation page for the Microblaze.

4) Assuming (3) words, set configUSE_PREEMPTION to 1 and try again.

5) Add in the register check and check task tasks to main(), and see if everything still runs as expected.

int main (void)
{
____portDISABLE_INTERRUPTS();
____prvSetupHardware();

____vStartLEDFlashTasks( mainLED_TASK_PRIORITY );
____xTaskCreate( vRegisterTest, "Reg1", mainTINY_STACK, ( void * ) 10, tskIDLE_PRIORITY, NULL );
____xTaskCreate( vRegisterTest, "Reg2", mainTINY_STACK, ( void * ) 20, tskIDLE_PRIORITY, NULL );

    xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );

____vTaskStartScheduler();

____/* Should not get here as the processor is now under control of the
____scheduler! */

____return 0;
}

The register check tasks will only work when using preemption.

See how far you get.

Regards.

xilmicro wrote on Tuesday, July 03, 2007:

Toggling the LED without FreeRTOS is working fine, but the second example is not running. I’ll try to check if starting the LEDFlashTask is OK.

embeddedc wrote on Tuesday, July 03, 2007:

You might also want to just check that the first task is starting.

If you defined a single task that does nothing, eg

void aTask( void * pv )
{
volatile int i;

    for(;:wink:
    {
        i++;
    }
}

Create this task at a priority above the idle priority, and don’t create any other tasks.  Then set a break point on the entry to this task.  After starting the scheduler the break point should be hit.  If not then it does not look like the scheduler is even starting.