...
Download and install a Linux version of the Eclipse IDE to the Linux host.
...
Start Eclipse and select a workspace directory, different from the directory where your source file is located.
To create an empty project, open File -> New -> C/C++ Project, select С Managed Build and click Next.
In C Project window enter the a name of the project, for example,
c-example
, select Empty Project -> Cross GCC and click Finish.On this step you are prompted to choose build configurations. Click Next to proceed with the default settings.
In the Cross GCC Command window dialog, enter
arm-buildroot-uclinuxfdpiceabi-
in the Cross compiler prefix box and/usr/local/arm-buildroot-uclinuxfdpiceabi_sdk-buildroot/bin
in Cross compiler path, click Finish.To add the source file to the project, open File -> Import. In the Import window dialog select General -> File System, click Next.
Navigate Click Browse and navigate to the directory where the source file is located (
/home/sasha/work
in the example below). Select , then select the directory in the left window.Click Finish to complete.
...
For remote debugging, you need to copy deploy the c-example
binary to the target. This can be done in several ways:
Using
scp
orsftp
to copy the binary to the target;Using NFS share configured on the host and mounting this share from the target.
...
4.1. Using NFS
...
This application note shows demonstrates how to use NFS to configure share to copy the binary to on the host and mount this share from the target.
For In the example below, the Eclipse workspace directory, /srv/homes/eclipse-workspace/
is exported as NFS share. Let's
Perform the following step to modify the Linux project to auto-mount this the /srv/homes/eclipse-workspace/
directory via NFS.
Add the following lines to
etc/rc
:Code Block % cd projects/rootfs % vi etc/rc ... sleep 2 mount -o nolock 192.168.0.103:/srv/homes/eclipse-workspace/ /mnt/nfs ...
Rebuild the project.
After loading the project to the target, the Eclipse workspace directory is mounted as
/mnt/nfs
:Code Block / # df Filesystem 1K-blocks Used Available Use% Mounted on 192.168.0.103:/srv/homes/eclipse-workspace/ 488645632 124968960 338781184 27% /mnt/nfs / # ls -la /mnt/nfs/c-example/Debug/ drwxrwxr-x 2 1005 1005 4096 Jun 11 2024 . drwxrwxr-x 4 1005 1005 4096 Jun 11 2024 .. -rw-rw-r-- 1 1005 1005 16 Jun 11 2024 app.d -rw-rw-r-- 1 1005 1005 52048 Jun 11 2024 app.o -rwxrwxr-x 1 1005 1005 41680 Jun 11 2024 c-example -rw-rw-r-- 1 1005 1005 1360 Jun 11 2024 makefile -rw-rw-r-- 1 1005 1005 402 Jun 11 2024 sources.mk -rw-rw-r-- 1 1005 1005 752 Jun 11 2024 subdir.mk / #
...
Open Run -> Debug Configurations -> C/C++ Remote Applications:
Create a new configuration in C/C++ Remote Application by clicking + the New launch configuration icon in the upper left part of the dialoguewindow:
In the Main tab, click Select other... to change Using GDB Automatic Remote Debugging Launcher.
In the Select Preferred Launcher dialog, select GDB (DFS) Manual Remote Debugging Launcher and click OK.
In the Debug Configuration window, switch to the Debugger tab and change GDB debugger to enter the full path to
arm-buildroot-uclinuxfdpiceabi-gdb
in the GDB debugger box using Browse…. Click Apply.Select the Connection tab and enter an IP address of you target and
gdbserver
connection port number. Click Apply.
DO NOT click Debug.
4.3. Debugging on the Target
...