This tutorial shows how to create a basic FreeRTOS-based project for the Nordic nRF5x devices. Before you begin, install VisualGDB 5.2 or later.
- Open Visual Studio and start VisualGDB Embedded Project Wizard:
- Proceed with the default “Create a new embedded binary with MSBuild” setting:
- On the next page select the ARM toolchain and pick your nRF5x device. Ensure you check the “provide default stubs for system calls” checkbox:
- On the sample selection page click “Show Nordic SDK Samples” at the top of the page. VisualGDB will then show all of the sample projects discovered in the Nordic SDK. Select the “BLINKY_FREERTOS_PCA10040″ sample and press “Next”:
- On the last page of the wizard select the “Segger J-Link” debug method and click “Finish”:
- Once your project is created, build it with Ctrl-Shift-B:
- Start debugging the project by pressing F5. Ensure that the two LEDs on the board blink, each controlled by a separate thread. Then set a breakpoint in the led_toggle_task_function(). Once the breakpoint hits, check the Threads window to ensure that VisualGDB has properly detected FreeRTOS:
- Note that the sample projects automatically imported from the Nordic SDK have a slightly different structure than the regular VisualGDB projects. Instead of using the regular Embedded Framework packages, all source files included in the original sample are placed under the “Shared sources” filter in Solution Explorer:
- The embedded framework list in VisualGDB Project Properties will appear empty, despite some of the files already being included as Shared Sources:You can still add references to other frameworks as with the regular VisualGDB projects and VisualGDB will automatically add the related files to your project.