This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Cannot open imported project in Eclipse

Hello everybody,

I am a newbie, and I tried to follow this tutorial to set up my laptop for development.

Everything works until I went to the step "Import existing Eclipse project to workspace". I can import the blinky example, but I cannot open the main.c, it said "File not found: /blinky_blank_pca10040/Application/main.c.", also the other files have the same problem except the "makefile" and the "blinky_gcc_nrf52.ld". if I try to build the project, the result is shown in the picture. image description image description

I wonder whether the path of the project is wrong or not? But if I put "makefile" and "blinky_gcc_nrf52.ld" right under the "armgcc" folder, Eclipse will detect no project.

All the things I am using are the latest version.

So, could you guys give me some hints to solve this problem? Thanks!

Best regards

Tong

  • Maybe examine Project>Properties>Resource>Linked Resources>Path Variables? A path variable PROJECT_LOC should point to the directory where you downloaded the example source code? In other words, it is now looking at /blinky... , which is the root of the filesystem, and surely you downloaded the example somewhere else.

  • Thanks for the comment. I added the path in the "linked resources", it works. But it still get error when I try to build.

    make VERBOSE=1 all

    rm -rf _build

    /Library/Developer/CommandLineTools/usr/bin/make -f Makefile -C ./ -e cleanobj

    rm -rf _build/*.o

    /Library/Developer/CommandLineTools/usr/bin/make -f Makefile -C ./ -e nrf52832_xxaa

    echo Makefile

    Makefile

    mkdir _build

    make[1]: *** No rule to make target _build/system_nrf52.o', needed bynrf52832_xxaa'. Stop.

    make: *** [all] Error 2

  • See another thread in this forum about "No rule to make .... .o". It might be because the Makefile is not listing the source files correctly, i.e. add a line similar to SRC_FILES += ???? system_nrf52.c in the Makefile. I am suggesting that the Makefile is flawed (missing a line). OR it IS listed in the Makefile but you need to redefine some variable in the Makefile that defines a path to the directory where you downloaded the SDK. That file system_nrf.c is in the SDK. If you cd to where ever you downloaded the SDK and then use the UNIX find command: find . -name "system_nrf52.c" it will show you the many places it exists in the filesystem.

  • Like the tutorial said, I think the "makefile" and the "blinky_gcc_nrf52.ld" should in the "armgcc" folder, cannot be in a subfolder inside the "armgcc" folder. If I put those two files in the "armgcc", I cannot import it to the Eclipse, but I can build it via terminal command. If I put those two files in the "armgcc/nRF5_SDK_11.0.0_blinky_blank_pca10040", it can be imported to Eclipse, but if I try to build by terminal, it appears the same error like in my last comment.

  • In my case, I modified the Makefile. Define a new variable NRF_SDK_ROOT and refer to it whereever the Makefile uses relative paths such as ../../../../components. In other words change that to $(NRF_SDK_ROOT)/components. Then it matters less where the Makefile is located.

Related