Using FreeRTOS with Atmel Studios and Arduino Due board

I have been attempting to use the FreeRTOS with Atmel Studios now Microchip Studios and have made some progress. However, it will not successfully compile once I try and insert a task. I am using the ASF and installed the FreeRTOS 10.0.0. I have found a document atmel-42622-getting started with freertos and it gives good examples. Need help just getting it going.

You said it didn’t compile, but didn’t post the compiler error message, so I’m not sure what to suggest.

Thanks so much for responding.

The folder structure seems to be fine. I used the ASF to add the FreeRtos.

#include <asf.h>

xTaskHandle worker1_id;
static void worker1_task(void *pvParameters)
{
	for(;;)
	{
		/* task application*/
	}
	/* Should never go there */
	vTaskDelete(NULL);
}


int main (void)
{
	/* Insert system clock initialization code here (sysclk_init()). */
    sysclk_init();
    board_init();

	/* Insert application code here, after the board has been initialized. */

    xTaskCreate(worker1_task,"Worker 1",configMINIMAL_STACK_SIZE,NULL, 2,& worker1_id);

    vTaskStartScheduler();



   while (1)
   {
   }


}

Very simple code, I copied and pasted from the atmel document and it will compile without errors until I add the create task function.

Functions that start “Application” have to be provided by the application writer, or alternatively, you need to disable the feature in FreeRTOSConfig.h (the same link tells you how to do that).

Thanks again. I set the hook config lines to 0, then I got a stack over flow error but went back to the config files and set the stack over flow to 0 as well. It appears to be working so far at least compiling with no errors.

? If you are getting stack overflows you need to increase the stack size. Turning the warnings off doesn’t stop the stack overflowing.

The error was a stack hook overflow but turning off the stack overflow got rid of the compile error.

Ah. That makes sense, although it’s best to keep stack overflow detection set to 2 and configASSERT() defined during development. That will help catch a lot of issues, then once everything is good, you can turn them off before going into production.

Thanks so much for the help. I’ve been using AVR for years and trying to move up to the ARM in particular the Sam series so I figured I would tackle both it and the RTOS at the same time.