Section 001_Brief Introduction to Bare Metal Development Steps
Recalling the time when I learned C language on VC6.0 in college, the general operation process was as follows:
x86 platform, Windows application: create a project, edit source code, compile code (compiler: VC6.0), and run.
To learn C language on Ubuntu, the general process is as follows:
x86 platform, Ubuntu application: edit source code, compile code (compiler: gcc), run.
The two are almost identical.
Glossary:
gcc:
GCC is the main compiler software under the Linux system. The full name of GCC is GNU Compiler Collection. In addition to compiling programs developed in C language, it can also develop programs in multiple languages such as C++ and Java. GCC was originally intended to be a compiler specially written for the GNU operating system.
Reasons for using gcc: powerful, stable, open source and free.
1) gcc -v checks the version of gcc, thus verifying that the gcc compiler is normal.
No matter which version of gcc you use, as long as it can be compiled normally later.
2) gcc -o output file name source file
o:output
Cross-compile mode:
Usually, the platform for compiling embedded programs is called the host machine (such as the Ubuntu system of the PC, the CPU architecture is the X86 architecture), and the platform for running embedded programs is called the target machine (such as a certain ARM development board, the CPU architecture is the ARM architecture). Editing and compiling ARM architecture programs on the X86 platform and the compiler arm-linux-gcc belong to different architecture platforms, so it belongs to the cross-compilation mode. Then burn the program to the ARM development board (download methods include: JTAG, USB, SD card, network, etc.), and then run the program on the development board.
editor:
It is recommended to use source insight and notepad on the Windows platform.
Source insight is very useful for viewing code, editing code, and other functions.
translater
It is recommended to use arm-linux-gcc
arm-linux-gcc is an arm compiler based on the linux platform. It is an open source and free compiler.
arm-linux-gcc is powerful, stable, supports many arm chips, and is updated quickly.
Getting Started Mistakes: Using ads and MDK
ads (stop updating) and MDK are compilers for the Windows platform with weaker functions.
1) It is only suitable for individual or small team development, but not suitable for collaborative development of medium or large teams.
2) It is a paid software.
Section 002_Use of source insight code viewing tool
editor
It is recommended to use source insight and notepad on the Windows platform.
Source insight is very useful for viewing code, editing code, and other functions.
Source insight targets: c files, h files, ARM assembly files
Notepad is for: other files, such as Makefile (which simply means: specifying which source files to compile and specifying the output file name after compilation)
Source insight is a paid software, but this software can be used for free for 35 days.
Version: 3.5
Installation package: Baidu "source insight3.5"
Common settings for source insight:
1. Add file types
In options-->documents options, set the file filter of c source file to *.c;*.h;*.S
2. New Project (New Construction)
project-->new project, and then add the corresponding files to the project.
3. Font settings (solve Chinese garbled characters)
In options-->documents options, set screen fonts to: Songti, Regular, 12, GB2312.
Use alt+F12 to adjust the font width.
4. Explain the source insight window
Project window: Indicates which files are in the project.
Main window: Displays the file contents of the currently opened file.
Symbol window: displays the function name, structure name, macro definition, etc. of the currently open file.
Context window: Place the cursor on a function (variable or macro definition), and you can see the corresponding definition in the context window below.
5. Display line numbers
view-->line number
6. Quickly jump to a line
There is a go to line in the toolbar.
7. Highlight keywords
Put the cursor on the keyword, then right-click menu -> highlight word
8. View the function definition location
Place the cursor on the function, then right-click menu -> jump to definition, or press ctrl + left mouse button.
go back (alt + ,) to return to the last cursor position, or use the left arrow in the toolbar.
go forward (alt + .) to the next cursor position, or use the right arrow in the toolbar.
9. Find
Right-click menu-->lookup reference, or ctrl + /.
Section 003_notepad editor and binary file viewing tool
Here are two free tools:
Text editor tool [https://notepad-plus-plus.org/ Notepad++] and binary viewing tool [https://www.hhdsoftware.com/free-hex-editor Free Hex Editor Neo].
Notepad++ usage tips:
Press Ctrl+mouse wheel to zoom in or out of the text content.
When viewing a C language file, double-click a variable to highlight the variable in the entire text;
When viewing a C language file, place the cursor at any bracket to highlight the entire bracket range;
The shortcut key "Ctrl+F" opens the search window and you can search for the required characters;
Free Hex Editor Neo usage tips:
Open the hex binary file, and by default, 16 numbers are displayed per line, i.e. 0x00-0x0f;
In the menu bar, go to View->Offset to set the display base of the left offset.
In the menu bar, select View->Display As to set the display system of the current data.
In the menu bar, select View->Columns As to set how much data is currently displayed in each row;
In the menu bar, select View->Group By to set the data type of the current data.
Previous article:Lesson 006 Development Board Familiarity and Experience
Next article:Lesson 008: 1st ARM bare board program and extension (light up the LED)
- 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
- [National Technology N32G457 Review] Implementation of Environmental Status Detection Device
- [BearPi-HM Nano, play Hongmeng "Touch and Go"] Part 2: Setting up the environment is so simple
- Failed to set default vias in Altium Designer?
- ESP8266 most complete application documentation
- LED light flickering problem, help
- Realization of various wavelet transforms based on FPGA
- Book a live broadcast with prizes: Enjoy purity - ams active noise reduction and proximity sensing bring a new level of headphone design
- Analog Front End AFE
- Is there any special way to route the wiring of this type of seat?
- Free review: GigaDevice GD32F310G-START