Issue with FreeRTOS, printf and vTaskSuspend
Posted: Thu Jul 02, 2020 5:03 pm
Hello everybody
I am getting started with FreeRTOS and for my firs try (following the pdf "Mastering FreeRTOS") I made a task which displays a string on the monitor. Since I did not found the vPrintString() int he ESP32 port, I wrote :
But with these lines, the ESP32 was always rebooting .... Then I suppressed lines (1) and (2) and all worked fine.
By reading the pdf "mastering FreeRTOS" I think that it is not good to suppress these lines, and I am wondering
I am getting started with FreeRTOS and for my firs try (following the pdf "Mastering FreeRTOS") I made a task which displays a string on the monitor. Since I did not found the vPrintString() int he ESP32 port, I wrote :
Code: Select all
void vPrintString( const char *pcString ){
vTaskSuspendAll(); // (1)
printf( "%s", pcString );
fflush( stdout );
}
xTaskResumeAll(); // (2)
}
By reading the pdf "mastering FreeRTOS" I think that it is not good to suppress these lines, and I am wondering
- if I can use such a function vPrintString without vTaskSuspendAl()
- or if I must use another function different from printf to output messages on the monitor.