Naming convention
The naming convention for the cross-compilation toolchain is: arch [-vendor] [-os] [-(gnu)eabi]
Depending on whether the operating system is supported or not, ARM GCC can be divided into those that support the operating system and those that do not.
arm-none-eabi: This does not have an operating system, so it cannot support functions that are closely related to the operating system, such as fork(2). It uses newlib, a C library specifically for embedded systems. arm-none-linux-eabi: For Linux, it uses Glibc
Examples
1. arm-none-eabi-gcc
(ARM architecture, no vendor, not target an operating system, complies with the ARM EABI) is used to compile bare-metal systems for the ARM architecture (including the ARM Linux boot and kernel, but not for compiling Linux applications). It is generally suitable for chips with ARM7, Cortex-M and Cortex-R cores, so it does not support functions closely related to the operating system, such as fork(2). It uses newlib, a C library specifically for embedded systems.
2. arm-none-linux-gnueabi-gcc
(ARM architecture, no vendor, creates binaries that run on the Linux operating system, and uses the GNU EABI)
Mainly used for Linux systems based on ARM architecture, it can be used to compile ARM architecture u-boot, Linux kernel, Linux applications, etc. arm-none-linux-gnueabi is based on GCC, uses the Glibc library, and is optimized by Codesourcery. The floating-point operation of arm-none-linux-gnueabi-xxx cross-compilation tool is excellent. Generally, ARM9, ARM11, Cortex-A cores with Linux operating systems will use it.
3. arm-eabi-gcc
Android ARM compiler.
4. armcc
The compiler tool launched by ARM has similar functions to arm-none-eabi. It can compile bare metal programs (u-boot, kernel), but cannot compile Linux applications. armcc is usually used together with ARM development tools. The compilers in KeilMDK, ADS, RVDS and DS-5 are all armcc, so armcc compilers are all charged (except the patriotic version, hehe~~).
5. arm-none-uclinuxeabi-gcc and arm-none-symbianelf-gcc
arm-none-uclinuxeabi is for uCLinux, using Glibc.
arm-none-symbianelf is used for Symbian, I have never used it and don’t know what the C library is.
ABI and EABI
ABI: Application Binary Interface (ABI) for the ARM Architecture. In computers, the application binary interface describes the low-level interface between an application (or other type) and the operating system or other applications.
EABI: Embedded ABI. The Embedded Application Binary Interface specifies standard conventions for file formats, data types, register usage, stack organization optimization, and parameters in an embedded software. Developers using their own assembly language can also use EABI as an interface to the assembly language generated by a compatible compiler.
The main difference between the two is that ABI is on computers and EABI is on embedded platforms (such as ARM, MIPS, etc.).
arm-linux-gnueabi-gcc and arm-linux-gnueabihf-gcc
The two cross compilers are suitable for two different architectures, armel and armhf. Armel and armhf adopt different strategies for floating-point operations (only arm with fpu can support these two floating-point operation strategies).
In fact, the two cross compilers are just different in the default value of gcc option -mfloat-abi. gcc option -mfloat-abi has three values: soft, softfp, and hard (the latter two require the arm to have an fpu floating point unit, and soft is compatible with the latter two, but softfp and hard are incompatible with each other): soft: do not use the fpu for floating point calculations, even if there is an fpu floating point unit, but use software mode.
softfp: The default value used by the armel architecture (the corresponding compiler is arm-linux-gnueabi-gcc). It uses fpu for calculations, but passes parameters using ordinary registers. In this way, when an interrupt occurs, only ordinary registers need to be saved, and the interrupt load is small, but the parameters need to be converted into floating point before calculation.
hard: The default value used by the armhf architecture (the corresponding compiler arm-linux-gnueabihf-gcc). It uses the fpu for calculations and the floating-point registers in the fpu for parameter transfer, eliminating the need for conversion. It has the best performance but a high interrupt load.
Save the C file contents used in the following test as mfloat.c:
1. Compile with arm-linux-gnueabihf-gcc and use the "-v" option to get more detailed information:
# arm-linux-gnueabihf-gcc -v mfloat.c COLLECT_GCC_OPTIONS='-v' '-march=armv7-a' '-mfloat-abi=hard' '-mfpu=vfpv3-d16′ '-mthumb' -mfloat-abi=hard
It can be seen that hard hardware floating-point mode is used.
2. Compile using arm-linux-gnueabi-gcc:
# arm-linux-gnueabi-gcc -v mfloat.c COLLECT_GCC_OPTIONS='-v' '-march=armv7-a' '-mfloat-abi=softfp' '-mfpu=vfpv3-d16′ '-mthumb' -mfloat-abi=softfp
It can be seen that softfp mode is used.
Previous article:Understanding the JTAG interface of embedded development ARM technology in one article
Next article:A detailed explanation of the solution for embedded system development based on ARM
Recommended ReadingLatest update time:2024-11-16 12:50
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- How does the uart.write function output three bytes of 0XFF 0XFF 0XFF (HEX data, not string data)?
- Electric vehicles use silicon carbide power devices to successfully move out of the laboratory
- Chinese programmers VS American programmers, so vivid...
- The last version of Python2, Python 2.7.18, was released
- Unboxing the Renesas CPK-RA2L1 development board and preparing for evaluation
- DSP5402 development board schematic diagram
- Please tell me the setting function of deep sleep
- Driver transplantation of pedometer bracelet based on F103 and X-NUCLEO-IKS01A3
- [Jihai APM32E103VET6S Development Board] Review 1. Unboxing
- Using LM339 to generate triangle wave