Creating Advanced Mbed Projects with VisualGDB

This tutorial shows how to use the Advanced Mbed Project Subsystem to develop mbed-based projects using the latest version of mbed without converting them to Visual C++ projects. Before you begin, install VisualGDB 5.4 or later.

  1. Start Visual Studio and open the Advanced Mbed Project Wizard:01-newprj
  2. Select “Create a new ‘Blinking LED’ project”. Mbed projects are built using the Python-based mbed-cli tools. If your system does not have a Python environment, or the environment doesn’t have the mbed-cli tools installed, VisualGDB can automatically download the necessary tools for you (we recommend using Python 3.x):If VisualGDB prompts for the location of the Git binary, please download and install one from the official Git distribution.
  3. Once all tools have been installed, click “Next”:03-nextVisualGDB will clone the blinky example from github using the mbed tools. As each mbed project must include a copy of the mbed framework itself, checking it out may take a few minutes.
  4. Mbed projects require the GNU ARM toolchain maintained by ARM itself. Install the latest version of the toolchain and select it on the Toolchain page. Then pick your mbed target from the list:
    04-boardIf the mbed tools report Python-related errors, please try resetting your Python environment as shown on this page.
  5. Connect your board to your computer via USB and let VisualGDB automatically detect the settings. If the device name cannot be automatically detected from the board name, simply select it in the “Debugged device” field manually:05-debug
  6. Press “Finish” to create the project. VisualGDB will query the detailed project structure from the mbed-cli tools and will show it in Solution Explorer. Unlike the regular mbed projects that reuse the VC++ project subsystem to build the project, the advanced mbed projects are built directly using the mbed tools and any changes you make in Solution Explorer will be automatically be recognized by those tools. Build the project by pressing Ctrl-Shift-B:06-built
  7. Set a breakpoint in main() and start debugging the project:07-debug
  8. Right-click on the project in Solution Explorer and select “VisualGDB Project Properties”. You can use the Mbed Project page to change the toolchain, configure source directories and preprocessor macros, or to edit the advanced mbed configuration variables:08-settingsVisualGDB will automatically create or edit the mbed configuration files for you and the mbed build tools will pick up the changes even if you build the project outside VisualGDB