FreeRTOSV 8.2.3 debugging with Visual Studio issues.

devrules616 wrote on Saturday, March 25, 2017:

Hello guys,
So I am new to RTOS . I tried to start with using the Visual studio IDE to build the project.
I created two tasks with following params.

Task1 name="Task1"Task2 name=“Task2”
Task1 stack size = 1000
Task2 stack size = 100
Task1 priority = 3
Task2 priority = 1
started the scheduler.

Now i put two printf statements in each tasks .to check in console. but none of them show up. Please chek the code below .

//1st task that we have
void vTaskCode1(void * param)
{
while(1)
{
printf(“This is task 1…%d\n”,i+1);
vTaskDelay(100);
}
}

// Create func. for the first task
void vTaskCreate1(void)
{
BaseType_t xReturned;
TaskHandle_t xHandle = NULL;
/* Create the task, storing the handle. /
printf(“about to create task 1…\n”);
xReturned = xTaskCreate(
vTaskCode1, /
Function that implements the task. /
“Task1”, /
Text name for the task. /
1000, /
Stack size in words, not bytes. */
(int )1, / Parameter passed into the task. /
3, /
Priority at which the task is created. /
&xHandle); /
Used to pass out the created task’s handle. */

if (xReturned == pdPASS)
{
	/* The task was created.  Use the task's handle to delete the task. */
	vTaskDelete(xHandle);
}

}

void main()
{
prvInitialiseHeap();
vTraceInitTraceData();
xTickTraceUserEvent = xTraceOpenLabel(“tick”);

vTaskCreate1();
vTaskCreate2();

vTaskStartScheduler();
}

Any help or suggestion is really welcome. Thank You

heinbali01 wrote on Saturday, March 25, 2017:

Without having read the entire code…:

within a Windows FreeRTOS project, you can not make a call to printf() or any other system API.
If you want to send out logging, please refer to the module demo_logging.c and its function vLoggingPrintf().