Buffering in SWV ITM Data Console?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-07-04 9:17 PM
I have built a code using the STM32CubeIDE with only 1 task
void StartMyTask(void *argument)
{
/* USER CODE BEGIN 5 */
/* Infinite loop */
char c = 'A';
for(;;)
{
ITM_SendChar(c); //sends the char c to the PC debugging terminal
osDelay(500);
}
/* USER CODE END 5 */
}
When I debug this code, I see "AAAAAA..." in the SWV ITM Data Console; however, they appear in pairs... I've noticed that the pairs appear every 1s, which suggests that the MCU is sending the data at the desired 0.5s interval...
does anyone know if the SWV ITM Data Console does any buffering? Is there any way to configure it so that it updates faster?
- Labels:
-
STM32CubeIDE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-07-04 11:40 PM
This post explains how to turn off the buffering of printf messages. Maybe this will help you:
https://community.st.com/s/question/0D50X0000AuqfAaSQI/how-to-redirect-printf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-07-05 3:18 PM
Hi Rookie38,
Thank you for your response. I tried all 3 options described in the link (sending '\n', using setvbuf, and fflush(stdout)), but still had the same problem. I experimented more with it and I wonder if it is related some configuration of my board NUCLEO-64 STM32L476RG: I increased the osDelay(500) to osDelay(5000) and with this delay, the "A"s appear 5s after each other (i.e, no longer in pairs)...
bjbfj
