Arm DS-5 getting started DS-5 tutorial (updated to 8, not finished, to be continued !)

Source: Internet
Author: User

The following tutorial shows you how to run and debug applications using ARMDS-5 tools.

• 1 import the sample project to eclipse

• 2. Use eclipse to create a new C/C ++ Project

• 3 Use eclipse to compile the gnometris Project

• 4 compile the gnometris project under the command line

• 5 load the gnometris program on the Real-Time System Model

• 6 load the gnometris program to ARM Linux

-Set and run gnometris on ARM Linux through SSH.

-Connect to the gnometris program that has been running on ARM Linux

• 7 debug gnometris

• 8. debug the installable kernel module

• 9 Performance Analysis of thread applications running on ARM Linux

• 10 debug Android native C/C ++ applications and libraries

• 11 DS-5 License Management

 

1. Import the sample project to eclipse

Many of the tasks described in the document are using the sample project provided by the DS-5. To use the sample projects in eclipse, you must first import them

1. Start Eclipse:

• On Windows, choose Start Menu → all programs → arm DS-5 → eclipse for DS-5.

• On Linux, input eclipse in the Unix bash shell.

2. We recommend that you create a new workspace for the example project so that they are separated by your own project. To do this, you can:

• Start eclipse and create a new workspace directory.

• If eclipse has been enabled, select "File> change work zone> Other" from the main menu.

3. Select cheatsheet... from the Help menu ....

4. Expand the arm group.

5. Select automatically import the DS-5 example projects into the current workspace from the arm memo list.

6. Click OK.

7. Follow the steps in the memo sheet to import all the ds-5 sample projects to your workspace.

After the sample project is imported, if necessary, you can switch the working set according to the remaining memo sheets.

2. Create a new C or C ++ project in eclipse

To create a new C or C ++ project:
1. Select File → new → project... from the main menu...
2. Expand the C/C ++ group.
3. Select C project or C ++ project.
4. Select the project type you want to create.
5. click Next.
6. Enter the project name.
7. Select the use default location option to create a project in the displayed default directory. You can also cancel this option and select the project directory you like.
8. Select the project type you want to create.
9. Click Finish to create your new project. This item is visible in the project explorer view.

3. Compile the gnometris project in eclipse

Gnometris is an ARM Linux application that can be run and debugged on your target board. The provided project does not contain the binary file of the image of the gnometris application. To create an image, you must compile the project.
Compile the project:
1. Download the Optional package from the arm website or install the optical disk linux_distribution_example.zip from the ds-5directory, which contains compatible header files and libraries.
2. Import the gnometris and distribution sample project from the relevant ZIP file to eclipse.
3. Select the gnometris project in the project explorer view.
4. Select build project from the project menu.
The gnometris sample project contains the MAKEFILE file of the compilation project. Makefile provides common make rules: clean, all, and rebuild.
When you compile the gnometris project, it generates the following applications:

• A stripped version application that does not contain debugging information. This is to be downloaded to the target board.

• An application that contains debugging information for source code-level debugging of large-sized versions.

4. Compile the gnometris project under the command line

Gnometris is an ARM Linux application that can be run and debugged on your target board. The provided project does not contain the binary file of the image of the gnometris application.
Compile the project:
1. Download the Optional package from the arm website or install the optical disk linux_distribution_example.zip from the ds-5directory, which contains compatible header files and libraries.
2. Import the gnometris and distribution sample project from the relevant ZIP file to eclipse.
3. Open the DS-5 command prompt command line console or Unix bash shell.
4. Switch to... \ armlinux \ gnometris.
5. Enter make at the prompt. The example project contains the MAKEFILE file of the compilation project. Makefile provides common make rules: clean, all, and rebuild.
When you compile the gnometris project, it generates the following applications:

• A stripped version application that does not contain debugging information. This is to be downloaded to the target board.

• An application that contains debugging information for source code-level debugging of large-sized versions.


5. Load the gnometris program on the Real-Time System Model

