Here, no output is observed while debugging the program. I’m a beginner at FreeRTOS and hence don’t know much about how to write the codes. Please help me resolve this issue. Also, xTaskCreate() isn’t supported by my platform so that doesn’t work.
Are you giving the same stack and task buffer to 2 tasks ? That can’t work.
Each task needs is OWN stack and task buffer, of course.
And depending on printfNexys implementation the stack might be too small because printf family functions are often stack hungry.
You really should define configASSERT and also enable stack overflow checking for development/debugging. It’s very helpful !
But I’m still observing the same thing. No output of printf is observed. I set the breakpoint to the printfNexys() function also. But it didn’t go to that point. Also, as I am a beginner in this, I’m unable to understand configASSERT and stack overflow checking. Could you tell the exact changes I would have to make ?
There is a FreeRTOS FAQ with helpful hints and also a FreeRTOS - Quick start guide.
Maybe there is a FreeRTOS demo matching or similar to your MCU to look up or try.
From the image you posted, it seems that you are able to set breakpoints. Change the definition of the main to the following and put a breakpoint on the infinite loop (this will tell us if the scheduler started successfully or not):
int main(void)
{
xTaskCreateStatic(vTask1, "Task 1", STACK_SIZE, (void *) 1, 1, xStack, &xTaskBuffer);
vTaskStartScheduler();
/* Set a breakpoint on the next line. */
for( ;; );
return 0;
}
Put a breakpoint on the first line of the vTask1 to see if the task is starting. When you do not see any output, break in the debugger and post the call-stack. Share your FreeRTOSConfig.h too.