This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF51 SDK-examples using VisualGDB

Hi, I wonder how to get the Nordic SDK-examples work with VisualGDB.

As I would like to read TWI sensor values a good point to start from are the Nordic examples. But as all neccessary header files seem not to be included I have no idea how to get them work.

Did anyone already fight this problem? Or is there a working tutorial out there?

  • Do yourself a favor and use supported environment like Keil or GCC with official Nordic makefiles. As much as I like Visual Studio I had to switch to Keil because VisualGDB has weird bugs. Once you have a working project skeleton you can try to write a makefile and project definition for VisualGDB. I also don't like 'include everything' approach they adopted. Compiling whole sdk code regardless if your project uses it takes forever. Just take official app_twi example along with makefiles and go from there.

  • What bugs do you mean? Have you communitated with the developers to fix them?

    I was unable to get the samples work in Keil uVision5. Some files seem to be missing (couldn't download them). So at the moment I'm able to access my nRF51 by VisualGDB, but using Keil nothing works ;)

  • Around SDK11 linker files were wrong and debugger was hanging visual studio. The former wasn't obvious and took me lots of time to figure out what's happening. I reported it but got tired of waiting for the fix. Also there were problems with J-Link support and you had to stick to specific driver versions. Then it took the authors months to migrate to SDK12 and since my clients wanted newest and greatest version I've switched to Keil. I recently gave VisualGDB a chance to see if I can recommend it as a cheaper alternative to Keil and tried to build one of my production projects with it. I've managed to make it compile after a while. But resulting code did not run as expected. Surprisingly the same code works when built using GCC and official makefiles. It even works as 'makefile project' under VisualGDB. But then visual studio code highlighting is broken.

  • Well that doesn't sound good. What would you advice me to do? I have no experience with Eclipce nor Keil (touch I don'T have budget to buy a Keil licence). Is there a gread GCC tutorial using only freeware?

    I even couldn'T figure out which version of SDK VisualGDB is using...

  • We do have a GCC and eclipse tutorial for the nRF here. Another alternative is to use Segger Embedded Studio. You can evaluate the full version for free. We have a blog how to use it with our SDK here. About the project not working for you in Keil; this is probably because you are missing the device family pack. You can download this in the pack installer or install it with the MDK file in SDK folder (named nRF5x_MDK_8_11_1_Keil4 or similar).

Related