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

Eclipse example project nRF52

Hi

I tried following the eclipse installation tutorial: devzone.nordicsemi.com/.../ And after a while I got eclipse to handle the Nordic stuff, but when I try to import a project there is no armcc folder in my SDK. I tried loading an existing project and then manually adding all of the sources. It does recognize all of the imported header files, but nothing actually matches up. I have 124 errors, everything that is not pure C is an error. I tried to find an example project for eclipse that I could try importing but I found none. Does anyone have at least a blinky project that I can directly import into eclipse from a archived file or something like that? I'm not sure if its just the project broken, or I messed up the installation, or some version of something changed which affected the installation.

Parents
  • Using Eclipse, to import an example file from the Nordic tutorial:

    1. Download the example, say to Download/foo.zip

    2. Start Eclipse

    3. Choose File>Import. Expect a dialog titled "Import" to open.

    4. Select (click on) "General>Existing projects into workspace". Choose the "Next" button. Expect another dialog saying "Select a directory to search for existing Eclipse projects".

    5. Select the radio button "Select archive file". Choose the "Browse" button. Expect a file chooser dialog to open.

    6. Browse to and select the file "Downloads/foo.zip". Choose the "OK" button. Expect the file chooser dialog to close and for the previous dialog to reappear, now with the "Finish" button enabled.

    7. Choose the "Finish" button. Expect the dialog to close and for a new project to appear in the "Project Explorer" pane of Eclipse.

    I tested this with Eclipse Neon version on Linux. It might be slightly different with other OS or version of Eclipse.

    You might still need to edit the Makefile if you did not follow the tutorial exactly with respect to where you downloaded the SDK, which SDK you downloaded, or other matters. For example, today the tutorial only has an example project for blinky and SDK11. If you try to use SDK12 with that example project, you might need to edit the Makefile (because the filenames changed, and the SDK changed.) The recommendation is to follow the tutorial exactly.

Reply
  • Using Eclipse, to import an example file from the Nordic tutorial:

    1. Download the example, say to Download/foo.zip

    2. Start Eclipse

    3. Choose File>Import. Expect a dialog titled "Import" to open.

    4. Select (click on) "General>Existing projects into workspace". Choose the "Next" button. Expect another dialog saying "Select a directory to search for existing Eclipse projects".

    5. Select the radio button "Select archive file". Choose the "Browse" button. Expect a file chooser dialog to open.

    6. Browse to and select the file "Downloads/foo.zip". Choose the "OK" button. Expect the file chooser dialog to close and for the previous dialog to reappear, now with the "Finish" button enabled.

    7. Choose the "Finish" button. Expect the dialog to close and for a new project to appear in the "Project Explorer" pane of Eclipse.

    I tested this with Eclipse Neon version on Linux. It might be slightly different with other OS or version of Eclipse.

    You might still need to edit the Makefile if you did not follow the tutorial exactly with respect to where you downloaded the SDK, which SDK you downloaded, or other matters. For example, today the tutorial only has an example project for blinky and SDK11. If you try to use SDK12 with that example project, you might need to edit the Makefile (because the filenames changed, and the SDK changed.) The recommendation is to follow the tutorial exactly.

Children
  • Thanks for the help! I was able to import the archive, but I had to manually replace the /home/butch... entries with my sdk location. Once I did that most of the issues were resolved but all the function calls in counter.cpp were still invalid. Since I don't need that anyway, I just commented everything that was giving an error just to see if I can compile it. When I try to build I get the following errors regarding the makefile: Description Resource Path Location Type Program "" not found in PATH ble_control C/C++ Problem Program "echo" not found in PATH ble_control Project Properties, C++ Preprocessor Include.../Providers, [CDT GCC Built-in Compiler Settings Cross ARM] options C/C++ Scanner Discovery Problem Program "make" not found in PATH nRFCounter C/C++ Problem

    I am not really an expert in tailoring makefiles, I only used it for simple C projects. How do I fix the makefile?

  • The instructions in the answer are for an example project from the tutorial written by Nordic. Those examples use a Makefile constructed by Nordic, that you might need to modify unless you follow the tutorial exactly with respect to what directory and name you downloaded the SDK to.

    It appears that you downloaded a different example project, one from my Github repository. That example does not have a Makefile since Eclipse is smart and "manages the build" that is knows what the source files are, the dependencies between them, and how to link them together. But for that example, some of the paths to the SDK are described in the Properties of the Eclipse project. Thus you must learn how to use the Properties dialog of Eclipse.

    You should choose a strategy: 1. use a Nordic example and learn to modify Makefiles, or 2. use my example and learn how to use Eclipse Properties dialog.

  • @butch, having used eclipse properties extensively with software projects but never with embedded, I am looking for any information on setting up the Eclipse properties, as this is a much more ideal solution. Could you recommend a specific resource for learning about setting up the properties for GNU ARM and gcc?

  • You might try importing (into Eclipse) one of my projects on Github, and browsing the Properties of the project. The projects use Eclipse managed build (not manual Makefiles.) I don't think they are too peculiar or have too much cruft. Not saying they will build and run, just display their properties. mcuoneclipse and bitknitting are other resources. I don't know of a very specific tutorial. Search for "Nordic Eclipse managed make"

Related