How do we create task in free RTOS programming

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

I am trying to understand how do we create task in free rtos programming. The project includes many source files, which file do I have to call if I want to create new tasks? 

 

Atmel Studio 7 

Device: ATmega32A
OS: Window 10

Free RTOS :10.3.0.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

The examples that come with it show this, did you look at those.

EDIT: https://github.com/FreeRTOS/FreeRTOS/tree/master/FreeRTOS/Demo/AVR_ATMega323_WinAVR

Last Edited: Sun. Mar 22, 2020 - 02:54 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
The examples that come with it show this, did you look at those. EDIT: https://github.com/FreeRTOS/Free...

 

Thanks clawson I have looked source code but I don't understand what's happening inside in following function.

 

just making simple If I have two task blink first led and blink second led Now I have to create two task, how to create two task in following function   

short main( void )
{
	prvIncrementResetCount();

	/* Setup the LED's for output. */
	vParTestInitialise();

	/* Create the standard demo tasks. */
	vStartIntegerMathTasks( tskIDLE_PRIORITY );
	vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );
	vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
	vStartRegTestTasks();

	/* Create the tasks defined within this file. */
	xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );

	/* Create the co-routines that flash the LED's. */
	vStartFlashCoRoutines( mainNUM_FLASH_COROUTINES );

	/* In this port, to use preemptive scheduler define configUSE_PREEMPTION
	as 1 in portmacro.h.  To use the cooperative scheduler define
	configUSE_PREEMPTION as 0. */
	vTaskStartScheduler();

	return 0;
}

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Look at the implementation of those vStartXXXtask functions to see what you need to do.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Documentation for the xTaskCreate() function is in the code, in the reference manual, and on the website:  https://www.freertos.org/a00125.html

The website also contains information on the demo projects:  https://www.freertos.org/a00102.html

+ http://www.FreeRTOS.org
The de facto standard, downloaded every 170 second during 2019.

 

 

Last Edited: Mon. Mar 23, 2020 - 05:42 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are also forums specifically for FreeRTOS questions:

 

https://forums.freertos.org/

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...