EasyManuals Logo

STMicroelectronics STM32 User Manual

STMicroelectronics STM32
118 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #70 background imageLoading...
Page #70 background image
Printf debugging AN4989
70/118 AN4989 Rev 3
Figure 49. USART2 setting with STM32CubeMX
Retargeting printf to UART depends on the toolchain.
For IAR™ EWARM and Keil
®
MDK-Arm µVISION this is done by overriding the stdio fputc
function
#include "stdio.h"
int fputc(int ch, FILE *f)
{
HAL_UART_Transmit(&UartHandle, (uint8_t *)&ch, 1, 0xFFFF);
return ch;
}
For GCC based toolset like STM32CubeIDE, two cases can be met.
With syscall.c integrated to the project:
#include "stdio.h"
int __io_putchar(int ch)
{

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the STMicroelectronics STM32 and is the answer not in the manual?

STMicroelectronics STM32 Specifications

General IconGeneral
BrandSTMicroelectronics
ModelSTM32
CategoryMicrocontrollers
LanguageEnglish

Related product manuals