当前位置:网站首页>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
边栏推荐
- UEFI development learning series
- [cloud native | learn kubernetes from scratch] III. kubernetes cluster management tool kubectl
- Explain task scheduling based on Cortex-M3 in detail (Part 2)
- FIO测试硬盘性能参数和实例详细总结(附源码)
- Network communication process
- [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...)
- Class of color image processing based on Halcon learning_ ndim_ norm. hdev
- Sizeof (function name) =?
- VESC Benjamin test motor parameters
- How to excavate and research ideas from the paper
猜你喜欢
DokuWiki deployment notes
Measurement fitting based on Halcon learning [II] meaure_ pin. Hdev routine
Arduino uses nrf24l01+ communication
如何将EasyCVR平台RTSP接入的设备数据迁移到EasyNVR中?
Communication standard -- communication protocol
[paper reading] the latest transfer ability in deep learning: a survey in 2022
Network communication process
Shape template matching based on Halcon learning [v] find_ cocoa_ packages_ max_ deformation. Hdev routine
Mlperf training v2.0 list released, with the same GPU configuration, the performance of Baidu PaddlePaddle ranks first in the world
C WinForm [display real-time time in the status bar] - practical exercise 1
随机推荐
DCDC circuit - function of bootstrap capacitor
On boost circuit
Semiconductor devices (III) FET
Talk about the circuit use of TVs tube
What are the test items of power battery ul2580
Shape template matching based on Halcon learning [VII] reuse_ model. Hdev routine
Programming knowledge -- assembly knowledge
My-basic application 1: introduction to my-basic parser
NTC thermistor application - temperature measurement
Record the visual shock of the Winter Olympics and the introduction of the screen 2
C WinForm [help interface - send email] - practice five
Simple design description of MIC circuit of ECM mobile phone
Extern keyword function
C WinForm [display real-time time in the status bar] - practical exercise 1
[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...)
UEFI development learning 4 - getting to know variable services
Classic application of MOS transistor circuit design (1) -iic bidirectional level shift
C WinForm [change the position of the form after running] - Practical Exercise 4
Some errors in configuring the environment
Introduction of air gap, etc