5.Eclipse Integrated development Environment

Source: Internet
Author: User
Tags install window jlink gdb debugger

5.Eclipse Integrated development Environment

The Eclipse integrated development environment not only compiles bare metal projects, but also debugs the entire bare-metal project so that it can be modified more effectively when the program is abnormal. The next step is to build the entire Eclipse Integration environment: The framework for this debugging environment, such as 1-1:

Figure 1-1

See from the above frame diagram, to implement the Eclipse online debugging bare-metal program, need to install the software is eclipse+cdt,jlink drive ,gdb debugging software , need to connect the hardware is The Jlink connects the PC and the Development Board .

Note: To avoid interference, it is best to format Nandflash: Figure 1-2:

Then select y:

Figure 1-2

Formatting Nandflash is not required, just to better determine the factors. Above is the process of formatting. After the format has been reset, the board starts from Nandflash.

To install GDB Server:

There is gdb software in the Arm-tools folder of the companion information: Figure 1-3:

Figure 1-3

ARM-LINUX-GDB:

1. Unzip the command:

TAR-ZXVF arm-linux-gdb-7.5.tar.gz, then go to the folder and perform the Build-all:./build-all installation: Figure 1-4:

Figure 1-4

You can open the sh script that you just ran to see what works: Figure 1-5:

#/bin/sh

?

RM-FR gdb-7.5

Rm-r/opt/arm-linux-gdb/

?

Tar xvzf gdb-7.5.tar.gz

CD gdb-7.5

?

./configure--target=arm-linux--prefix=/opt/arm-linux-gdb/-V

?

Make && make install

?

cd/opt/arm-linux-gdb/

Figure 1-5

The function of the script is to first force the deletion of the current directory gdb-7.5, delete the/opt/arm-linux-gdb/folder. Ensure that there are no interference factors in the environment. Then unzip the gdb-7.5.tar.gz in the current directory. Then go to unzip the generated folder gdb-7.5. The GDB is then configured to execute./configure--target=arm-linux--prefix=/opt/arm-linux-gdb/-V generates makefile. The next step is to execute make to compile, and finally execute the make install to install. After the installation, switch to the ARM-LINUX-GDB directory.

?

After the decompression installation is completed, the GDB installation file is generated in the/opt/directory, and the Arm-linux-gdb in the Bin folder of the folder is the Debug tool: Figure 1-6:

Figure 1-6

The above completed the installation of ARM-LINUX-GDB, but also need to configure the tool environment variables before it is convenient to use. Open the/etc/profile configuration file: Vim/etc/profile. Before the configuration of the last ARM-LINUX-GCC environment, add:

Export path= $PATH:/opt/arm-linux-gdb/bin. note must be configured in front of the ARM-LINUX-GCC. This is because the tool chain also has arm-linux-gdb tools. To ensure that you are using the ARM-LINUX-GDB that are now installed. Figure 1-7:

This version is 6.8:

Figure 1-7

Test the success of the installation: at the command line: ARM-LINUX-GDB, see that the gdb you just installed is version 7.5. Figure 1-8:

Figure 1-8

?

Install Jlink Software:

First decompression: TAR-ZXVF jlink_linux_v434a.tgz. Figure 1-9:

Figure 1-9

?

?

When the decompression is complete, go to the folder: Figure 1-10:

Figure 1-10

The next step is to copy the corresponding files to the corresponding folder. Equivalent to installation: Figure 1-11:

Figure 1-11

As I have already installed the front, so the direct cover can be. This will install the Jlink. As we know from the front, when the Jlink is installed, you can connect the Development Board. Test the following.

?

The first is to give the Development Board power, figure 2-1:

Figure 2-1

?

?

?

?

When power is given to the board, the Jlink is connected to the Jlink interface of the Development Board: Figure 2-2:

Figure 2-2

So the hardware is connected. The next step is to pull the Jlink from Windows 7 to the virtual machine:

In the lower right corner of the VBox virtual machine, locate the Jlink in the USB port and pull it from windows to the virtual machine: Figure 2-3:

Figure 2-3

Then run the Jlinkgdbserver to see if the kernel can be detected: Figure 2-4:

Figure 2-4

The above saw Jlink successfully connected the Development Board, detected the kernel ARM11.

?

?

?

?

Install Eclipse:

The so-called installation is decompression: TAR-ZXVF eclipse-cpp-helios-sr2-linux-gtk.tar.gz-c/usr/local/. Complete as 2-5:

Figure 2-5

After the decompression is completed, it is equal to the installation. Next run Eclipse, the first time you run the option to specify a default project path, I choose: Figure 2-6:

Cd/usr/local/eclipse

[Email protected] eclipse]#./eclipse

Figure 2-6

Of course in the above you can also choose the directory where you want to save the project. then click OK. This launches eclipse: Figure 2-7:

Figure 2-7

