Sharing VisualGDB Projects Between Multiple Users

This tutorial shows how to share Embedded VisualGDB projects between multiple users with different settings, such as toolchain paths. The relocation features shown here are available on VisualGDB 5.0+ on the Custom and Ultimate editions.

We will create a basic project for the STM32F4Discovery board and show how to access it from 2 different users.

  1. Start Visual Studio and open the Embedded Tool Manager from the Tools menu:norelocIf you don’t have your toolchain installed yet, you can download it or import an existing one by using the buttons to the right.
  2. By default, new VisualGDB projects will refer to the toolchain using the full path. As we want to support opening the projects on machines with different path, we will configure VisualGDB to refer to the toolchain using an environment variable that can be different for different users. Click “Configure toolchain relocation” and pick a variable name you would like to use to reference the toolchain:04-relocate
  3. VisualGDB will update the environment, however Visual Studio caches it internally, so it will need to be restarted in order to pick up the changes:05-restart
  4. Start the VisualGDB Embedded Project Wizard:01-prj
  5. Continue with the default settings on the first page:02-binary
  6. On the next page select the toolchain and the device you want to target. When you select a relocatable toolchain, the button to the right of the toolchain selector will change the icon:06-sharedYou can use the button with the user icon to change the toolchain relocation settings from the wizard.
  7.  Normally VisualGDB
    would store the shared files (e.g. linker scripts) under
    your local application data directory, however in this
    example we will override this and store them under our
    version control system. Click the “change” button to the
    right of “shared files location” and select a directory near
    the project directory:07-sharedfiles
  8. On the next page select a sample to use as a template for your project:09-sample
  9. Finally select a debug method:10-dbgmethod
  10. Build your project and open the <mcu>.mak file (e.g. stm32.mak). Notice how VisualGDB uses the variable name you specified to reference the toolchain directory and the relative path to reference the shared files:11-dirs
  11. Now add the folder containing your project and your shared files to a source control system. In this example we will use TortoiseGit. It is recommended to add the following file masks to .gitignore:
    Debug
    Release
    *.opensdf
    *.sdf
    *.suo
    *.old
    VisualGDBCache
    CodeDB

    12-git

  12. Commit and push the changes to your git repo accessible by other users:13-commit
  13. On a different computer clone the git repository to a local directory:14-clone
  14. Before you can open the project, register the toolchain with VisualGDB by opening Tools->Embedded Tool Manager and clicking “Import a 3rd-party toolchain”:15-toolchain
  15. Then press “Configure toolchain relocation” and specify the same variable name as you specified on the first computer:16-relocateRestart Visual Studio as instructed by VisualGDB.
  16. Now you can open your project. VisualGDB will ask whether you want to reuse the BSP from the shared folder:17-newdirConfirm the BSP location so that VisualGDB can remember it for other projects.
  17. Build the project. Notice how VisualGDB uses the new toolchain path automatically:18-build
  18. As the toolchain path is now referenced via the ARM_TOOLCHAIN_ROOT variable and the BSP files are referenced using relative paths, the project files remain the same for users with different paths. I.e. if the second user edits the source and builds the project, only the changed source file will be affected:19-git