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

How can I see the .c and .h files in Eclipse after "make" ?

I followed the this tutorial and this tutorial step by step. And I have accomplished all the steps successfully. But the problem is, my .c and .h files(such as main.c) do not appear in the Eclipse project explorer section. So I can not edit my .c and .h files at Eclipse. Is there a way to edit all of my files from a single place, as is the case with the uVision IDE?

NOTE: I used;

Nordic SDK 14.2.0, Segger J-Link V6.20b

Eclipse IDE for C/C++ Developers – Version: Neon.3

GNU ARM Toolchain v4.9.3

GNU Make Utility v3.81

MinGW

  • Hi,

    Did you follow this part of the first tutorial you linked?

    Now you can start linking the source files into your project viewer, but you might want to add some virtual folders to obtain a more clear project view first.

    Create virtual folders:

    • Right click on the project folder and enter New->folder.
    • Set folder name.
    • Click Advanced and choose virtual folder.
    • Click finish.

    Repeat above steps until you have the folders you want. The naming of the folders should reflect the types of the source files you intend to link to. In the blinky it was sufficient to have Application, Device and nRF_Drivers, same as the Keil example for blinky, but, for larger projects with more source files you should add more folders. E.g., ble_app_hrs: Application, Board Support, Device, nRF_BLE, nRF_Drivers, nRF_Libraries and nRF_Softdevice.

    Now you can start to link the source files to the respective folders. The source files to include are listed in your Makefile->C_SOURCE_FILES, and ASM_SOURCE_FILES. Source files are then linked to the folder by right clicking on any of the virtual folders and clicking on import, General->File System and browse the source files in the SDK. The path to each source file can be a good way to determine what folder to place the file in:

    ../../../../../../components/drivers_nrf/delay/nrf_delay.c can be classified as a driver. Thus placed in nRF_Driver, etc.

    This should let you browse the source files like any other IDE. Header files will be discovered during compilation.

    Best regards,

    Jørgen

Related