Keil MDK version: v4.03. For more information, see my other blog posts.
PC-Lint version: v8.0
There are many powerful functions of PC-lint on the Internet. I don't want to repeat them here. I just want to say: it can be tested by PC-lint.ProgramIt may not be a problem, but the quality improvement is self-evident when the PC-Lint test program is passed.
First, install the Keil MDK and PC-Lint sof
1. Open Keil μ vision3 and open the project to be checked.
2. Open the Tools menu, select setup PC-lint..., and open the PC-Lint options window.
3. Click the four edit icons (new, delete, move up, move down) in the upper right corner to set PC-Lint include folders. Based on the C source
ProgramThe header file (. h) name in the file to locate the related folder (including the INC folder itself) in the "C:/Keil
circuit, that isKey reset or watchdog Reset. After resetting,Ram content has not changed. In some scenarios, You must distinguish whether the device restarts after a hot or cold restart. The common method is to determine the memory unit as the flag bit (for example, 0x40003ff4 ~ 0x40003ff7Ram unit), first read the content of the memory unit at startup. If it is equal to a specific value (for example, 0xaa55aa55), it is considered as a hot start; otherwise, it is a cold start.
Define a variable
. it is only possible to analyze the bug of the compiler, because the LCD can be displayed in simplified Chinese encoding, but it has not been confirmed. I knew that I had been hanging out on the Internet a few days ago and saw a patch before I realized that my original conjecture was correct.
It turns out that this is indeed a compiler BUG: during compilation, Kei
1. Replace C: \ Keil \ ARM \ STLink with the STLink file in the resource. Remember to back up the original file,
2. Change C: \ Keil \ TOOLS. INI to the following
[UV2]ORGANIZATION="cs2c"NAME="jianzhong", "cui"EMAIL="cjzswust@gmail.com"ARMSEL=1BOOK0=UV4\RELEASE_NOTES.HTM("uVision Release Notes")[ARM]PATH="C:\Keil\ARM"VERSION=4.60PATH1="C:\Program Files\arm-none-
Keil C51 is a compiler compatible with ansi c. The ansi c Specification specifies that the default data types of decimal Integer constants are int, long int, and unsigned long Int, which of the given constants depends on the actual size of the constant. If the constant is between-32768 and ~ Between 32767 and are processed by the int type. If the processing by the int type overflows, consider the long Int o
flag;
Haha, you don't have to explain the reason. But in this case, why does the compiler prompt that the semicolon is missing? I don't understand it. Which of the following experts will be troubled to explain the mysteries!
In addition, in order to list the situations that cause such errors more comprehensively (it is easy to find out where the problem is located and not to list it), I will also list the situations encountered by other online users:
example:
SWI 0x02; this command calls the system routine of the operating system number 02.
In the Keil MDK, the keyword _ SVC can generate the hardware SWI command so that the processor can respond to the software interrupt. The keyword _ SVC, which is described in the Keil MDK help file as follows:
The _ SVC keyword declares that the Super User calls the (SVC) function. This function uses up to four par
auto-addition, for example, when performing latency
Eg, common: void dely ()
{
Char;
For (A = 0; A
}
Optimized: void dely ()
{
Char;
For (A = 70; a> 0; --);
}
1.8 The global variable definition is placed out of main () and the initial value is placed in main ().
Eg, common: int A = 8;
Main ()
{
}
Optimized: int;
Main ()
{
A = 8;
}
Method 2: (use the Keil-C software to set and optimize the compression level)
Step: click "options for target ***"->
Keil is a god compiler.
For example:
1> the compiler prompts "expression with possibly no effect", indicating that your current language is useless, as shown in figure
The following statement is used in Preprocessing:
# Define s2tb8 (A) (s2con 0xf7) | (a)
The solution is as follows:
# Define s2tb8 (a) s2con = (s2con 0xf7) | (a)
Then, the compilation is
Transferred from: http://blog.sina.com.cn/s/blog_980e19e00101b5dh.htmlSometimes precise delay is required, such as the 18B20 temperature sensor is very strict in timing requirements and must be accurate to the microsecond levelFirst, with the NOP functionIn Keil C51, call the library function directly:#include//declared void _nop_ (void);_nop_ (); Produce a NOP instructionFunction: For the delay is very short, requirements in the US level, the use of
I tried to port the STM Keil project to IAR several times. Fortunately, all of them succeeded. Here I will write down the notes during the porting process...
The first step is to first create a project folder PWM, and then create several subfolders in the folder: User, Inc, and startup. Of course, we have to copy the official library directory of STM, so there are four folders under the project directory (in fact, creating a few folders is random, jus
!
==========================================
In a function where a variable is stored in a stack, the value cannot be greater than the value in Keil, otherwise the value of the variable at debug time shows a baffling value, causing
Heap overflow.
The definition of a function here is the end of the entire function.
Like what:
Function A is defined as follows:
A
{
U8 data[500];
B ();
C ();
}
B
{
U8 data[500];
}
C
{
U8 data[500];}
The heap in functions
Code is the keyword of the Keil C51 extension, and the code-modified variable will beinto the code area. But the const keyword in c also seems to have the function of defining variables that cannot be changed, what is the difference between these two keywords?To find the const in the Help manual, you can find the following description1 Variables declared with the const type qualifier alone is stored in the "Memory Area" (data, Idata, XData, and so on)
Ⅰ, overviewThe previous article is a summary about the use of Keil-common functions (ii), the article then summarizes the previous article.I will summarize each article of Keil use method together, review the previous summary please click the following link (click to read the original), Keil use Method (summary):http://blog.csdn.net/ybhuangfugui/article/details/5
using the car later, you can only weld the "Bracket" at the bottom and then install it on the cave board like this:
Operating System Selection
The initial consideration is uC/OS-II. It is very famous (often seen) and has strong functions (sounds like it), and the operating system is also introduced in the books I bought.
The US/OS-II Job Scheduling is a fully preemptible Job Scheduling Method Based on the job priority, the low-priority job being executed can be interrupted by a high-pr
In modular programming, it is essential to set up a separate header file for a module.In the two mainstream compilers, it is important to set the accuracy of the file path when referencing the module function, including the path to the header file.Otherwise, the compiler will error, unable to open such a header file!Combined with your own experience, summarize how to set the file inclusion path under these two compilations:The first is the constructio
Keil will have a line after compiling: program size:code=xxx ro-data=xxx rw-data=xxx zi-data=xxx
Code represents the execution of the codes, and all functions in the program are located here.
Ro-data represents read-only data, and the global constant data and strings defined in the program are located here.
The rw-data represents the initialized read-write data, and the global and static variables defined and initialized in the program are located her
MODE;Sbit mode_7 = mode^7;Sbit mode_6 = mode^6;Sbit mode_5 = mode^5;Sbit mode_4 = mode^4;Sbit mode_3 = mode^3;Sbit mode_2 = mode^2;Sbit mode_1 = mode^1;Sbit mode_0 = mode^0;A 8 bit variable mode_n is defined.This is the special data type that defines the statement, KEILC. Remember, it must be sbit.Cannot bit mode_0 = mode^0;Assignment statements If all these C languages are treated as XOR or arithmetic//--------------------------------------------------------------------------------------------
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.