Using VisualGDB with the Official ARM Toolchain

This tutorial shows how to use VisualGDB to build and debug embedded firmware for ARM devices using the GCC ARM toolchain maintained by ARM.

Before you begin, install VisualGDB 5.0+ and download the ARM toolchain from https://launchpad.net/gcc-arm-embedded

  1. Install the GNU ARM toolchain to a directory that does not contain spaces:
    gnuarmdir
  2. Enable the “Add Registry Information” checkbox on the last page of the toolchain installer:
    gnuarm
  3. Launch Visual Studio and start creating a new project via File->New Project->VisualGDB->Embedded Project Wizard:prj
  4. Proceed with the default settings on the first page of the wizard:
    def
  5. VisualGDB should automatically detect the toolchain location and show it in the toolchain list as “GNUARM”. Select it and then choose your device:deviceIf the toolchain location is not detected, check the HKLM\SOFTWARE\Wow6432Node\ARM\GNU Tools for ARM Embedded Processors\InstallFolder value in the registry. The GNU ARM toolchain installer should set it to the toolchain location.
  6. Select the sample you want to use for your project. The simplest one is LEDBlink:sample
  7. Select the debug method you want to use. You can read here about various debug methods supported by VisualGDB.debug
  8. Press “Finish” to create the project. Build it by pressing Ctrl-Shift-B:build
  9. You can start debugging the project like any other Visual Studio project by pressing F5:debug
  10. You can change various toolchain settings by right-clicking on the project in Solution Explorer, selecting “VisualGDB Project Properties” and changing the settings on the first page. E.g. you can switch the C library from newlib to newlib-nano and disable syscall support to reduce the size of your image:settings
  11. If you build your project now, you will see that its size has decreased substantially after we switched to the lightweight newlib-nano library:smaller