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 Eclipse IDE for C + + developers in Windows environments

This address: http://blog.csdn.net/u011833609/article/details/30290655

The installation process is 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 corresponding folder, do not need to install, send a shortcut to the desktop can.
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 folder under the installation Eclipse folder.
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 a folder 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

Usage such as the following:

1. Specify a project Storage folder

Eclipse for ARM is a standard form application. You can click the program button to start execution. After opening, you must specify a project storage path, 5-11 see.



watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvdtaxmtgzmzywoq==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">
2. Create a project

After entering the main interface. Select the file→new→c Project command, and Eclipse opens 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 and recommend using a separate directory for each new project.

3. Create a new Makefile file

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



4. Create a new script file

Select the "file→new→other" command, and in the popup dialog box, under General, click File. Then click Next, and then select the project you want to specify, and then enter the file name S5pc100.init in the File name text box. Click the "Finish" button.

5. Create a new Connection script file

Select the "file→new→other" command, and in the popup dialog box, under General, click File. And then click Next. Then select the project you want to specify, enter the file name 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, and then select the project that you want to specify. In the File Name text box, enter the file name Start.s, and click the "Finish" button.




5.4 Compiling 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 information such as the following in 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 information such as the following in 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 information such as the following 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 Debugging Project


5.5.1 Configuring Fs-jtag Debugging Tools


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


When this is done, when you click Connectbutton, the button changes to what disconnect,5-12 sees, which means that the target board is already connected.

Finally click Telnetbutton (This step can be skipped), will pop up 5-13 see, the interface means that the target board has been connected.


5.5.2 Configuration Debugging Tools (1)

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

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvdtaxmtgzmzywoq==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">


Select the Zyin Embedded debug (Native) option, and then right-click to select the "New" command from the popup shortcut menu, in the Project box on the Main tab. Click the "Browse" button to select Ledproject. Click the "Browse" button in the C + + application to locate the Led.elf file under project folder, 5-15 see.

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 folder) at GDB Command In file, select the S5pc100.init file under your project folder, 5-16 you see.



watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvdtaxmtgzmzywoq==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">
Enter, for example, the following in the Command tab. 5-17 of what you see.
Load
Break _start
C


5.5.2 Configuration Debugging Tools (2)

After you click the "Apply" button. Then click "Debug" button to start debugging execution, the debug main interface will appear. 5-18 of what you see.



The program will stop at the breakpoint. Then use a single-step and full-speed tool to debug the execution program, click Full Speed execution, will appear LED1 shiny.

Can see a general debug interface. 5-19 See the button is related to debugging, there are single step, step over and step in mode. There is also the suspend and disconnect feature that comes with Eclipse. Here's a brief introduction to the purpose of each form.

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvdtaxmtgzmzywoq==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">


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


5-21 the form you see is used to view the arm registers. The value of the universal register from the R0~r12 can be very clearly observed, and the value of the current status register of the CPSR can also be observed.


5.6 Summary of this chapter

This chapter mainly describes how to write the Gnu-arm assembly style of the program, and how to debug based on s5pc100 under Eclipse, and describes the specific use 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 skillfully.

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


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

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.