warning:- unused parameters pvparameters

deepakseshan wrote on Thursday, July 25, 2019:

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

deepakseshan wrote on Thursday, July 25, 2019:

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

rtel wrote on Thursday, July 25, 2019:

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.

deepakseshan wrote on Thursday, July 25, 2019:

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

rtel wrote on Thursday, July 25, 2019:

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.

deepakseshan wrote on Thursday, July 25, 2019:

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

rtel wrote on Thursday, July 25, 2019:

*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.

deepakseshan wrote on Friday, July 26, 2019:

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.

deepakseshan wrote on Monday, July 29, 2019:

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(;:wink:
{
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

rtel wrote on Monday, July 29, 2019:

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

richard_damon wrote on Monday, July 29, 2019:

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.

rtel wrote on Monday, July 29, 2019:

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.

deepakseshan wrote on Monday, July 29, 2019:

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?

deepakseshan wrote on Monday, July 29, 2019:

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

deepakseshan wrote on Thursday, August 01, 2019:

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

deepakseshan wrote on Monday, August 05, 2019:

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(;:wink:
{
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

rtel wrote on Monday, August 05, 2019:

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?

deepakseshan wrote on Monday, August 05, 2019:

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(;:wink:
    {
    InitLED(); // it will switch On or turn ON four LEDs
    }
    }

Deepak

rtel wrote on Monday, August 05, 2019:

Can you show the code of initLED()?

deepakseshan wrote on Monday, August 05, 2019:

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