cancel
Showing results for 
Search instead for 
Did you mean: 

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

User_bug13
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions

>>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
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

6 REPLIES 6

>>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
Up vote any posts that you find helpful, it shows what's working..
User_bug13
Associate II

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

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.

Pavel A.
Evangelist III

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

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

For old too ;)

-- pa