Tuesday, June 30, 2015

Beaglebone Black - Eclipse Remote Debugging, Ubuntu


I recently had to get my remote debugger working for a beaglebone black. Contrary to my post on MacOSX cross compile toolchain - I decided to use Ubuntu.

#!/bin/bash
# prereqs for cross compile
sudo apt-get install -y build-essential
sudo apt-get install -y libc6-armhf-cross
sudo apt-get install -y libc6-dev-armhf-cross
sudo apt-get install -y binutils-arm-linux-gnueabihf
sudo apt-get install -y linux-libc-dev-armhf-cross
sudo apt-get install -y libstdc++6-armhf-cross
sudo apt-get install -y gcc-4.7-arm-linux-gnueabihf
sudo apt-get install -y g++-4.7-arm-linux-gnueabihf
# setup eclipse
sudo apt-get install -y eclipse
#################################################
# Help > Install New Software
# 1) http://download.eclipse.org/releases/indigo/
# 2) Programming Languages:
# C/C++ Development Tools
# C/C++ Development Tools SDK
# C/C++ Library API Documentation Hover Help
# 3) General Purpose Tools:
# Remote System Explorer End-User-Runtime
# Remote System Explorer User Actions
# Local Terminal
# 4) Mobile and Device Development
# Target Management Terminal
#################################################
# Window > Open Perspective > Other... > Remote System Explorer
# [or...] Window > Show View > Other... > Filter: Remote
# 1) New > Connection...
# 2) Linux [Next]
# 3) Host name and Connection name: BBB IP [Next]
# 4) ssh.files [Next]
# 5) processes.shell.linux [Next]
# 6) ssh.shells [Next]
# 7) ssh.terminals [Next]
#################################################
# Project > Properties
# 1) C/C++ Build > Settings > Tool Settings tab
# GCC C++ Compiler Command: arm-linux-gnueabihf-g++-4.7
# GCC C Compiler Command: arm-linux-gnueabihf-gcc-4.7
# GCC C++ Linker Command: arm-linux-gnueabihf-g++-4.7
# GCC Assembler Command: arm-linux-gnueabihf-as
# 2) C/C++ General > Path and Symbols > Includes tab
# [Foreach, check make available to all and Move Up]
# GNU C Add: /usr/arm-linux-gnueabihf/include
# GNU C++ Add: /usr/arm-linux-gnueabihf/include/c++/4.7.3
# 3) C/C++ General > Path and Symbols > Library Paths tab
# Add: /usr/arm-linux-gnueabihf/lib
#
# setup remote debugger
sudo apt-get install -y gdb-multiarch
#################################################
# In Eclipse
#################################################
# Remote System Explorer > BBB Connection > Ssh Terminals
# Right-click > Launch Terminal
#################################################
# Terminal window:
# 1) sudo apt-get install -y gdbserver
# 2) gdbserver 192.168.x.x:yyyyy $APP_NAME
#################################################
# Run > Debug Configurations > Debugger tab
# 0) C++ Remote Application [New]
# 1) Main tab > GDB Debugger: gdb-multiarch
# 2) Connection tab > IP: 192.168.x.x
# 3) Connection tab > Port: yyyyy
# 4) [Debug]

No comments:

Post a Comment