2019-11-16 08:11 PM
Hi team
I am new to stm32 mcu and trying to debug with ITM here with CubeIDE. But it didn't seem to work for me.
I didn't see anything from the SWV ITM data console output windows, it's properly something really silly I have done or not done.
I am using CubeIDE v1.1, Nucleo-32 F303K8T6 board, so I think it's not the hardware problem.
So I created a new project, enable SWV, set the core clock to 8MHz (which is the default value I get when I setup the new project), enable port 0 on the SWV ITM console windows, start trace. I see nothing.
What have I done wrong, or not done??
Here is my code:
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
// blink led to show my code is running
HAL_GPIO_WritePin(LED0_GPIO_Port, LED0_Pin, GPIO_PIN_SET);
HAL_Delay(100);
HAL_GPIO_WritePin(LED0_GPIO_Port, LED0_Pin, GPIO_PIN_RESET);
HAL_Delay(100);
// just send a char
ITM_SendChar('H');
}
/* USER CODE END 3 */
}
Here are my settings:
Solved! Go to Solution.
2019-11-16 09:32 PM
>>What have I done wrong, or not done??
Have you wired PB3 pin to SWO input?
2019-11-16 09:32 PM
>>What have I done wrong, or not done??
Have you wired PB3 pin to SWO input?
2019-11-16 11:20 PM
That might be it, I can't test it today, but I will test it tomorrow. Thanks for your reply!
2019-11-17 11:49 AM
Thanks @Community member , wiring PB3(trace pin) to SWO input works for me. Trap for young player. Make you wonder why the Nucleo board doesn't do that when they design the board, the PB3 doesn't even route to anything.
Thanks for your help.
2019-11-17 12:32 PM
> // just send a char
> ITM_SendChar('H');
Don't send long strings NOT terminated by \n. Eclipse/Open OCD based debuggers tend to buffer output until \n.
-- pa
2019-11-17 01:22 PM
Thanks for the suggestion, looks like another trap for young player!
2019-11-17 03:03 PM
For old too ;)
-- pa