In the Keil installation directory, where there are STDIO.H several print functions are as follows:
extern int printf (const char *, ...);
extern int sprintf (char *, const char *, ...);
extern int vprintf (const char *, char *);
extern int vsprintf (char *, const char *, char *);
vprintf corresponds to printf, which prints the data in ASCII format to the serial port
The vsprintf corresponds to sprintf, which prints the data in ASCII format to
Download Keil MDK5 After the device is not installed, if the creation of the project will not find the target chip, as shown in the following figure:
At this point we will install the chip series we need, such as the STM32F1 series.
First select Project-manage-pack installer as shown in the following figure:
At this point, the following interface appears:
Select Packs in the menu bar, click Check for Updates, the latest supported CPU series
Use MDK to create a stm32f103ze core project yourselfAdd the source code after compiling, normal, online simulation single-step implementation of the following problemsError 65:access violation at 0x40021000:no ' read ' permissionI found a problem with the setup inside Debug.http://www.cnblogs.com/xiaobo-Linux/The main items are the following 2 settingsDialog DLL Default is DCM3.DLLParameter default is-PCM3should readDialog DLL Default is DARMSTM.DLLParameter default is-pstm32f103zeIt's normal.S
Use MDK for programming. If you have defined a useful function but no explicit call is made, MDK uses the entire function in the default mode.ProgramAlways Delete to save Rom.
For example, if you locate a function in 0x00002000 of Rom, assume it is void test (void), and then use the function pointer to call it:
Void (* userprogram) (); // function pointer
Userprogram = (void (*) (0x00002000); // locate the specified entry address 0x00002000
(* Userprogram) (); // call the test () functio
When you just took over STM32, you only write an int main () {while (1);} Build://program size:code=340 ro-data=252 rw-data=0 zi-data=1632 compiled, you will find that this program has used more than 1600 RAM, if the 51 SCM, the pain of death, Where did the 1600-plus RAM go, analysis Map, you will find that the heap and stack occupy in the Startup_stm32f10x_md.s file, its first few lines have the above definition, this should be understood. Stack_size EQU 0x00000400 heap_size EQU 0x00000200 by t
Zi.RM Program Execution ProcessFrom the above two points can be known, burned to ROM image file and the actual runtime of the ARM program is not exactly the same. It is therefore necessary to understand how the ARM program gets to the actual running state from the image in ROM.In fact, the instructions in the ROM should at least have such a function:1. Move RW from ROM to ram because RW is a variable and the variable cannot exist in ROM.2. Clear the Ram area where the Zi is located, because the
, the so-called library function, in fact, refers to the inside of the code. There are also 2 subfolders in this folder: Inc and SRCAs the name implies, Inc is a finger file, src refers to the source code, so that the header files and the source code are stored in both folders. Inc When we create a new project, we must add the header file containing the path so that MDK can find the headers.Then src inside of the. c file, is the stm32 of various peripheral drivers, we can add according to their
manually include the C51 run-time Library (c51s. lib, c51m. lib, or c51l. lib ).
More information
ReferASMIn the cx51 user's guide.
ReferInterfacing C to AssemblerIn the cx51 user's guide.
See also
C51: Problems with # pragma ASM
GENERAL: SRC Directive
Bl51: Warning L1 (unresolved external) using inline assembly
C51: inline assembly generates target out of range
C51: In-line ASM gives compiler warnings
Forum th
Http://www.cnblogs.com/Ninputer/archive/2011/06/07/2074632.html
In the first article of this series, I would like to give an overview of the Compiler Construction and help you understand the purpose of each component in the compiler. I think you should read other compilation principles books. Most of them are in the first chapter or in the preface and so on. The compi
Write the compiler, linker, and compiler by yourself
A complete set of Compiler Principles and Techniques play an important role in the entire computer science field. Learning it can be of great help to programmers. After studying the history, we will find that the program design masters praised by everyone are masters in the compilation field, such as the bill g
Reprinted in this article
Address: http://www.lingcc.com/2009/12/22/10404/
For a summary of compiler books, refer to a list of compiler books-rich compiler references.
If the job is related to compilers or compiler enthusiasts, no one has the urge to write a compiler on the
Qt project RUN, Hint:: -1:ERROR:QT Creator need to set up a compiler to build. Set up a compiler in the build Suite option.
Problem reason: MSVC is involved in copyright, its QT installation package does not contain msvc, installation of Qt did not install MSVC.
Qt Required MSVC version:
Identification via QT installer name: qt-opensource-windows-x86-msvc2015_64-5.8.0.exe,msvc2015_64
Through QT program Info
Compiler and javac compilation principlein the previous article, we know. Java is a compiled and interpreted language whose source code is compiled by the compiler javac into a binary language that can be recognized by the JVM, and the JVM interprets it as a machine language that can be recognized by the platform. So what is a compiler? What is the role of the
For example, how to use dumpbin.exeto check the information embedded by the compiler, dumpbin.exe Compiler
Enable CMD
Run the following command in the dumpbin Directory: D: \ Program Files (x86) \ Microsoft Visual Studio 12.0 \ VC \ bin.
Run the command VCVARS32.BAT to configure the environmentIf you do not run vcvars32.bat, the following prompt is displayed:
Run the dumpbin commandD: \ Program Files (
Test whether the compiler allows annotation nesting. The Compiler allows annotation nesting.
Problem: Some C compilers allow nested comments. Write a test program with the following requirements:
For compilers that allow nested comments or compilers that do not allow nested comments
Can be compiled normally (no error message appears), but the results of program execution in both cases
But not the same.
Tip:
C ++ compiler function compilation process and compiler function compilation process
In C ++, the type search process is relatively simple, basically the name search, which is not described here.
For a function (or member function) called in the. cpp file, the compiler mainly does the following three things:
1. Search for the name. first, you can find the name in
Operating system, CPU, compiler, runtime library, system call. This is a relatively tall concept in computer science, and many trained are not even clear about a simple code execution process, which block is the operating system control, which is the compiler control, what role the CPU actually played, what is the runtime library.
Thinking about the problem, we must first grasp the macro, grasp the general
Compiler Introduction: Overview, compiler Overview
First of all, I declare that this series of blog posts is a record in the process of learning compilation principles. The main reference book is Allen I Holub's Compiler design in C.
First of all, I would like to express my gratitude to the author of this book, such as the dragon book, the tiger book, and the wha
Http://code.google.com/p/closure-compiler/
Http://stackoverflow.com/questions/28932/best-javascript-compressor
Google releasedClosure CompilerWhich seems to be generating the smallest files so far as seen hereand herePrevious to that the varous options were as followBasically Packer does a better job at initial compression, but if you are going to gzip the files before sending on the wire (which you shoshould be doing) Yui compressor gets the
GCC compiler entry [reprint], gcc compiler entry reprint
The GCC Compiler (gnu c Compiler) is an open-source Compiler organized by GNU. It is the default C language Compiler in Linux. It can compile other languages in addition to
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.