Debug Linux applications over Ethernet using ARM DS-5 Intel SoC FPGA Edition
Introduction
ARM DS-5 Intel SoC FPGA Edition enables you to debug Linux applications. This page presents and example of creating, compiling and running a simple Linux example application.
Prerequisites
The following were used to create this example:
- Host computer running Ubuntu 14.04LTS - other versions may work too
- SoC EDS Pro Edition v18.1 - for the ARM DS-5 SoC FPGA Edition
- S10 SoC Development Kit with:
- OOBE HPS Daughter Card
- QSPI SDM Flash Card
The instructions will be similar when using other SoCs.
In order to perform Linux application debugging, Linux needs to be running on your target board. Use the
Getting Started page to select the appropriate instructions on how to make that work on your board.
The following requirements are also needed:
1. The Linux running on the target needs to have the following packages included:
- openssh-sftp-server (or another compatible version of sftp-server)
- gdbserver
These packages can either be added to the Yocto recipes at compile time, or installed at runtime by using the opkg utility.
2. ARM DS-5 requires requires a non-empty Linux password. On the Linux console, set a root password by running the
passwd
command.
3. On the Linux console, run the command
ifconfig
to determine the IP address of the board.
Import Sample Application
1. Start an Embedded Command shell:
~/intelFPGA_pro/18.1/embedded/embedded_command_shell.sh
2. Start ARM DS-5 Eclipse:
eclipse &
3. In Eclipse, select
File > Import.
4. In the
Import dialog box, select
General > Existing Projects into Workspace and click
Next.
5. In the
Import Projects dialog box, select the
Select Archive File option.
6. Click Browse, then navigate to
~/intelFPGA_pro/18.1/embedded/examples/software, select the file
Altera-SoCFPGA-HelloWorld-Linux-GNU.tar.gz and click
OK.
Update Sample Application
The sample application provided with SoC EDS targets Cortex-A9 devices from CV/AV/A10 SoCs. It needs to be updated in order to be ran on the Cortex-A53 from S10 SoC.
1. Open the
Makefile file by double-clicking it on the left panel in Eclipse.
2. Change the file to make it create a 64bit executable for Cortex-A53:
Compile Sample Application
1. Select the project in Project Explorer.
2. Select
Project > Build Project or press
CTRL-B.
3. The project compiles and the
Project Explorer shows the newly created hello executable file as shown in the figure below. The
Console dialog box shows the commands and responses that were executed.
Setup Remote System Explorer
The ARM DS-5 AE can run and debug programs directly on the target with the help of the Remote System Explorer (RSE). Before this feature can be used, the RSE needs to be configured to connect to the target board running Linux.
1. In your Eclipse workspace, select
Window > Open Perspective > Other.
2. In the
Open Perspective dialog box, click the
Remote System Explorer and click
OK.
3. In the
Remote System Explorer view, right click
Local and select
New > Connection …. Note that clicking the
+ sign achieves the same result.
4. In the first page of the
New Connection wizard, named
Remote System Type, select
SSH only and click
Next.
5. Enter the IP address of the board in the
Host Name field. Click
Finish to create the connection.
6. In the
Remote Systems panel, click the
Target IP > Sftp Files > Root. This opens a dialog box to enter the username and password. Enter 'root' as username and the password you have configured on the board.
7. Eclipse asks for confirmation of authenticity of the board. Click
Yes.
8. Remote System Explorer shows the files on the board on the left pane.
Debug Sample Application
At this stage, we have a compiled Linux application and a properly configured Remote Systems Connection. This section shows how to create a Debugger Configuration and use it to run and debug the application.
1. Select
Run > Debug Configurations…
2. In the
Debug Configurations dialog box right click the
DS-5 Debugger and click
New to create a new debug configuration.
3. Name the newly created debugger configuration,
DebugLinuxHello, by editing its name in the
Connection tab.
4. In the
Connection tab, select:
- For the Free Web Edition license, select Generic > gdb server > Linux Application Debug > Download and Debug Application
- For the Subscription Edition or 30-day Evaluation Edition, select Intel > Stratix 10 > Linux Application Debug > Download and Debug Application.
5. In the
Connection tab, select the newly created RSE connection and keep the default values. Note: On some systems, you may need to uncheck the
Use Extended Mode checkbox to prevent a
Unable to connect error.
6. Go to
Files tab, and set the
Target Configuration parameters:
- Select the Application on host to download to be the hello executable file. Use the Workspace… browse button.
- Edit the Target download directory to be /home/root.
- Edit the Target working directory to be /home/root.
7. Click the
Debug button. A dialog window appears asking to switch to Debug perspective. Click
Yes.
8. Eclipse downloads the application to the board and stops upon entering the
main function.
At this stage, all the usual debugging features of DS-5 can be used, such as breakpoints, view variables, registers, tracing, and threads.
9. Click the
Continue green button or press
F8 to run the application. The hello message is printed on the
Application Console.