This will be installed by Eclipse. It's just a simple installation. For Eclipse to be able to coordinate jlink,arm-linux-gdb and other tools to facilitate bare metal development work. A plug-in must be installed. So you need a virtual machine to connect to your network.

?

Installing the plugin CDT:

After you open eclipse, select Help from the toolbar and select Install New software from the drop-down menu: The Install window will appear. Figure 2-8:

Figure 2-8

?

Then enter the location of the plugin in the work with box: HTTP://OPENSOURCE.ZYLIN.COM/ZYLINCDT. Enter when you are finished, and you will see the plugin you want to download: Figure 2-9:

Figure 2-9

Then check the plugin to click Next: Figure 2-10:

Figure 2-10

?

Then click Next: Figure 2-11:

Figure 2-11

Then select I accept the agreement and click Finish to install it: Figure 2-12:

Figure 2-12

?

?

?

Installation Figure 2-13:

Figure 2-13

The installation of the execution requires a reboot: Figure 2-14, select Restart Now.

Figure 2-14

This installs the plug-in.

?

?

?

?

?

?

?

?

?

?

?

?

?

Eclipse Bare Metal Debugging:

The code for testing eclipse bare metal debugging is:/home/samba/ok6410_bare, so you can import eclipse directly. Select the Eclipse toolbar file->new->makefile Project with Existing Code. Figure 3-1:

Figure 3-1

Select Browse in the newly opened window to find the existing project directory: then click OK in the bottom right: Figure 3-2:

Figure 3-2

Back to the original interface, click Finish: Figure 3-3:

Figure 3-3

In this way, a project is imported into eclipse. Figure 3-4:

Figure 3-4

?

?

The above successfully imported a project.

The next step is to compile:

Compile is also very simple, with the mouse, select the project name, right-click, and then choose Build Project, compile: Figure 3-5:

Figure 3-5

In fact, the compilation of Eclipse is called the project inside the makefile file.

It was compiled, and the next step was to debug the project with the CDT plugin that was just installed. You need to configure the debug parameters before debugging.

Parameter settings:

The first thing to do is click on the Eclipse toolbar below with a bug icon: Click on its drop-down arrow to see the option, select Debug Configurations. Figure 3-6:

Figure 3-6

After clicking, the following screen will appear: Figure 3-7:

Figure 3-7

Then double-clicking Zylin Embedded Debug (Native) will generate a default debug configuration with the name Ok6410_bare default and the following window will appear. Figure 3-8:

Figure 3-8

Then select Browse in the C + + application, find the process to debug, and select the Elf file in the process. Click OK figure 3-9:

Figure 3-9

Then switch to the Debugger Options window. Remove the option to stop the main function by default. Change GDB Debugger to: arm-linux-gdb: Figure 3-10:

After the change:

Figure 3-10

?

Regardless of debugging the Development Board, before the bare metal debugging must be the development Board to initialize, here, the initialization of the command, I use the fly Lingpeo with the OK6410, its name is init-6410: Figure 3-11:

Figure 3-11

Content of Init-6410:

# Tiny6410_config

# Connect to the J-link gdb server

Target Remote localhost:2331

# Set JTAG speed to KHz

Monitor Endian Little

Monitor Speed 30

# Reset the target

Monitor Reset

Monitor Sleep 10

#

# CPU Core initialization (to is done by user)

#

# Set the processor mode

Monitor Reg CPSR = 0xd3

#config MMU

#flush V3/V4 Cache

Monitor CP15 7, 7, 0, 0 = 0x0

#/* Flush V4 TLB */

Monitor CP15 8, 7, 0, 0 = 0x0

#disable MMU Stuff and caches

Monitor CP15 1, 0, 0, 0 =0x1002

#Peri Port Setup

Monitor CP15, 2, 0, 4 = 0x70000013

#disable watchdog

Monitor MemU32 0x7e004000 = 0x00000000

Monitor Sleep 10

#disable Interrupt

Monitor MemU32 0x71200014 = 0x00000000

Monitor MemU32 0x71300014 = 0x00000000

Monitor MemU32 0x7120000c = 0x00000000

Monitor MemU32 0x7130000c = 0x00000000

Monitor MemU32 0x71200f00 = 0x00000000

Monitor MemU32 0x71300f00 = 0x00000000

#set Clock

Monitor MemU32 0x7e00f900 = 0x0000801e

Monitor MemU32 0x7e00f000 = 0x0000ffff

Monitor MemU32 0x7e00f004 = 0x0000ffff

Monitor MemU32 0x7e00f020 = 0x01043310

Monitor MemU32 0x7e00f00c = 0xc2150601

Monitor MemU32 0x7e00f010 = 0xc2150601

Monitor MemU32 0x7e00f024 = 0x00000003

Monitor MemU32 0x7e00f014 = 0x00200102

Monitor MemU32 0x7e00f018 = 0x00000000

Monitor MemU32 0x7e00f01c = 0x14000007

