Lesson 007 Bare Metal Development Steps and Tool Usage (Using SourceInght Notepad++)

Publisher:化羽2015Latest update time:2020-03-20 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Reference address:Lesson 007 Bare Metal Development Steps and Tool Usage (Using SourceInght Notepad++)

Previous article:Lesson 006 Development Board Familiarity and Experience
Next article:Lesson 008: 1st ARM bare board program and extension (light up the LED)

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号