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.
- 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”
- Select the downloaded package and click “Open”. Verify that the nRF5x package now shows version 13.0-alpha:
- Now you can create a project for the new nRF52840 chip. Open the VisualGDB Embedded Project Wizard and select the MSBuild subsystem:
- On the next page select the nRF52840_XXAA device and enable the “Provide default stubs for system calls” checkbox:
- 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:
- 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:
- Now you can build the project with Ctrl-Shift-B:
- Press F5 to begin debugging. Observe how the 4 LEDs on the board are blinking:
- Set a breakpoint somewhere in the main loop to quickly check that breakpoints and stepping work:
- 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.