Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

Few FreeRTOS related questions (basics)

Posted by re-play on July 30, 2014

Morning all,

first of all, I'm a FreeRTOS newbie so please do take that into account when looking at my questions that might appear too basic to some of you. I got those questions while studying different kinds of FreeRTOS examples code that I've used for learning on my STM32 Cortex ARM board kit. My questions are as follows:

1.) Is it absolutely necessary to declare my tasks (at the top of main.c) and what's the reason for doing it?

2.) What's the difference between using (void * p) and (void * pvParameters) when writing my tasks and how do I know when to use it? I've seen both cases in many examples I've checked.

3.) How do I know when to use "prv" (private) or "v" (void) as a part of my tasks' names? For example, one of my task is flashing LEDs - should my name it "taskLED" or "vtaskLED" or "prvtaskLED"? Is it necessary to use this kind of names at all?

Thank you for any help and guidance.


Few FreeRTOS related questions (basics)

Posted by davedoors on July 30, 2014

1) Tasks can be created at any time before or after the scheduler is running, so not just from main().

2) That is just a function parameter, you can call it whatever you want just like any other function parameter. Other than the name of the parameter the two examples you post are identical. This is just C code.

3) Again this is just C code, and this time that is just the name of the function, you can call it whatever you like just like any other function. By convention FreeRTOS code will prefix file scope functions prv just to denote that the function is private to that file.


Few FreeRTOS related questions (basics)

Posted by re-play on July 30, 2014

I see. So, just to make it sure: is it necessary to always declare my tasks and local functions (prototypes) or not? I've seen this practice in most of FreeRTOS examples code I checked (usually it's right after #include and #define part) and I'm not sure about the reason for doing this. Again, I'm talking about prototypes.

Thanks for your answers, it really helps.


Few FreeRTOS related questions (basics)

Posted by rtel on July 30, 2014

FreeRTOS is just C code, so normal C rules apply (it is after all being compiled with a compiler that just sees text input and knowns nothing about FreeRTOS).

If you declare a function, be it implementing a task or not, then the file in which the function is declared should have a prototype for that function, or must have a function prototype if the function is used before it is declared. Any other file that uses the function must also be able to see the function prototype (normally in a header file) otherwise you will get a compiler error about an undeclared identifier.

Where you put that prototype is entirely up to you within the rules mandated by the C compiler.

Regards.


Few FreeRTOS related questions (basics)

Posted by re-play on July 30, 2014

Oh, I see! Makes more sense now. Thanks for your help.


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner