cancel
Showing results for 
Search instead for 
Did you mean: 

Blue and Black Pill SWO debugging

mkigor
Associate II

Split from STM32H5 SWO debugging.


I want use SWO pin like standalone debug. Send data by "ITM_SendChar('A');" and want to read data from SWO pin by USB-UART dongle, SWO pin => Rx pin UART-USB on PC.

I try blue and black pill (STM32F103 and STM32F411), in stm32 cube ide I configured SysremCore->SYS->Debug: Trace Asynchronus Sw. In "Debug configuration" is Enable for SWV and clock core 8Mhz (SYSCLK and HCLK = 8MHz).

In main sycle:

  while (1)
  {
    /* USER CODE END WHILE */
	  HAL_GPIO_TogglePin(Led_GPIO_Port, Led_Pin);
	  HAL_Delay(1000);
	for (int i = 0; i < 10000; ++i) ITM_SendChar('A');
	  HAL_GPIO_TogglePin(Led_GPIO_Port, Led_Pin);
	  HAL_Delay(1000);
    /* USER CODE BEGIN 3 */
  }

LED is blinking, but SWO pin out is NO SIGNAL (Checking by oscillograph).
Where is it possible problem?

13 REPLIES 13

>Can anyone help me find something? Thanks in advance.

As the debug unit is created by Arm ....look there.

@Andrew Neil  posted the link...

 

https://developer.arm.com/documentation/ddi0314/h/Serial-Wire-Output/SWO-trace-port/Physical-pin-protocol#:~:text=Manchester%20encoding%20example-,UART%20encoding,bit%20%5B11%5D%20of%20the%20Device%20ID%20Register%2C%200xFC8%2C%20is%20set,-.%20It%20is%20enabled

 

 

If you feel a post has answered your question, please click "Accept as Solution".

Thanks. O, mama mia... So many, huge amount stm docs (milion pages) + arm docs in specific "black format" :) It is signalize - even not try to understand me.

This is why ST et al create tools like ST-Link and CubeIDE - so you don't have to wade through all that and do it all yourself...

 

As others have said, for a simple solution - just use a UART

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
mkigor
Associate II

Yea, but idea is good, but maybe "mission impossible". I see info, that it is working, but is no info how to do it. But, it is one more but ... :)
This display terminal working on 3Mbit via UART, it's quite enough for SWO clock:
https://github.com/mkprogigor/mkigor_terminal_p 
https://www.youtube.com/watch?v=TVSalgKr5aE