STM8 uses printf instead of uart method

Publisher:ShuangfeiLatest update time:2016-08-08 Source: eefocusKeywords:STM8  printf Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Add in the program: (the header file needs to add #include

#ifdef __GNUC__ 
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch) 
#else 
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f) 
#endif  
PUTCHAR_PROTOTYPE 

//Send data code
return ch; 

 

The message identifier "FILE" is undefined appears. In the project options, select the following:

 

You need to set the function library in IAR's Options -> General Options -> Library Configuration, otherwise the printf function will be incorrect. Just change the Library setting in Library Configuration from "Normal" to "Full".

Keywords:STM8  printf Reference address:STM8 uses printf instead of uart method

Previous article:Specify the start address of compilation in IAR for stm8
Next article:STM8 automatic wake-up AWU

Recommended ReadingLatest update time:2024-11-23 08:37

stm8 clock output pin
The CLK_CCO pin is the clock output pin of STM8. If this pin is set to output the master clock Fmaster, the clock output register can be operated as follows CLK- CCOR=0X19;
[Microcontroller]
Check microlib in keil to use printf
When building an ARM project in Keil (I use realview mdk3.11) One of them is to select use MicroLIB Since I am not very familiar with KEIL, I checked it and got the following information: microlib is an alternative to the default C library. It is intended for use with deeply embedded applications that need to fit in
[Microcontroller]
STM8 IAR new register project
. 2. 3. 4. Add header file directory Convert to relative directory 5. Set the output file directory 6. Set up simulation tools
[Microcontroller]
STM8 IAR new register project
IAR for STM8 Errors
An IAR for STM8 v1.3 project has the following error after switching to version 1.4 unable to allocate space for sections/blocks with a total estimated minimum size of 0x2341 bytes in (total uncommitted space 0x1f80). Found the following article on the Internet, and in the project options, change the "Printf formatt
[Microcontroller]
IAR for STM8 Errors
STM8 learning summary three: TIM1 timer usage
This article mainly summarizes the meaning of each statement when developing library functions of STM8. (1) TIM1 initialization configuration function The main function of the function is to set the parameters and working mode of the counter and enable it; void Tim1_Init(void) {   TIM1_TimeBaseInit(16,TIM1_COUNTER
[Microcontroller]
How to view the size of flash and RAM occupied by the program in IAR for STM8
STM8s103F is an MCU used by the author. Due to the limitation of program code and MCU resources, it is necessary to understand the situation of MCU resources occupied by the implemented program code. Many links on the Internet do not explain it clearly, so I will sort it out here. Resources for STM8s103F Checking th
[Microcontroller]
How to view the size of flash and RAM occupied by the program in IAR for STM8
Five working modes of STM8 ADC
Five working modes of STM8 ADC The ADC of STM8 is a 10-bit successive approximation analog-to-digital converter with up to 16 multifunctional input channels. It has 5 conversion modes and can generate an interrupt when the conversion is completed. The initialization sequence of the STM8 ADC is as follows: 1. The
[Microcontroller]
STM32 uses printf in keil environment
1. First you need to set up Keil ! (https://img-blog.csdn.net/20180509170628341?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dhbmd6aGltaW5fMDcwMg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70) 2. Add header files 3. Add two sections of code to the code Add the first code: #ifdef __GNUC__     #defi
[Microcontroller]
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号