Skip to main content
Xxoyo.1
Associate III
March 4, 2021
Question

How to redirect std::cout to ITM port 0

  • March 4, 2021
  • 0 replies
  • 785 views

Hi everyone, I have successfully used the following code to redirect the printf output to SWD, ITM View

/* USER CODE BEGIN 4 */
int __io_putchar(int ch) {
 ITM_SendChar(ch);
 return ch;
}
/* USER CODE END 4 */

Now I am working with C++ and would like to use redirect the outputs

example

 std::cout << "Hello world" << std::endl ;

How to achieve this? Thanks!

    This topic has been closed for replies.