Energia IDE Stellaris LM4F Hardware Debugging

by Visual Micro 17. January 2016 17:04

Visual Studio GDB with Stellaris Launchpad LM4F

This is the first of a new range of Visual Micro GDB debuggers for micro-controllers like Arduino.

Further documentation about the supported debuggers and configurations can be found here.

Visual Micro must already be installed along with the Microsoft tools described below. Please use the forum for assistance and feedback.

Key features

  • Comatible with .ino source code
  • Debug sketch, libraries and core
  • Step by Line or Instruction
  • Step Over, Step Out
  • Move instruction pointer
  • Set/move breakpoints (3 max)
  • Inspect memory, locals, call stack
  • Disassembly or source navigation
  • Immediate expression evaluator
  • Watch expressions, local expressions, auto expressions
  • Breakpoints, trace points, conditional breakpoin expressions
  • Pin variables during debug sessions. Easily see values. Add notes/comment.
  • Drill down into variables
  • Gdb command tool - optional manual interaction with the debugger (limited testing)
  • Toolchain, ocd and gdb automatic configuration based on the selected Arduino board
  • Automatic/background conversion between cpp and Arduino format .ino source code
  • Auto highlight changed data - Easily see which registers and variables have changed.
  • One button click: Build>Upload>Debug

Overview and Install Instructions

The intial instructions explain how to setup the debug tools in Visual Studio 2017.

VS 2017 Community Edition is a free Ide for everyone, except large organizations. Large organizations can use for free for open source projects.

  • Visual Micro uses the standard C++ tools of Visual Studio to provide Arduino programming. The C++ tools are a custom option durng install or at a later date via Control Panel>Add or remove programs.
  • Visual Micro is also a free install from within the Ide using "Tools>Extensions & Updates>Online"
  • The Energia Ide can be downloaded from the respective hardware vendor such as arduino.cc and arduino.org

 

Installing all of the tools descrived above is currently a requirement for the gdb tools in Visual Micro. 

Visual Micro is also an extension and can be installed/uninstalled via the Gallery in the same way as the Gdb debugger.

After install simply create a new project, and select the relevant debugger settings (see more for TI boards here)

Visual Micro should now be managing the project. Select the Energia Ide and Stellaris board in Visual Micro and then test upload.

To run the gdb debug use any of the standard Visual Studio "Debug" Menu commands (not the Visual Micro tool bar or menu commands)

Do not use more than 3 breakpoints!! 4 are supported but stepping runs out of steam with 4 and the debug stops responding.

If the debugger locks up then kill the openOCD.exe process in task manager. If it is not loaded then kill the arm-none-eabi-gdb.exe process.

If you can't upload or the board is in a bad state after debug discopnnect and reconnect or kill the OpenOCD.exe windows process if it has remained open.

Know lock up causes are:- 1) Source code out of date 2) Optimization prevents all breakpoints from being recognized 

Known issues

  • Some source code paths are incorrect causing temp folder sources instead of local project sources to open during debug.
  • Stepping line position a little erratic sometimes see instruction stepping when line stepping was selected.

Which backend Ide?

Energia 1.6 (2016/2017)

Related Articles

Tags: