If you are using MDK, please check "Use MicroLIB" in "Target"->"Code Generation" in the project properties.
After making the above settings and compiling, the serial port should output the correct data.
#ifndef __UART_INTERFACE_H
#define __UART_INTEFFACE_H
#include "stm32f10x_lib.h"
#include "stdio.h"
void UART_Init(unsigned long UART_baud); //Baud rate, such as 115200
int fputc(int ch, FILE *f);
int fgetc(FILE *f); //fgetc redirection
#endif
The following is part of the .C code, omitting the initialization part. I wrote it by myself.
int fputc(int ch, FILE *f)
{
}
int fgetc(FILE *f)
{
}
Previous article:How to use printf() function in STM32
Next article:GPIO Operation
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Technical Article: Optimizing 48V Mild Hybrid Electric Vehicle Motor Drive Design
- DIY an STLink V2.1
- GaN and application understanding
- How to lay digital and analog floors?
- The entire process of R&D and production of a chip
- Use the microcontroller DAC to output analog voltage and control the output voltage of the DC-DC circuit so that Vout=2*Vset. Please help me design the circuit
- Summary of DSP2000 serial port programming operation
- "Playing with the Board" + Replaying MicroPython on the STM32F7DISC (4)
- [AT32WB415 Review] Part 3 The general process and %1U of BLE routines
- MicroPython supports mapping ESP8266's UART to GPIO13/15