The following has to be added to the local.conf file in the build directory or to your custom image recipe:
EXTRA_IMAGE_FEATURES = " eclipse-debug" IMAGE_INSTALL_append = " openssh-sftp-server"
This guide uses a password based authentication for the ssh target connection. The password can be setup with the passwd
command on the target. The password can also be defined in the local.conf file or your custom image recipe. Below you will find a an example to add the password password
to the user root
.
INHERIT += "extrausers" EXTRA_USERS_PARAMS = "usermod -P password root;"
The Eclipse IDE requires the following packages installed on the development host:
On a Ubuntu based development host, they can be installed by the following commands:
sudo apt-get install build-essential gdb gdb-multiarch git default-jre
Download the Eclipse from the following link in this case Eclipse 2021-06:
https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2021-06/R/eclipse-cpp-2021-06-R-linux-gtk-x86_64.tar.gz
Afterwards extract the Eclipse tarball e.g. to your home directory, by default the folder is named eclipse.
cd ~ tar -xf ~/Downloads/eclipse-cpp-2021-06-R-linux-gtk-x86_64.tar.gz
Now the Eclipse IDE can be started from a terminal: e.g.
~/eclipse/eclipse
After starting Eclipse select a new workspace directory and click the Launch button.
Select File → New → C/C++ Project
Select C Managed Build and click Next
Click the Next Button.
Click Next
Accept the default settings for Debug and Release by clicking Next
Finally click on Finish
/opt/fsl-imx-wayland/5.4-zeus/sysroots/aarch64-poky-linux/usr/include
--sysroot=/opt/<label bsp_distro>BSP_DISTRO</label>/5.4-zeus/sysroots/<label sdk_folder_name>SDK_FOLDER_NAME</label>-linux
--sysroot=/opt/fsl-imx-wayland/<label distro_version>DISTRO_VERSION</label>/sysroots/<label sdk_folder_name>SDK_FOLDER_NAME</label>-linux
Apply and Close finally to leave the Properties Menu.
Select Run → Debug Configurations
Double Click C/C++ Remote Application and click on New to create a new connection to the target
Select SSH in the drop down menu and click OK
e.g. STKaRZG2
e.g. 10.122.63.12
e.g. root
e.g. root
Finally click on Finish
Enter the target application path in the Remote Absolute File Path for C/C++ Application field:
e.g. /home/root/hello_world. It is also possible to select the path on the target by clicking the Browse button.
Switch to the Debugger tab and enter aarch64-poky-linux-gdb in the GDB debugger field.
Click apply and close to leave the Debug Configuration
Select Window → Show View → Debug from the menu to add the debug view.
Open the Launch Target drop down menu and select new Launch Target
Select GDB Remote TCP in the New Launch Target window and click Next afterwards
Enter the Target IP, by default the SSH port is configured to 22. Click Finish to leave the Launch Target configuration.