#config SDRAM

Monitor MemU32 0x7e00f120 = 0x00000008

Monitor MemU32 0x7e001004 = 0x00000004

Monitor MemU32 0x7e001010 = 0x0000040f

Monitor MemU32 0x7e001014 = 0x00000006

Monitor MemU32 0x7e001018 = 0x00000001

Monitor MemU32 0x7e00101c = 0x00000002

Monitor MemU32 0x7e001020 = 0x00000006

Monitor MemU32 0x7e001024 = 0x0000000a

Monitor MemU32 0x7e001028 = 0x0000000c

Monitor MemU32 0x7e00102c = 0x0000018f

Monitor MemU32 0x7e001030 = 0x0000000c

Monitor MemU32 0x7e001034 = 0x00000002

Monitor MemU32 0x7e001038 = 0x00000002

Monitor MemU32 0x7e00103c = 0x00000002

Monitor MemU32 0x7e001040 = 0x00000002

Monitor MemU32 0x7e001044 = 0x00000013

Monitor MemU32 0x7e001048 = 0x00000013

Monitor MemU32 0x7e00100c = 0x00010012

Monitor MemU32 0x7e00104c = 0x00000b45

Monitor MemU32 0x7e001200 = 0x000150f8

Monitor MemU32 0x7e001304 = 0x00000000

Monitor MemU32 0x7e001008 = 0x000c0000

Monitor MemU32 0x7e001008 = 0x00000000

Monitor MemU32 0x7e001008 = 0x00040000

Monitor MemU32 0x7e001008 = 0x00040000

Monitor MemU32 0x7e001008 = 0x000a0000

Monitor MemU32 0x7e001008 = 0x00080032

Monitor MemU32 0x7e001004 = 0x00000000

# Setup GDB for faster downloads

#set Remote Memory-write-packet-size 1024

Set remote memory-write-packet-size 4096

Set Remote Memory-write-packet-size fixed

Monitor Speed 12000

Break _start

Load

Copy the contents into the Commands window and click Apply, then close the window: Figure 3-12:

Figure 3-12

It was here that the work of the whole project was well configured. The Sound of ... Next run.

?

Before you start debugging, make sure that Jlink successfully connects to the board: Figure 4-1:

Figure 4-1

Then click again: Debug configuretions: Figure 4-2.

Figure 4-2

Double-click Configuration Project Name: Ok6410_bare Defunct: If bare metal debugging starts successfully, Eclipse automatically jumps to debug mode: Figure 4-3:

Figure 4-3

The first time the interface is a bit messy, you can adjust yourself: The adjusted interface: Figure 4-4:

Figure 4-4

Can see the interface below the red and black alternately is configured in the Conmands, the initialization of the board hardware platform. Then you can really do a bare-metal single-step debugging.

?

?

Debugging:

There are various debug commands in the run of the menu bar: Figure 5-1:

Figure 5-1

You can see that one-step debugging can press F5 (enter function Debugging), F6 (do not enter function) and so on.

Press F5: Enter the Reset function, figure 5-2:

In press F5, enter the SET_SVC function: Figure 5-3:

Figure 5-3

In the process of running, you can view the register, parameters and other information changes: Figure 5-4:

Figure 5-4

Convert to 16: Select the parameter you want to convert, right-click, select Format->hexadecimal. Figure 5-5:

Figure 5-5

The Eclipse Bare Metal Debugging project is implemented above. When you are finished debugging, do not turn off eclipse, first turn off the debug, Red Square. Because of this, when you need to debug again, directly select the Debug icon, and then select the Debugging Project can: Figure 5-6:

Figure 5-6

Click on the Debug project name above to implement debugging. No need to configure. Here, a simple engineering debugging operation is done. Look is a simple process, make a note also done for half a day. Rookie cheer up.

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

The next step is to try a direct click on the project name in the debug: Correct start figure 6-1:

Figure 6-1

Next, try jumping to the light_led function to light the lights: Figure 6-2:

This time in order to see the effect, put mov r0, #0xe改为mov r0, #0x3.

Before you run this sentence:

Figure 6-2

After running:

Figure 6-3

?

Remember to exit by:

?

?

?

?

?

?

?

?

?

?

?

?

?

?

Finally, the creation of the Eclipse shortcut, because it's always going to go through the command line to start Eclipse, is annoying: The process is created as follows: Figure 6-4:

Figure 6-4

As above, right mouse button, choose Create Launcher ..., will appear: Figure 6-5:

Figure 6-5

Fill in the information and select your own eclipse executable file in the command's browse: Figure 6-6:

Figure 6-6

Then click Open to get 6-5:

Figure 6-5

Finally click OK, so there is one more icon on the desktop, this is the Eclipse shortcut. Just double-click to open Eclipse Software: Figure 6-6:

Figure 6-6

Today's notes are here. Continue tomorrow.

5.Eclipse Integrated development Environment

Related Article

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.