cancel
Showing results for 
Search instead for 
Did you mean: 

STM32cubeIDE stm32wb55 printf to console

LPetr.1
Senior

Hello. I programming STM32WB55 nucleo device and trying to setup printf for debugging. I have no luck so far setting it up. I have tried replacing _write in syscals.c with

__attribute__((weak)) int _write(int file, char *ptr, int len)

{

int DataIdx;

for (DataIdx = 0; DataIdx < len; DataIdx++)

{

ITM_SendChar( *ptr++ );

}

return len;

} But with no luck yet. The error returned:

Undefined reference to "ITM_SendChar"

I believe the wb55 does not support ITM right? Is there any other way to achieve printf to console in cubeIDE?

1 REPLY 1
Markus GIRDLAND
ST Employee

There are a few ways to achieve printf redirection.

We have a chapter in our user manual about this specific topic, chapter 2.6.1.

You can find the user manual here and if you have any additional questions let me know!