Eclipse configuration - GruszekG/nanny GitHub Wiki

How to configure simple BBB "Hello world" project in eclipse for cross building and debuging.

1. Install eclipse

1.1. Download eclipse from https://www.eclipse.org/

1.2. Extract downloaded file

cd ~/Downloads tar -xvf eclipse-spp-2018-09-linux-gtk-x86_64.tar.gz mv eclipse ..

2. Create "Hellow world" C++ project

Project name: TestArm Project type: Hellow World C++ Project Toolchains: Cross GCC Cross compiler prefix: arm-linux-gnueabihf- Cross compiler path: /usr/bin

3. Install eclipse extensions

3.1. Open "Install new software"

Help -> Install New Software ...

3.2. Add source and filter

Work with: Photon - http://download.eclipse.org/releases/Photon Filter: remote

3.3. Install

Mark extensions:

  • General Purpose Tools -> Remote System Explorer End-User Runtime
  • General Purpose Tools -> Remote System Explorer User Actions

Click "Next" and install chosen extensions.

4. Set remote system view

4.1. Open remote view

Window -> Show View -> Other -> Remote Systems -> Remote System

4.2. Add connection to BBB

RMB on Remote Systems -> New Connection -> Linux -> Next Host name: <BBB_ip_address> Connection name: BeagleBone Black Files Configuration: ssh.files Process Configuration: processes.shell.linux Shells Configuration: ssh.shells

4.3. Connect to BBB

RMB on BeagleBone Black in Remote Systems View -> Connect Put user name and password (for clear Debian BBB image: user: debian, password: temppwd)

5. Set full access to BBB for your desktop

5.1. Generate SSH key

ssh-keygen

5.2. Copy SSH key to BBB

ssh-copy-id debian@<BBB_ip_address>

5.3. Check access

ssh debian@<BBB_ip_address>

6. Copy output file to BBB after build

Project properticie -> C/C++ Build -> Settings -> Build Steps Set post-build steps command: scp TestArm debian@<BBB_ip_address>:/home/debian/BBB

7. Configure remote debug

7.1. Install GDB server on BBB

sudo apt-get install gdbserver

7.2. Install multi architecture GDB on your desktop

sudo apt-get install gdb-multiarch

7.3 Set multi architecture GDB

Create file ".gdbinit" in eclipse workspace Write to ".gdbinit" file in one line: set architecture arm

7.3. Configure remote debug in eclipse

Debug Configuration -> C/C++ Remote Application -> New Debugger -> Main -> GDB debugger: /usr/bin/gdb-multiarch Debugger -> Main -> GDB command file: <path to created ".gdbinit"> Debugger -> Main -> Remote Absolute File Path for C/C++ Application: /home/debian/BBB/TestArm //executable file - BBB location Debugger -> Shared Libraries -> Add: /usr/arm-linux-gnueabihf/lib

8. Try to debug :)

References

http://exploringbeaglebone.com/chapter7/