当前位置:网站首页>Keil use details -- magic wand
Keil use details -- magic wand
2022-07-05 08:11:00 【Nanbolwan】
Preface
I believe that both novices and users keil A large number of developers who have developed for many years do not understand keil All development and debugging functions . This article aims to explain all commonly used functions within the cognitive scope of bloggers . First of all, I will introduce the contents of the magic wand
One 、 Text


The magic wand in the picture is used keil Functions often used in the development process , But have you really understood and used all of them ?
1.Device

The function of this page is very simple , Is to choose the chip type for our project , On the left is the list of currently supported chips , The text box on the right is the English introduction of the chip , There is a search box on it . I wonder if anyone has ever thought about , Some made in China MCU Not in this list, how do we use keil Development ? This question is left behind target explain .
2.target

Doing it stm32 The developers of Series MCU development generally don't pay special attention to this page , Because after the project is established, the relevant parameters of this page have generally been fixed and do not need to be modified later . There's another factor , This page is closely related to the memory structure of the chip , Generally, chip manufacturers will configure it for users , Users don't need to pay attention to these . So many developers don't know much about the relevant functions of this page .
This part mainly shows the current chip model , Crystal oscillator frequency used . This crystal oscillator frequency does not play a practical role in practical engineering . The next one operating system It doesn't work either ( This is what I have learned so far , There may be special applications ). We should pay attention to the contents in the red box , Here we choose one .sfr file , The list of peripheral registers we use in online debugging is closely related . All peripheral register information is from this .sfr Imported from the file . We can also create our own .sfr file . The following shows the peripheral information displayed in the debugging state :
Next piece :
Use Cross-Module Optimization I don't know what the function is ,Big Endian It is not possible to select . The following highlights Use MicroLIB.
Use MicroLIB It's a c Language standard library , The firmware it compiles is a little smaller than the firmware of the traditional library , Of course, the performance is relatively poor , If the program storage space is tight, you can check this option . The following is a comparison of the size of the firmware compiled with and without these two options :








summary : After a comparative test , It is found that the two options that can be checked should be used together to effectively reduce the amount of code , Developers who have not used or have mainly used related functions can try to use .
Next piece :
In fact, I began to pay attention to the content of this section only last year , The content of this block is closely related to code storage and program jump . The content of the above picture is STM32 Configuration content . On the left is the configuration of program instructions and read-only data storage area ,startup Represents the area where the program entry address is located , The left side is generally configured as Flash、OTP Wait for the memory to be attached to the address area on the bus , Of course, our program can also be executed in RAM in , So the left side can also be configured as RAM Bus address range . Generally speaking, the right side is the area of readable and writable data storage , For example, stack and heap, and read-write global variables in programs , This piece is generally configured in RAM So the general configuration is RAM Address range of the bus . in addition , If we have multiple memory attached to the bus, we can also configure multiple memory .( Later, I will run the program in RAM As an example, let's talk about how to configure the contents of these two pieces ).
3.Output

This part mainly focuses on the selection of output file type and the configuration of output path , I won't go over it here .
4.User

User Many developers of the page hardly use it or seldom use it , But the content of this piece is keil Function expansion provides the possibility . Because it provides an interface to execute external commands . There are three states to execute commands , They are compiling c/c++ Before document 、 function Build/Rebuild Before and after operation Build/Rebuild After execution . An example of use is given below :
Example 1 : We often need to output firmware bin file , We can use keil The built-in command executes the conversion command after the program is established .
Click the compile button , Output is as follows :

Example 2 : Example 1 shows the use of existing commands to execute the build after compilation bin File tasks . In fact, we can execute any command we want , In its three stages of compilation , Including our own commands or programs . This greatly improves our flexibility in the development process , In the following example, I will show how to execute my... Before compilation python The script implements its own commands .
I use python The following simple script and in vscode Screenshot of execution results in :
Now I'll pack it into exe And configure execution 
Execution results :
We found that in compiling each c Before the file, we will execute our customized commands , Does this function give you a lot of inspiration ? If you master something like... Like me python This is a second language , Is it possible to realize many automatic functions in the development process to achieve more efficient development ?
4.C/C++
Due to space constraints, I'll finally introduce C/C++, This section mainly introduces compiler optimization levels :

Pictured above , Configuring the appropriate optimization level will make efficient use of the functions of the compiler to optimize the program , It can greatly improve the efficiency of the program and optimize the storage . Most of us use O2 Optimize , Of course, optimization will bring about the program bug, Sometimes the optimized result is not what we want , This requires us to accumulate experience in the process of use ;
O0:
O2:
by force of contrast O0 and O2 The optimization of the , You can see that the code size has been effectively optimized .
It's used here url Data requested by the network .
bye
This article will stop here , Time related content will be introduced further in the future . I hope interested friends can continue to pay attention
边栏推荐
- Sizeof (function name) =?
- OC and OD gate circuit
- Altium designer learning (I)
- Solutions to compilation warnings in Quartus II
- [trio basic tutorial 18 from introduction to proficiency] trio motion controller UDP fast exchange data communication
- Talk about the circuit use of TVs tube
- How to copy formatted notepad++ text?
- Bluetooth hc-05 pairing process and precautions
- Shape template matching based on Halcon learning [v] find_ cocoa_ packages_ max_ deformation. Hdev routine
- Some tips for using source insight (solve the problem of selecting all)
猜你喜欢

Wifi-802.11 negotiation rate table
![C WinForm [display real-time time in the status bar] - practical exercise 1](/img/9f/d193cbb488542cc4c439efd79c4963.jpg)
C WinForm [display real-time time in the status bar] - practical exercise 1

C, Numerical Recipes in C, solution of linear algebraic equations, LU decomposition source program

Hardware and software solution of FPGA key chattering elimination

Programming knowledge -- basis of C language

How to migrate the device data accessed by the RTSP of the easycvr platform to easynvr?

Create inf module in AMI code

DCDC circuit - function of bootstrap capacitor

如何进行导电滑环选型

Brief discussion on Buck buck circuit
随机推荐
[trio basic tutorial 18 from introduction to proficiency] trio motion controller UDP fast exchange data communication
Anonymous structure in C language
C WinForm [display real-time time in the status bar] - practical exercise 1
Hardware and software solution of FPGA key chattering elimination
Record the opening ceremony of Beijing Winter Olympics with display equipment
Create inf module in AMI code
Volatile of C language
NTC thermistor application - temperature measurement
How to copy formatted notepad++ text?
What are the test items of power battery ul2580
OLED 0.96 inch test
Design a clock frequency division circuit that can be switched arbitrarily
How to excavate and research ideas from the paper
Hardware 3 -- function of voltage follower
Basic information commands and functions of kernel development
Can't find real-time chat software? Recommend to you what e-commerce enterprises are using!
Imx6ull bare metal development learning 2- use C language to light LED indicator
UEFI development learning 3 - create UEFI program
Classic application of MOS transistor circuit design (2) - switch circuit design
[tutorial 19 of trio basic from introduction to proficiency] detailed introduction of trio as a slave station connecting to the third-party bus (anybus PROFIBUS DP...)