Developing projects for the Mbed LPC812 board with Visual Studio

This tutorial shows how to setup the LPC812 mved/Xpresso board to develop projects with Visual Studio and VisualGDB.

Before you begin, install VisualGDB 5.1 or later.

  1. Start Visual Studio and open the VisualGDB Embedded Project Wizard:01-prjname
  2. Proceed with the default “Embedded binary” project type:02-prjtype
  3. On the next page click “Use ARM mbed” and select the LPC812 board from the list:03-mbed
  4. On the Sample Selection page pick the LEDBlink sample and click “Next” to proceed:04-blink
  5. Plug in your board. If you are using the latest OpenOCD package, it should detect it automatically. Click “Test OpenOCD” to verify that the debugging works. If the mbed driver is not installed on your computer, you will get an error shown below:05-debug
  6. If this happens, download and install the mbed serial port driver:06-driver
  7. Now the test should pass successfully. OpenOCD may report the “clearing lockup after double fault” error, but it should not affect debugging: 07-success
  8. Press “Finish” to generate the project. Build it with Ctrl-Shift-B:08-build
  9. Press F5 to start debugging. Note how the big blue LED starts blinking:board
  10. Set a breakpoint somewhere in the loop inside main(). Once it triggers, you will be able to debug your program as usual:09-breakpoint
  11. You can easily reference various mbed libraries via the Embedded Frameworks page of VisualGDB Project Properties:10-frameworks
  12. The project automatically includes the relevant source code from mbed, so you can use go-to-definition and Code Map to explore it. E.g. you can quickly check how the wait_ms() function works by finding the data it accesses and showing other functions that access the same data:11-codemap