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

Blinky code is stating an error as a undefined reference to nrf_delay_ms?

I am running the Blinky code provided in nRF52 SDK examples.I am not able fix this error pointing at nrf_delay_ms. This function is hard to explain. Moreover I don't know where does blink code Blinky_error.zipcame from?

I am attaching my project.blinky.zip

  • Can you upload your project, including all source code, Makefile etc. so that we can better understand what is happening?

    The screenshot in "error file.png" seems to show the main.c from the Blinky Example in nRF52 SDK 0.9.2. I see that you use Eclipse, so I assume you also use GCC? I have no problems building the unmodified example by running make from examples\peripheral\blinky\pca10036\blank\armgcc on my side.

    In the other screenshot, "Error file-2.png", you use a C++ blink implementation that is not part of the SDK, so it is difficult to assume anything about your project.

  • I see that you have added a C++ file plus a lot of (auto generated) Eclipse files in the project. I am not familiar with Eclipse, but using your zipped project folder I have no problems building the blinky example application (main.c) using the Makefile in pca10036\blank\armgcc and calling make directly from the command line. Can you verify that this works for you if you place your project under e.g. examples/peripheral/ in the SDK? You also have to update the path to your ARM GCC toolchain in the SDK in components\toolchain\gcc\Makefile.windows, GNU_INSTALL_ROOT if you have not already done so.

    Is this the file you want to build or do you want to build the blink.cpp (that you have presumably written your self)? They both contain a main function so they cannot be used together in the same application.

    If you need a introduction to developing for the nRF5x using GCC and Eclipse I recommend you to look at the Development with GCC and Eclipse tutorial.

Related