Recieve Error when Using vTaskSetApplicationTaskTag

I am new user of FreeRTOS, so may be my question can stupid, sorry!
I have try to use vTaskSetApplicationTaskTag as a point to control when my task start/stop.

I do use

BaseType_t xReturned_ONE = xTaskCreate(vTaskCode_ONE, “ONE”, 504, NULL, tskIDLE_PRIORITY, NULL );*

to define task, and then in code of task set tag

		vTaskSetApplicationTaskTag( NULL, ( void * ) 1 );

but here I have recieve a warning

warning: #167-D: argument of type “void *” is incompatible with parameter of type “TaskHookFunction_t”

How to patch this or where I do mistake?

Can you elaborate on how you plan to do that and what problem are you trying to solve?

You can avoid that warning by casing the parameter to TaskHookFunction_t instead of void*:

vTaskSetApplicationTaskTag( NULL, ( TaskHookFunction_t ) 1 );

I will mark the start and end of the task time by switching the level on the port. by watching on the logic analyzer i can control the time used by the task

Yes! It is working. Thank you!

Dear Aggard, it is compiled but not work as it neccesary…
Tag is not set in TCB, after
vTaskSetApplicationTaskTag( NULL, ( void * ) 3 );
pxTaskTag still set as zero

What is can be?

I think you try to follow the FreeRTOS trace macros example. Ok.
You should check the return code of xTaskCreate. Maybe the calls failed ?
Also did you enable stack checking and properly defined configASSERT for development ?
I’d recommend to do so.

As suggested by @hs2, you should explore trace macros.

You are looking at an invalid address - see the location of xTCB is 0xA5A5A5A5. What is xTCB?

I do looking TCB at 0xA5A5A5A5

but after vTaskSetApplicationTaskTag( NULL, ( TaskHookFunction_t ) 1 );
it is still zero

You are likely trying to observe a stack variable after the function has returned - which is not valid. Call the xTaskGetApplicationTaskTag and check the return value.