You can load the gnometris program on ARM Linux running on real time system model (RTSM. RTSM allows you to run and debug applications on your host workstation without using any hardware standard device.
This preset RTSM connection automatically starts Linux, starts gdbserver, and then starts the application.
Load gnometris:
1. Start eclipse.
2. Click project explorer view.
3. Expand the gnometris project folder.
4. Right-click on the gnometris-RTSM-example.launch.
5. Select debug as from the menu.
6. Select gnometris-RTSM-example from the sub-menu.

7. debugging requires the DS-5 debug perspective. If the perspective switch dialog box is displayed, click yes to switch the perspective.

6. Load the gnometris program to ARM Linux

You can load the gnometris program to ARM Linux.
The DS-5 provides pre-configured target connection settings and debugger connections support gdbserver running on an ARM-based platform. Loader:
1. Obtain the IP address of the target board. You can use the ifconfig command to configure the application on the Linux console. The IP address is expressed by Inet add.
2. guide the target board to the Linux release.
3. Start eclipse.
4. Transfer the application and related files to the ARM Linux target board, run the application, and connect to the debugger. There are several ways to do this:
• On the Beagle Development Board, you can use Secure Shell (SSH), connect the preset target board with the remote system manager (RSE) provided by DS-5, and then run the application. After the application is running, the debugger can connect to the running target board.
• For other target boards, you can use an external file transfer tool, such as putty.

7. Set and run gnometris on ARM Linux Using SSH connection

On some target boards, you can use Secure Shell (SSH) and use ds-5 to provide remote Resource Manager (RSE) to connect to the target board.
Create an SSH connection to the Linux target board of ARM Linux and run the gnometris application:
1. Add the remote systems view in the DS-5 debug perspective:
A. OK is in the DS-5 perspective. Use the perspective toolbar in the main menu or choose Window → open perspective → DS-5 debug to switch the perspective.
B. select Window → show view → other... to open the show view dialog box.
C. Select the remote systems view in the remote systems group.
D. Click OK.
2. In the remote systems view, set a Linux connection that uses SSH to connect to the remote target:
A. in the remote systems view toolbar, click define a connection to remote system.
B. In the select remote system type dialog box, expand the general group and select Linux.

Figure 3-1 select a connection type

 

C. click Next.
D. In the remote Linux system connection dialog box, enter the IP address or computer name of the remote target board in the Host Name edit box.

 

Figure 2 define the connection type

E. click Next.
F. Select SSH protocol file access.

Figure 3 File System definition

G. click Next.
H. Select the shell protocol for the Linux system.

 

Figure 4 define a connection

I. click Next.
J. Select SSH shells.

 

Figure 5 define Shell Service

K. click Next.
L. Select SSH terminals.

 

Figure 6 Terminal Services

M. Click Finish.
3. In the remote systems view:
A. Right-click the target Linux Device and select connect from the context menu ".
B. In the Password Input dialog box, enter a user name and password, if necessary.
C. Click OK to close the dialog box.
D. Copy and strip the gnometris application, gnometris, and libgames-support.so library files from the local file system to the target file system.
E. Ensure that the target file has the execution permission. To do this, right-click each file, select Properties from the context menu, and change the required check box.

 

Figure 7 modifying file attributes in remote systems view

4. Open a shell that has been connected to the target board terminal and start the application with gdbserver:
A. in the remote systems view, right-click SSH terminals.
B. Select launch terminal to open the terminal shell.
C. Under the terminal shell, switch to the directory where the gnometris program is located and execute the following command:
Export display = IP: 0.0
Gdbserver: Port gnometris
Where:
IP is the IP address of the host that displays the gnometris game
Port: the connection port between the gdbserver and the program, such as 5000.
Note: If the target board has a display screen, you do not need to use export display.

8. Connect the gnometris program that has been running on ARM Linux

Connect to the gnometris program that has been running on ARM Linux:
1. Select debug configurations from the run menu ....
2. Select the DS-5 debugger from the Tree Configuration and click New to create a configuration. You can click duplicate from the toolbar to select the existing DS-5 debugger configuration and.
3. Enter a proper name for the new configuration in the Name box.
4. Click the connection tab to view the target board and connection options.
5. On the select target panel:
A. Select the desired platform, such as beagleboard.org-omap_3530.
B. Select connect to already running gdbserver for debugging.
6. Configure the connection between the gdbserver and the program on the connections panel.
A. Enter the IP address of the target board.

B. Enter the port number.


Figure 8 typical Beagle Development Board connection Configuration

7. Click the files tab to View File Operations.
8. On the files panel:
A. Select load symbols from file and select the program image that contains debugging information. For example, H: \ workspace \ gnometris.
B. Click Add a new resource to the list to add another file directory.

C. Select load symbols from file and then select the shared library required by gnometris, for example, H: \ workspace \ gnometris \ libgames-support.so.


Figure 9 typical Beagle Development Board file selection

9. Click the debugger tab to view the debugging options of the configuration.
10. On the run control panel:
A. Select debug from symbol.
B. Enter main in the provided editing box.

11. On the host working directory panel, select use default.


Figure 10 typical debugging settings of the Beagle Development Board

12. Click debug to start debugging and run it to the main () function.
13. debugging requires the DS-5 debug perspective. If the confirm to switch perspective dialog box appears, click yes to switch perspective.

Not finished, to be continued!

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.