当前位置:网站首页>MDK compilation process and arm compilation tool chain
MDK compilation process and arm compilation tool chain
2022-07-26 01:19:00 【Mindtechnist】

Welcome to join 【Linux C/C++/Python Community 】 Discuss and share together Linux C/C++/Python/Shell Programming 、 robotics 、 machine learning 、 Machine vision 、 The embedded AI Knowledge and technology in related fields .
MDK Compilation process and ARM Compile toolchain
Links to related articles
MDK-ARM It's also called KEIL MDK-ARM、KEIL ARM、Realview MDK、I-MDK、uVision5 etc. .
MDK The build process
Windows/Linux Using linker, you can directly generate executable image files elf And run , And development board / The SCM platform needs to load this content onto the chip , adopt formelf The converter will elf The image file is converted to .bin perhaps .hex file , And downloaded to the chip by the downloader FLASH/ROM in .
After compilation, all data with the same nature in the application is grouped into one domain , When the program is stored or running , Different domains will present different states .
- code: Code field , Store the machine instructions generated by compilation , That is, the space occupied by the code , These contents are stored in ROM District ;
- RO-data: Read only data field , Refers to the read-only data used in the program , The data is stored in ROM District ;
- RW-data: Read / write data fields , It refers to initialization as non 0 Readable and writable data of values , When the program is just running , Data has non 0 The initial value of the , When the program is running , These data will reside RAM District ;
- ZI-data: Initialize to 0 Or uninitialized read-write data fields , Uninitialized data will be initialized by the compiler as 0, When the program just runs, the initial value of these data is 0, Follow up meeting with RW-data data , permanent RAM District ;
- ZI-data Stack space : Stack space and heap space in the program belong to ZI-data Area , These spaces will be initialized to 0 value , Given by the compiler ZI-data The occupied space also includes the stack size , Local variables are stored in the stack , Store in the heap malloc/new Requested memory .

ARM Compile toolchain
ARM The compilation tool chain mainly includes :
- ARM C/C++ compiler (armcc)
- Microlib
- ARM Macro Assembler (armasm)
- ARM The linker (armLink)
- ARM Tools (Librarian and FromELF)
ARM Compiler will C/C++ Metafile compiled into relocatable (Relocatable) Target module , And embedded in it for uVision Symbol information debugged by debugger or online debugger . meanwhile ,ARM The compiler can help generate listing file, It can contain symbol table( The symbol table ) And cross reference information .
ARM The path of the compilation tool is Keil Under the installation path of “D:\keil_v5\ARM\ARMCC\bin”, Configure this path to the environment variables of the computer “ Computer → attribute → Advanced system setup → environment variable → User variables → newly build PATH And separate it with a semicolon ”, After configuration, you can Windows The command line cmd Use tool chain .
*ARM C/C++ compiler ( armcc )
armcc Mainly responsible for C/C++ Program compiled as ARM Instruction code .
Usage method :
- cmd Command line
- keil Magic wand →c/c++→Compiler control string
* MicroLib
MicroLib It's a use. C A highly optimized library of embedded applications written in ( be based on ARM framework ). Relatively contained in ARM Traditional standards in compilers C library ,MicroLib Have the advantage of better code size , It can meet the requirements of most embedded systems .
Microlib With the standard C The main difference between libraries is :
- MicroLib Mainly designed for advanced embedded applications ;
- MicroLib Has been optimized , Use the same as ARM Compared with the standard library , Use less code and data memory ;
- MicroLib Designed to work independently of the operating system , Of course, this does not prevent it from communicating with any OS or RTOS( for example Keil RTX) Used together ;
- MicroLib Do not include files I/O Or wide character support ;
because MicroLib Has been optimized , Reduced code size , So compared with ARM Standards in compilation tools C Library routines , Some functions will execute more slowly .MicroLib and ARM Both standard libraries are included in Keil MDK-ARM in .
Want to use MicroLib, In the first keil Check... In the settings MicroLib Option box , Then compile the program .keil Will use MicroLib To link programs , It can quickly reduce the size of program code .
*ARM Macro assembler ( armasm )
Compile the assembly file into .o file .
Usage method :
- cmd Command line
- keil Magic wand →Asm→Assembler control string
*ARM The linker ( armLink )
hold .o File links are combined to generate elf Format axf file ,axf Files are executable files .
Usage method :
- cmd Command line
- keil Magic wand →Linker→Linker control string
*armar
Package the project files into library files .lib.
*formelf Format converter
according to axf File generation hex Documents or bin file .


边栏推荐
- Tutorial on the principle and application of database system (057) -- MySQL exercises
- Detailed explanation of rest assured interface testing framework
- 代理IP服务器如何保证自身在网络中的信息安全呢
- Handler消息机制-FWK层
- Arthas watch command to view the properties of objects in the array
- Game thinking 17: Road finding engine recast and detour learning II: recast navigation grid generation process and limitations
- 第二届中国Rust开发者大会来啦,完整议程大曝光!
- 场景之分页查询设计
- Gcdqueue encapsulation
- 数据库系统原理与应用教程(055)—— MySQL 查询(十七):数学函数的用法
猜你喜欢

PyCharm在创建py文件时自动添加头部注释

Inverse matrix block matrix

Modify CSV

Network performance evaluation tool ping/mtr

Leetcode537. 复数乘法(可以,已解决)

ZK-Rollups工作原理

FreeBSD bNXT Ethernet driver source code reading record 2:

# 浏览器开发使用技巧
![[RTOS training camp] course learning methods and structural knowledge review + linked list knowledge](/img/d1/96bdcdb1ad9987aa551438def5f194.jpg)
[RTOS training camp] course learning methods and structural knowledge review + linked list knowledge
![[Jizhong] July 16, 2022 1432. Oil pipeline](/img/60/55a7e35cd067948598332d08eccfb1.jpg)
[Jizhong] July 16, 2022 1432. Oil pipeline
随机推荐
Tencent employees' salary: the real 985 graduation salary, do you think I can be saved? Netizen: daily salary?
[go] how to control the maximum number of concurrent processes
代理IP服务器如何保证自身在网络中的信息安全呢
Matlab bitwise and or not
《暗黑破坏神:不朽》手游如何多开搬砖及新手入门搬砖攻略
Causes of signal degradation in optical fiber communication
[RTOS training camp] problems of evening students
What are the ways to quickly improve programming skills in the process of programming learning?
Detailed explanation of rest assured interface testing framework
Transfer learning - getting started
# 浏览器开发使用技巧
游戏思考17:寻路引擎recast和detour学习二:recast导航网格生成流程及局限性
场景之分页查询设计
格式化JS代码,调试JS代码
Browser development and use skills
"Introduction to natural language processing practice" deep learning foundation - attention mechanism, transformer deep analysis and learning material summary
matlab 按位 与 或 非
1.30 升级bin文件添加后缀及文件长度
Handler消息机制-FWK层
[software development specification iv] application system security coding specification