Several common warnings in keil

Publisher:书香墨意Latest update time:2016-09-09 Source: eefocusKeywords:Keil Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
There are several common warnings in Keil. Of course, compared with errors, the degree of warning is not as serious as the error. Sometimes, if you ignore it, unexpected errors will occur. Let's take a look at several common errors and analyze the reasons for them.

1. Warning 280:'i':unreferenced local variable

Explanation: The local variable i has not been accessed in any way in the function.
Solution: Eliminate the declaration of the variable i in the function.


2 Warning 206: 'Music3': missing function-prototype
Description Music3() function is not declared or not declared externally, so it cannot be called by other functions.
Solution Write the statement void Music3(void) at the beginning of the program to declare it. If it is a function of other files, write it as extern void Music3(void), that is, declare it externally.


3 Compling: C:\8051\MANN.C
Error: 318: can't open file 'beep.h'
Description: During the compilation of C:\8051\MANN.C program, main.c used the instruction #include "beep.h", but it could not be found.
Solution: Write an include file of beep.h and save it in the working directory of c:\8051


4 Compling:C:\8051\LED.C
Error 237:'LedOn':function already has a body
Description The LedOn() function name is defined repeatedly, that is, there are more than two identical function names.
Solution: Correct one of the function names so that all function names are independent.


5 ***WARNING 16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?_DELAYX1MS?DELAY
Description The DelayX1ms() function will occupy program memory even if it is not called by other functions.
Solution Remove the DelayX1ms() function or use conditional compilation #if …..#endif to keep the function and not compile it.


6 ***WARNING 6 :XDATA SPACE MEMORY OVERLAP
FROM : 0025H
TO: 0025H
Explanation The external data ROM's 0025H address is defined repeatedly.
Solution: The definition of the external data ROM is as follows:
Pdata unsigned char XFR_ADC _at_0x25, where the name of the XFR_ADC variable is 0x25. Please check if there are other variable names defined at 0x25 and correct them.


7 WARNING 206:'DelayX1ms': missing function-prototype
C:\8051\INPUT.C
Error 267:'DelayX1ms':requires ANSI-style prototype C:\8051\INPUT.C
Description The program calls the DelayX1ms function but the function is not defined, that is, the program content is not written or the function is defined but not declared.
Solution: After writing the content of DelayX1ms, you must declare it or make an external declaration. You can declare it as external in the include file of delay.h so that other functions can call it.


8 ***WARNING 1: UNRESOLVED EXTERNAL SYMBOL
SYMBOL:MUSIC3
MODULE:C:\8051\MUSIC.OBJ(MUSIC)
***WARNING 2: REFERENCE MADE TO UNRESOLVED EXTERNAL
SYMBOL:MUSIC3
MODULE:C:\8051\MUSIC.OBJ(MUSIC)
ADDRESS:0018H
Description The program calls the MUSIC function but does not add the extension file C of the function to the project file Prj for compilation and linking.
Solution: Set the MUSIC3 function in MUSIC C and add MUSIC C to the project file.


9 ***ERROR 107: ADDESS SPACE OVERFLOW
SPACE: DATA
SEGMENT: _DATA_GOUP_
LENGTH: 0018H
***ERROR 118: REFERENCE MADE TO ERRONEOUS EXTERNAL
SYMBOL: VOLUME
MODULE: C:\8051\OSDM.OBJ(OSDM)
ADDRESS: 4036H
Description The address range of the data storage space is 0~0x7f. When the number of public variables and local variables in the function is set to SMALL, the local variables will first use the working registers R2~R7 for temporary storage. When the memory is insufficient, the data type space will be used for temporary storage. When the number exceeds 0x7f, the address will be insufficient.
Solution: Change the public variables defined as data type to idata type definition

 

10 “*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL” 

*** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL

If you get the above warning when using the C51 compiler, this is a mistake that only beginners and careless people make: not adding the C file to the project!
In addition, it may be because there are defined functions that are not called, or related defined variables are not used.

 

"*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL"

*** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL

If you get the above warning when using the C51 compiler, this is a mistake that only beginners and careless people make: not adding the C file to the project!
In addition, it may be because there are defined functions that are not called, or related defined variables are not used.

 

"*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL"

*** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL

If you get the above warning when using the C51 compiler, this is a mistake that only beginners and careless people make: not adding the C file to the project!
In addition, it may be because there are defined functions that are not called, or related defined variables are not used.

Keywords:Keil Reference address:Several common warnings in keil

Previous article:MCU random numbers: rand(), srand()
Next article:How to use the SST MCU P4 port

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号