try to get ITM_SendChar() working on Nucleo-32 stm32f303K8, no luck, need some help

Thread Starter

bug13

Joined Feb 13, 2012
1,708
Hi team

I am playing around with a STM32 again, and today I want to learn sending some debug info with ITM_SendChar(), but I don't see anything from my SWV console windows.

The board I am using is Nucleo-32 STM32F303K8T6 (link)

Here are my settings:

debugger.PNG
SWV.PNG

Here are my test code:

Code:
  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
    /* USER CODE END WHILE */

    /* USER CODE BEGIN 3 */

      HAL_GPIO_WritePin(LED0_GPIO_Port, LED0_Pin, GPIO_PIN_RESET);
      HAL_Delay(500);
      HAL_GPIO_WritePin(LED0_GPIO_Port, LED0_Pin, GPIO_PIN_SET);
      HAL_Delay(500);
      ITM_SendChar(55);
  }
  /* USER CODE END 3 */
Everything else is default, my LED can blink properly, but no output from SWV console, what have I done wrong?

I am using STM32CubeIDE v1.1
 

Thread Starter

bug13

Joined Feb 13, 2012
1,708
Found the solution from the forum from ST. Link here.

In short, I need to connect PB3 (trace swo pin) of the MCU to the SWO input of the built in ST-LINK debugger (of the Nucleo-32 board)

Make you wonder why ST didn't route this very important debug pin to the built in ST-LINK debugger when they design the board... the PB3 actually doesn't route to anything at all.
 
Top