Solve a Keil C error message: error C132

Publisher:未来感觉Latest update time:2016-12-14 Source: eefocusKeywords:Keil  error  C132 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Today, after I changed one of my programs into multiple files, the following alarm appeared: not in formal parameter list.
I searched for a long time but couldn't solve the problem. Later, I found someone else's solution to the same problem on the Internet. It was caused by a missing semicolon in a function declaration in the header file. I immediately checked my own program and found that a semicolon was missing as well. After adding the semicolon, the compilation and linking passed.
The following is the article I reprinted that solved the problem:
error C132: "****" not in formal parameter list 
It took me nearly half an hour to find the error, and finally found that it was because a semicolon was missing in a function declaration in the header file, causing the parameter declared immediately below it not in the formal parameter list. I wrote it down here so that I don't forget it later, and it is also for everyone to share. The error code is as follows:
I listed the function declarations in the function declaration as follows:
void Display_Normal();
void Display_Reset()
void Display_Year() ; void Display_Month()
;
void Display_Day();
void Display_Week();
void Display_Hour();
void Display_Minute();
void Display_Second();

Here are some other common error prompts: 
1. The first error message 
***WARNING L15: MULTIPLE CALL TO SEGMENT 
SEGMENT: ?PR?_WRITE_GMVLX1_REG?D_GMVLX1 CALLER1: ?PR?VSYNC_INTERRUPT?MAIN CALLER2: ?C_C51STARTU
***WARNING L15: MULTIPLE CALL TO SEGMENT SEGMENT: ?PR?_SPI_SEND_WORD?D_SPI CALLER1: ?PR?VSYNC_INTERRUPT?MAIN CALLER2: ?C_C51STARTUP ***WARNING L15: MULTIPLE
CALL TO SEGMENT SEGMENT: ?PR?SPI_RECEIVE_WORD?D_SPI CALLER1: ?PR?VSYNC_INTERRUPT?MAIN CALLER2: ?C_C51STARTUP ­ 
This warning indicates that the linker has found a function that may be called simultaneously by the main function and an interrupt service routine (or a function that calls an interrupt service routine), or by multiple interrupt service routines at the same time.
One of the reasons for this problem is that this function is a non-reentrant function. When the function is running, it may be interrupted by an interrupt, which may change the result and may cause some variable conflicts (that is, cause some data in the function to be lost. Reentrant functions can be interrupted by ISR at any time and can run again after a period of time, but the corresponding data will not be lost). The second reason is that the memory area used for local variables and variables (for the time being, arguments, [independent variables, variables-values, used to determine the value of a program or subroutine]) is overwritten by the memory area of ​​other functions. If the function is interrupted, its memory area will be used, which will cause memory conflicts in other functions. For example, the first warning indicates that the function WRITE_GMVLX1_REG is defined in D_GMVLX1.C or D_GMVLX1.A51 and is called by an interrupt service routine or a function that calls an interrupt service routine, the function that calls it is VSYNC_INTERRUPT in MAIN.C. Solution: If you are sure that the two functions will never be executed at the same time (the function is called by the main program and interrupts are disabled), and the function does not occupy memory (assuming that only registers are used), then you can completely ignore this warning. If the function occupies memory, you should use the linker OVERLAY directive to exclude the function from overlay analysis, for example: OVERLAY (?PR?_WRITE_GMVLX1_REG?D_GMVLX1 ! *) The 
above directive prevents the memory area used by the function from being overwritten by other functions. If the function calls other functions, and these functions are also called elsewhere in the program, you may want to exclude these functions from overlay analysis as well. This OVERLAY directive enables the compiler to remove the above warning message. If the function can be called during its execution, the situation becomes more complicated.
In this case, the following methods can be used: 
A. Disable interrupts when the main program calls the function. You can use the #pragma disable statement to achieve the purpose of disabling interrupts when the function is called. The OVERLAY directive must be used to remove the function from the coverage analysis. 
B. Copy the code of the function twice, one to the main program and the other to the interrupt service routine. 
C. Set the function to be reentrant. For example: void myfunc(void) reentrant { ... } This setting will generate a reentrant stack, which is used to store function values ​​and local variables. When using this method, the reentrant stack must be configured in the STARTUP.A51 file. This method consumes more RAM and slows down the execution of reentrant functions.

2. The second error message *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS ­SEGMENT: ?PR?_COMPARE?TESTLCD Explanation: Some functions (or segments) in the program have never been called before (during debugging), or there is no statement to call it at all. There should be a message before this warning message indicating which function caused the problem. Just make some simple adjustments. It is no big deal to ignore it. Solution: Remove the COMPARE() function or use conditional compilation #if …..#endif to keep the function and not compile.

