Creating Projects for the Nordic nRF52840 Chip with VisualGDB

This tutorial shows how to create a basic project for the nRF52840 chip using VisualGDB. We will create a basic “Blinking LED” project based on the example from the Nordic SDK and show how to build and debug it.

Before you begin, install VisualGDB 5.2.

  1. As of December 2016, the Nordic nRF5x SDK 13.0 is in the Alpha stage and is not very stable. Hence it is not automatically installed via the VisualGDB update mechanism and requires a manual download. Download this package manually, then open Tools->VisualGDB Package Manager in Visual Studio and click “Install a package from file”01-packages
  2. Select the downloaded package and click “Open”. Verify that the nRF5x package now shows version 13.0-alpha:02-alpha
  3. Now you can create a project for the new nRF52840 chip. Open the VisualGDB Embedded Project Wizard and select the MSBuild subsystem:03-msb
  4. On the next page select the nRF52840_XXAA device and enable the “Provide default stubs for system calls” checkbox:04-device
  5. On the next page select a sample. We recommend starting with the LEDBlink (BSP) sample to test out the board connectivity before trying anything more complex. Select the PCA10056 board type that corresponds to the nRF52840 development kit:05-pca10056
  6. Install Segger J-Link v6.12C or later, then select “Segger J-Link” on the Debug Method page and press “Finish” to generate the project:06-debug
  7. Now you can build the project with Ctrl-Shift-B:07-build
  8. Press F5 to begin debugging. Observe how the 4 LEDs on the board are blinking:board
  9. Set a breakpoint somewhere in the main loop to quickly check that breakpoints and stepping work:08-bkpt
  10. Now you can try creating projects based on more complex samples. Keep in mind that the Alpha release of the SDK is unstable and some of the examples may not work. E.g. in our tests the BLE Mouse example did not work on the nRF52832 chip and only worked first time after erasing bonds on nRF52840.