# warning:- unused parameters pvparameters

**URL:** <https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982>\
**Category:** Kernel\
**Created:** [July 25, 2019, 12:57pm UTC](https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982 "2019-07-25T12:57:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 25, 2019, 12:57pm UTC](https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982/1 "2019-07-25T12:57:31Z")

</div>

**[deepakseshan](https://sourceforge.net/u/deepakseshan/)** wrote on [Thursday, July 25, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/379656675c/#f54c):

Hello Developers, i am trying to run FreeRTOS with Infineon Triboard. I have endedup with an warning “unused parameter’pvParameters”. I found this warning is from a function “task.h” file  
#define xTaskCreate( pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask ) xTaskGenericCreate( ( pvTaskCode ), ( pcName ), ( usStackDepth ), ( pvParameters ), ( uxPriority ), ( pxCreatedTask ), ( NULL ), ( NULL ) )  
Please cany anyone help me in this regards by saying why this warning appears as I am new to RTOS AS WELL.

MANY THANKS TO EVERONE IN ADVANCE

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 25, 2019, 1:00pm UTC](https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982/2 "2019-07-25T13:00:17Z")

</div>

**[deepakseshan](https://sourceforge.net/u/deepakseshan/)** wrote on [Thursday, July 25, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/379656675c/#48ee):

Foolowing the above query, the above mention function “xTaskCreate()” is throwing an another warning “pointer targets in passing argument 2 of xTask GeneriCreate differ in signdness\*\*”

Many Thanks

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [July 25, 2019, 2:29pm UTC](https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982/3 "2019-07-25T14:29:08Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Thursday, July 25, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/379656675c/#48ee/5378):

Tasks have the following prototype:

void vTaskFunction( void \*pvParameters )  
{  
}

If you do not use the parameter passed in then you will get the warning  
“unused parameter”. To silence the warning simply use the parameter in  
a benign way, such as adding:

( void ) pvParameters;

into the task body.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 25, 2019, 3:08pm UTC](https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982/4 "2019-07-25T15:08:45Z")

</div>

**[deepakseshan](https://sourceforge.net/u/deepakseshan/)** wrote on [Thursday, July 25, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/379656675c/#f562):

Hello Richard, i trust you are doing well, thank you very much for the response and very much apprieciated, It indeed sorted the problem. I am new to RTOS so struggling to find out some answers for the errors and warning. Because FreeRTOS is the basement to bag a huge project from my company.

i have some warnings listed below, if possible can you shed some of your knowledge please,

1)\*\* “pointer targets in passing argument 2 of 'xTaskGenericCreate’differ in signedness [-Wpointer-sign]” for the macro. i have attached the macro.\*\*

1. initialization makes integer from pointer without a cast  
unsigned int intstack = &\_\_ISTACK; (what is wrong in this initialisation ?)

Kindly help me in this regard

thank you very much in advance,

Regards,  
Deepak

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [July 25, 2019, 3:16pm UTC](https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982/5 "2019-07-25T15:16:21Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Thursday, July 25, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/379656675c/#f562/9ed4):

These are really C questions, rather than FreeRTOS specific questions.

> 1)_“pointer targets in passing argument 2 of 'xTaskGenericCreate’differ  
> in signedness [-Wpointer-sign]” for the macro. i have attached the macro._

Argument 2 is a char\* (string) so I’m going to guess your compiler is  
set to treat all ‘char’ as ‘unsigned char’ hence you get an ‘unsigned  
char \*’ where you expect a ‘char \*’ - or the other way around.

Which version of FreeRTOS are you using? Some really, really old  
versions used to have specific types here, but now it is just plain old  
‘char \*’ so there is something odd with the compiler command line.

> 1. initialization makes integer from pointer without a cast  
> unsigned int intstack = &\_\_ISTACK; (what is wrong in this initialisation ?)

Well I don’t know how \_\_ISTACK is defined, but if you are taking the  
address of it, then you are left with a pointer. You are then assigning  
that pointer to an unsigned int. So, as per the warning, you are  
creating an unsigned int from an address (pointer). You can cast the  
address to an unsigned int, if you are 100% sure it is valid to do so  
(width of address will always fit in an unsigned int).

unsigned int intstack = (unsigned int) &\_\_ISTACK;

again though - these are not FreeRTOS questions.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 25, 2019, 3:34pm UTC](https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982/6 "2019-07-25T15:34:41Z")

</div>

**[deepakseshan](https://sourceforge.net/u/deepakseshan/)** wrote on [Thursday, July 25, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/379656675c/#5ae4):

Hello Richard,  
Kindly accept my apology for these kind of questions. I realised it after i send you the request and I kindly make sure it will not repeated again.  
i am using Infineon TC277 microcontroller (Infineon Triboard) for our Research Project. I use Eclipse IDE with GCC compiler.  
I managed to get **FreeRTOS (v7.1.0**) files for this microcontroller from Infineon.  
I am planning to update the RTOS files with the latest version.

\*\*if i update the FreeRTOS files to latest version, Does it impact the existing Task body and functions which is supported by version 7.1?  
\*\*  
Thank you very much for the support.

Regards,  
Deepak

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [July 25, 2019, 4:27pm UTC](https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982/7 "2019-07-25T16:27:40Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Thursday, July 25, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/379656675c/#5ae4/3d08):

> \*if i update the FreeRTOS files to latest version, Does it impact the  
> existing Task body and functions which is supported by version 7.1?  
> \*

I don’t think so. 7.1 is very old though, I think there are some  
behavioral differences with things like how priority inheritance works,  
which in turn imposes more restrictions on how mutexes can be used from  
interrupts, etc.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 26, 2019, 6:32am UTC](https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982/8 "2019-07-26T06:32:13Z")

</div>

**[deepakseshan](https://sourceforge.net/u/deepakseshan/)** wrote on [Friday, July 26, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/379656675c/#6945):

Thank you very much for your comments Richard, i will try and update it and come back to you if I found something i struggle with.

Thank you again for your invaluable support.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 29, 2019, 4:08pm UTC](https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982/9 "2019-07-29T16:08:36Z")

</div>

**[deepakseshan](https://sourceforge.net/u/deepakseshan/)** wrote on [Monday, July 29, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/379656675c/#2d18):

Hello,  
i am trying to run a Task and my target boad is Triboard TC277. It is a tricore mcrocontroller,  
**The below is my task body,**  
void vLEDon\_Task (void \*pvParameters)  
{  
(void) pvParameters;  
for(;😉  
{  
InitLED();  
}  
}  
**Create task API**  
xTaskCreate( vLEDon\_Task, “LED ON”, 128, NULL, LED\_ON\_TASK\_PRIORITY, NULL );

Every time it hits the “InitLED();” function but i cannot see any physical LEDs coming ON in the target board. Am i doing something wrong in the Task body. It is given higher priority.

Note:-The led works fine as I saw it at the time of LED initialisation.

Please help me in this regard.

Regards,  
Deepak

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [July 29, 2019, 4:18pm UTC](https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982/10 "2019-07-29T16:18:39Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Monday, July 29, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/379656675c/#2d18/bab3):

Can you walk us through what you expect this code to do - thanks.

---

<div class="post-metadata">

**Author:** ![richard-damon](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/richard-damon/32/38_2.png) [@richard-damon](https://forums.freertos.org/u/richard-damon)\
**Post date:** [July 29, 2019, 4:32pm UTC](https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982/11 "2019-07-29T16:32:45Z")

</div>

**[richard\_damon](https://sourceforge.net/u/richard_damon/)** wrote on [Monday, July 29, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/379656675c/#3112):

Do you REALLY want to keep initializing the LED. (its in the loop). You likely also want the task to block or delay on something or it will just keep on running and keep other tasks from running.

Even a vTaskDelay(1) might help.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [July 29, 2019, 4:47pm UTC](https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982/12 "2019-07-29T16:47:02Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Monday, July 29, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/379656675c/#3112/5a32):

Best they describe what the expected behaviour is as it is not clear  
what InitLED is doing, or why calling it in a tight loop would behave  
differently when it is done in a task compared to just from main()  
before the scheduler has started.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 29, 2019, 5:27pm UTC](https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982/13 "2019-07-29T17:27:30Z")

</div>

**[deepakseshan](https://sourceforge.net/u/deepakseshan/)** wrote on [Monday, July 29, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/379656675c/#06a6):

hello Richard and Richard,  
Thank you very much for the reply,

1. I am trying to toggle LED’s from the target Board. Before making the toggle function I first wanted to acheive to switch the LEDs ON using the Task body function.
2. I am to switch on two different LEDs use two task function.
3. I will attach the source file with comments on it.
4. the InitLED is the functionjust turn on the leds.

Attachment

1. main0.c - please look from line 76
2. led.h - declaration of LED function

Please help me as where I am going wrong and how to flash a LED, Am ! missing some logic here?

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 29, 2019, 5:29pm UTC](https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982/14 "2019-07-29T17:29:27Z")

</div>

**[deepakseshan](https://sourceforge.net/u/deepakseshan/)** wrote on [Monday, July 29, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/379656675c/#16c7):

this is led.h which defines the function of LED for Infineon microcontroller.

Kindly help me in this regard on how to flash the led using task functions.

Regards,  
Deepak

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 1, 2019, 8:45am UTC](https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982/15 "2019-08-01T08:45:43Z")

</div>

**[deepakseshan](https://sourceforge.net/u/deepakseshan/)** wrote on [Thursday, August 01, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/379656675c/#d5f2):

Hello Richard,  
Please can you shed some light on the above question. Kindly do not hesitate to ask me for more infomation.  
Kindly help me in this regard.  
Thank you very much in avance.  
Deepak

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 5, 2019, 3:14pm UTC](https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982/16 "2019-08-05T15:14:14Z")

</div>

**[deepakseshan](https://sourceforge.net/u/deepakseshan/)** wrote on [Monday, August 05, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/379656675c/#5d6b):

Hello Guys,  
Kindly reply , Have I given a confused you with the questions. Please shed some light on the topic.  
i am trying to run a Task and my target boad is Triboard TC277. It is a tricore mcrocontroller,  
The below is my task body,  
void vLEDon\_Task (void \*pvParameters)  
{  
(void) pvParameters;  
for(;😉  
{  
InitLED();  
}  
}  
Create task API  
xTaskCreate( vLEDon\_Task, “LED ON”, 128, NULL, LED\_ON\_TASK\_PRIORITY, NULL );

Every time it hits the “InitLED();” function but i cannot see any physical LEDs coming ON in the target board. Am i doing something wrong in the Task body. It is given higher priority.

Note:-The led works fine as I saw it at the time of LED initialisation.

Thank you in advance,

Kind Regards,  
Deepak

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [August 5, 2019, 3:59pm UTC](https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982/17 "2019-08-05T15:59:41Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Monday, August 05, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/379656675c/#5d6b/5e46):

My answer is as per before really - if you sit in a tight loop  
repeatedly initialising the LED, what do you expect to happen? If you  
believe continuously initialising and re-initialising the LED will  
result in the LED being turned on, then how does the behaviour differ  
when you do this from inside a task compared to when you do it from  
main() (without the scheduler running). Is there a function to turn the  
LED on that you could just call once?

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 5, 2019, 4:46pm UTC](https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982/18 "2019-08-05T16:46:20Z")

</div>

**[deepakseshan](https://sourceforge.net/u/deepakseshan/)** wrote on [Monday, August 05, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/379656675c/#4962):

hello richard, thank you very much for replying.

1. Yes there are functions to turn ON and Clear the LEDs. (**LED\_on()** and **ClearLED()**) in **led.h** file
2. Yes, you are right, I Initialise the LED and clear the LED in main function.
3. When I try to implement the LED\_ON() function inside the task it is not switicng ON the LED. Atleast in a tight loop the LED should be constantly switched On but in my task it is not switching ON the LED.  
void vLEDon\_Task (void \*pvParameters)  
{  
(void) pvParameters;  
for(;😉  
{  
InitLED(); // it will switch On or turn ON four LEDs  
}  
}

Deepak

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [August 5, 2019, 4:56pm UTC](https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982/19 "2019-08-05T16:56:40Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Monday, August 05, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/379656675c/#4962/f191):

Can you show the code of initLED()?

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 5, 2019, 5:06pm UTC](https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982/20 "2019-08-05T17:06:17Z")

</div>

**[deepakseshan](https://sourceforge.net/u/deepakseshan/)** wrote on [Monday, August 05, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/379656675c/#8ab7):

Please have a look at the attached file for led.h.

[Next page](https://forums.freertos.org/t/warning-unused-parameters-pvparameters/7982.md?page=2)
