Skip to main content
LPetr.1
Senior
Jun 17, 2021 12:24 PM UTC
Question

STM32cubeIDE stm32wb55 printf to console

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?

This topic has been closed for replies.

1 reply

Markus GIRDLAND
ST Employee
Jun 18, 2021 10:03 AM UTC

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!