Creating FreeRTOS-based projects for Nordic nRF5x devices

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.

  1. Open Visual Studio and start VisualGDB Embedded Project Wizard:01-prj
  2. Proceed with the default “Create a new embedded binary with MSBuild” setting:02-msb
  3. On the next page select the ARM toolchain and pick your nRF5x device. Ensure you check the “provide default stubs for system calls” checkbox:03-device
  4. 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”:04-rtos
  5. On the last page of the wizard select the “Segger J-Link” debug method and click “Finish”:05-dbg
  6. Once your project is created, build it with Ctrl-Shift-B:06-build
  7. 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:07-threads
  8. 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:08-files
  9. The embedded framework list in VisualGDB Project Properties will appear empty, despite some of the files already being included as Shared Sources:09-frameworksYou can still add references to other frameworks as with the regular VisualGDB projects and VisualGDB will automatically add the related files to your project.