The construction and use of ARM integrated development environment under Windows environment

Source: Internet
Author: User
Tags gdb debugger

An ARM development environment can be built using the Eclipse IDE for C + + developers in Windows environments
The installation steps are as follows:

1. Installing Java SE
Website: http://www.oracle.com/technetwork/java/javase/downloads/jre-7u3-download-1501631.html
Download this file: Jre-7u3-windows-i586.exe
2. Install the Eclipse IDE for C + + developers
Website: HTTP://WWW.ECLIPSE.ORG/DOWNLOADS/PACKAGES/ECLIPSE-IDE-CC-DEVELOPERS/HELIOSSR2
Download this file: Eclipse-cpp-helios-sr2-win32.zip downloaded to the appropriate directory, do not need to install, send a shortcut to the desktop.
3. Install the plug-in for arm development under eclipse
Website: http://sourceforge.net/projects/gnuarmeclipse/files/Current releases/0.5.3/
Download this file: Org.eclipse.cdt.cross.arm.gnu_0.5.3.201007311800.zip
After downloading, unzip the Plugins/org.eclipse.cdt.cross.arm.gnu_0.5.3.201007311800.jar file into the plugins directory in the Eclipse installation directory.
4. Installing the ARM-NONE-EABI-GCC Compiler
Website: http://www.yagarto.de/download/yagarto/yagarto-bu-2.21_gcc-4.6.2-c-c++_nl-1.19.0_gdb-7.3.1_eabi_20111119.html
Please do not install the directory with spaces in the path!
Download and install this file: Yagarto-bu-2.21_gcc-4.6.2-c-c++_nl-1.19.0_gdb-7.3.1_eabi_20111119.exe
Website: http://www.yagarto.de/download/yagarto/yagarto-tools-20100703-setup.exe
Download and install this file: Yagarto-tools-20100703-setup.exe

Original address: http://blog.sina.com.cn/s/blog_6c234ba901012zqm.html

Here's how to use it:

1. Specify a project storage directory

Eclipse for ARM is a standard window application that can be run by clicking the program button. Once opened, you must specify a project storage path, as shown in 5-11.


2. Create a project

After entering the main interface, select the "file→new→c Project" command, Eclipse will open a standard dialog box, enter the name of the new project you want to create and click the "Finish" button to build a new project, it is recommended to use a separate folder for each new project.

3. Create a new Makefile file

After you create a new project, select the "file→new→other" command, click File under General in the Pop-up dialog box, and then click Next, and then select the project you want to specify, enter the file name in the File name text box makefile, click "Finish" Button.

4. Create a new script file

Select the "file→new→other" command, click File under General in the Pop-up dialog box, and then click Next, then select the project you want to specify, enter the filename s5pc100.init in the File name text box, and click the "Finish" button.

5. Create a new Connection script file

Select the "file→new→other" command, click File under General in the Pop-up dialog box, and then click Next, then select the project you want to specify, enter the filename map.lds in the File name text box, and click the "Finish" button.


6. Create a new assembly source file


Select the "file→new→other" command, click File under General in the Pop-up dialog box, and then click Next, then select the project you want to specify, enter the filename start.s in the File name text box, and click the "Finish" button.


5.4 Compiling the project


(1) Enter the assembly code in the Assembly source file (START.S):


. equ Gpg3con, 0xe03001c0
. equ Gpg3dat, 0XE03001C4

. globl _start
_start:
LDR R0,=gpg3con
LDR r1,=0x10
STR R1,[r0] @//Write control register, IO pin enable to output
LOOP:
LDR R0,=gpg3dat
MOV R1, #0X02 @//lit led1
STR R1,[r0]
LDR R2,=0XFFFFF @//Delay
LOOP1:
SUB R2,R2, #1
CMP R2, #0
BNE LOOP1
MOV R1, #0X0 @//off led1
STR R1,[r0]
LDR R2,=0XFFFFF @//Delay
LOOP2:
SUB R2,R2, #1
CMP R2, #0
BNE LOOP2
B LOOP
. end
(2) Enter the following information in the Map.lds:
Output_format ("Elf32-littlearm", "Elf32-littlearm", "Elf32-littlearm")
/*output_format ("Elf32-arm", "Elf32-arm", "elf32-arm") */
Output_arch (ARM)
ENTRY (_start)
SECTIONS
{
. = 0x34000;
. = ALIGN (4);
. Text:
{
START.O (. Text)
* (. Text)
}
. = ALIGN (4);
. Rodata:
{* (. rodata)}
. = ALIGN (4);
. Data:
{* (. data)}
. = ALIGN (4);
. BSS:
{* (. BSS)}
}
(3) write the makefile file compilation rules, enter the following information in the makefile:


All:start.s
Arm-none-eabi-gcc-4.6.2-o0-g-c-o START.O Start.s
Arm-none-eabi-ld Start.o-tmap.lds-o start.elf
Arm-none-eabi-objcopy-o binary-s start.elf Start.bin
arm-none-eabi-objdump-d start.elf >start.dis
(4) Enter the following information in the S5pc100.init file:
Target Remote 127.0.0.1:3333
Monitor halt
Monitor arm MCR 15 0 1 0 0 0
Monitor Step 0
(5) Save, compile Project→bulit all.


5.5 Commissioning Project


5.5.1 Configuring Fs-jtag Debugging Tools


5-12, select s5pc100 in the target option and select your own project directory (D:\program\led) in the Workdir option, this is the author's current environment, please fill in according to their actual environment.


When the above work is done, when you click the Connect button, the button changes to disconnect,5-12, which means that the target board is already connected. Finally click the Telnet button (this step can be skipped), will pop up 5-13, the interface means that the target board is already connected.


5.5.2 Configuration Debugging Tools (1)

In the Eclips menu, select "Run→debug configurations" to pop Up the 5-14 dialog box.



Select the Zyin Embedded debug (Native) option, then right-click to select the "New" command from the popup shortcut menu, and in the main tab, in the Project box, click the "Browse" button to select the LED project; Click the "Browse" button in the application to locate the Led.elf file in the project directory, as shown in 5-15.

On the Debugger tab, in the main sub-tab of the GDB debugger box, click the "Browse" button to select the previously installed Arm-none-eabi-gdb.exe (choose your own installation directory here) at GDB Command Select the S5pc100.init file in your own project directory, as shown in 5-16.


In the Command tab, enter the following, as shown in 5-17.
Load
Break _start
C


5.5.2 Configuration Debugging Tools (2)

After clicking the "Apply" button and then clicking the "Debug" button to start the debug run, the debug main interface will appear, as shown in 5-18.

The program will stop at the breakpoint, and then use the tools such as single-step and full-speed to debug the program, click Full-speed operation, will appear LED1 shiny.

You can see a general debug interface, 5-19 of the buttons are related to debugging, there is a single step, step over and step in the way. There is also the suspend and disconnect feature that comes with Eclipse. Here's a brief look at the purpose of each window.



5-20 The window shown is used to view the function variable, and you can see the value of the current i,j.


5-21 The window is used to view the arm register, the value from the R0~r12 Universal register can be clearly observed, and the value of the current status register of the CPSR is also observed.


5.6 Summary of this chapter

This chapter focuses on how to write Gnu-arm assembly style programs, and how to debug under Eclipse based on s5pc100, and describes the detailed usage of Fs-jtag. Most of the experiments in the later chapters of this book are based on this environment. 工欲善其事, its prerequisite, so the use of the environment must be mastered.

Original address: http://book.51cto.com/art/201210/359534.htm


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.