Senior II
April 12, 2022
Question
STM32CubeIDE 1.9.0 Tracebuffer full!
- 5 replies
- 3019 views
I'm running a debugee (DIYMORE STM32F407VGT6 Board) attached to SWD link adapter of a STM32F407G-DISC1 with onboard MCU disabled.
I'm logging Debug messages from my C-Application using the follwoing code:
while (1)
{
/* USER CODE BEGIN 3 */
pin_state = !pin_state;
HAL_GPIO_WritePin(Led2_GPIO_Port, Led2_Pin, pin_state);
// synchronous delay for 500 ms
HAL_Delay(500);
if(count++ % 10 == 0)
sprintf(buf,"count=%d\n",count),ITM_SendString(buf);
}
/* USER CODE END WHILE */
}
void ITM_SendString(char *str)
{
while(*str){
ITM_SendChar(*str++);
}
}When I run the debug configuration, the trace buffer overflow occurs. It is currently set to 2,000,000. Increasing it to 10,000,000 just makes the overflow happen somewhat later.
OTOH, I'm wondering why such a small debug printf every 5 seconds or so, can cause a buffer overflow.
Core Clock is 168MHz, divider is set to autodetect. I see a value of 86 or so and 2000 KHz max SWO clock.
Any clues why this happens?
