Skip to main content
User_bug13
Associate II
Nov 17, 2019 4:11 AM UTC
Solved

debuging with ITM, nucleo-32 STM32F303K8, can't make it to work

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:

0690X00000As6ytQAB.png

0690X00000As6yyQAB.png

This topic has been closed for replies.
Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Nov 17, 2019 5:32 AM UTC

>>What have I done wrong, or not done??

Have you wired PB3 pin to SWO input?

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..

6 replies

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Nov 17, 2019 5:32 AM UTC

>>What have I done wrong, or not done??

Have you wired PB3 pin to SWO input?

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
User_bug13
Associate II
Nov 17, 2019 7:49 PM UTC

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.

User_bug13
Associate II
Nov 17, 2019 7:20 AM UTC

That might be it, I can't test it today, but I will test it tomorrow. Thanks for your reply!

Pavel A.
Nov 17, 2019 8:32 PM UTC

> // 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

User_bug13
Associate II
Nov 17, 2019 9:22 PM UTC

Thanks for the suggestion, looks like another trap for young player!

Pavel A.
Nov 17, 2019 11:03 PM UTC

For old too ;)

-- pa