3. Warning 280: 'i': unreferenced local variable
Description The local variable i is not accessed in any way in the function
Solution Eliminate the declaration of the variable i in the function

4 Warning 206: 'Music3': missing function-prototype
Description The Music3() function has not been declared or has not been 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.

5 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

6 Compling:C:\8051\LED.C
Error 237:'LedOn':function already has a body
Explanation 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.

7 ***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.

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

9 WARNING 206:'DelayX1ms': missing function-prototype
C:\8051\INPUT.C
Error 267 :'DelayX1ms ':requires ANSI-style prototype C:\8051\INPUT.C
Explanation The DelayX1ms function is called in the program 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, it must be declared or declared externally. It can
be declared as external in the include file of delay.h to facilitate other functions to call it.

10 ***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.

11 ***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
Explanation The address range of the data storage space is 0~0x7f. When the number of public variables and local variables in a
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.


Keywords:Keil  error  C132 Reference address:Solve a Keil C error message: error C132

Previous article:Storing information in the watchdog in the microcontroller
Next article:WARNING 15 (MULTIPLE CALL TO SEGMENT)

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

Type-C connector enables fast charging and audio streaming capabilities
At present, many brands of smartphones, notebooks, and tablets on the market have adopted Type-C connectors, such as Xiaomi, Meizu, OnePlus, Huawei, OPPO, etc. Most people just think it is convenient to use, and it can support both positive and negative dual plugging and charging, just like the dual Typc-C data cabl
[Embedded]
Type-C connector enables fast charging and audio streaming capabilities
AVR microcontroller I²C bus experiment
/* AVR microcontroller I2C bus experiment. 1. Use 24C02 to record the number of CPU startup times and display it on the PB port. 2. Internal 1 M crystal oscillator, the program adopts single-task mode and software delay. 3. To conduct this experiment, please plug in all 8 short-circuit blocks of JP1 and the shor
[Microcontroller]
How to use the built-in high-precision analog/digital converter of C8051F060
1 Introduction Among mixed-signal microcontrollers, the C8051F06X series of highly integrated mixed-signal microcontrollers newly launched by Cygnal Corporation of the United States is a standout. C8051F06X is a highly integrated system-on-chip microcontroller with up to 59 digital I/O ports, using the 8051-
[Microcontroller]
How to use the built-in high-precision analog/digital converter of C8051F060
S3C6410-uboot detailed interpretation of smdk6410.h
/*  * (C) Copyright 2002  * Sysgo Real-Time Solutions, GmbH  * Marius Groeger  * Gary Jennejohn  * David Mueller  *  * Configuation settings for the SAMSUNG SMDK6400(mDirac-III) board.  *  * See file CREDITS for list of people who contributed to this  * project.  *  * This program is free software; you can redistribut
[Microcontroller]
Type-C Bluetooth speaker single port rechargeable OTG solution
Currently, most of the Bluetooth speakers on the market still use the USB-micro interface, and the charging power is only 5-10W. Not only is the charging efficiency slow, but if the Bluetooth speaker wants to connect to a USB flash drive, it must also have an additional USB-A female socket, a TF card slot, and a 3.5
[Embedded]
Type-C Bluetooth speaker single port rechargeable OTG solution
Design of acquisition system based on C8051F020 microcontroller
introduction As my country's railways move toward high-speed, high-density, heavy-load, and electrification, interval blocking equipment, especially frequency-shifting automatic blocking systems, have developed rapidly. The ZPW-2000R non-insulated frequency-shifting automatic blocking system has also been widely promo
[Microcontroller]
Design of acquisition system based on C8051F020 microcontroller
Keysight/Agilent N5230C network analyzer cannot enter the system failure case
1. Instrument model: Agilent/Keysight N5230C Microwave Network Analyzer. 2. Fault phenomenon: After booting up, the computer stays on the test interface and cannot enter the system. 3. Testing process: The instrument performs internal self-check and finds that the instrument reports an error when entering the meas
[Test Measurement]
Keysight/Agilent N5230C network analyzer cannot enter the system failure case
PIC18 serial bootloader in C language and PC serial communication program with bootloader in C# language
  New PIC18 Bootloader   PhsBoot_v3.0 is my latest PIC bootloader implemented in C language, using serial communication, suitable for PIC18, and I wrote a PC communication program PhsLoader_v3.0 for it in C#. PhsLoader_v3.0 sends data to PhsBoot_v3.0 through the serial port according to the custom communication prot
[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号