STM32H7 + FreeRTOS: Newlib (sprintf) functions work only on every alternate task and it fails in rest of the tasks
Hello Members
I am facing an issue while using standard library functions such as sprintf() on STM32H7 & Free RTOS platform (newlib)
IDE- Atollic true studio 9.3.0
RTOS: Free RTOS + heap_5
Controller : STM32H743XX
I have configured FreeRTOS to enable newlib re-entrant functionality (configUSE_NEWLIB_REENTRANT == 1) and configured atollic true studio project setting to use newlib standard library. I have created 8 tasks one after another with each stack size set to 2048. Only simple sprintf functionality is executed in all tasks.
Task code
void Task1(void const * argument)
{
volatile float TestVar = 2.5;
volatile char TestBuffer[25];
while(1)
{
memset(TestBuffer, 0x00, sizeof(TestBuffer));
sprintf(TestBuffer, "%6.2f", TestVar);
osDelay(1000);
}
}
Issue
sprintf functionality with float option works on every alternate task. other tasks it simply fails and formatted TestBuffer shows 0 instead of "2.5"
I am not sure where it's going wrong? and why this issue appears only on alternate tasks
I appreciate your comment or suggestions?
regards
Dhanya
