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

Is there a better way to add SDK 8.1 include files to Eclipse?

I am working on getting the ble_app_hrs example from SDK 8.1 within Eclipse. There seems to be no association between the INC_PATHS in the Makefile with include files within Eclipse CDT. Currently, I am going project Properties -> C/C++ General -> Paths and Symbols and adding the include files for GNU C. Is there a better way? There are many include files referenced by the examples (or any nRF51 app that uses the SDK). For example, here are the include files referenced by ble_app_hrs: #includes common to all targets INC_PATHS = -I../../../config INC_PATHS += -I../../../../../../components/drivers_nrf/config INC_PATHS += -I../../../../../bsp INC_PATHS += -I../../../../../../components/libraries/fifo INC_PATHS += -I../../../../../../components/libraries/util INC_PATHS += -I../../../../../../components/drivers_nrf/pstorage INC_PATHS += -I../../../../../../components/drivers_nrf/uart INC_PATHS += -I../../../../../../components/ble/common INC_PATHS += -I../../../../../../components/libraries/sensorsim INC_PATHS += -I../../../../../../components/ble/device_manager INC_PATHS += -I../../../../../../components/ble/ble_services/ble_dis INC_PATHS += -I../../../../../../components/device INC_PATHS += -I../../../../../../components/libraries/button INC_PATHS += -I../../../../../../components/libraries/timer INC_PATHS += -I../../../../../../components/softdevice/s110/headers INC_PATHS += -I../../../../../../components/drivers_nrf/gpiote INC_PATHS += -I../../../../../../components/drivers_nrf/hal INC_PATHS += -I../../../../../../components/toolchain/gcc INC_PATHS += -I../../../../../../components/toolchain INC_PATHS += -I../../../../../../components/drivers_nrf/common INC_PATHS += -I../../../../../../components/ble/ble_advertising INC_PATHS += -I../../../../../../components/libraries/trace INC_PATHS += -I../../../../../../components/ble/ble_services/ble_bas INC_PATHS += -I../../../../../../components/softdevice/common/softdevice_handler INC_PATHS += -I../../../../../../components/ble/ble_services/ble_hrs

Parents
  • CDT is capable of parsing the include paths and pre-processor definitions from the build output with the right project configurations; First you need to increase the verbosity level of the build output so that '-I' for includes and '-D' for symbols are being printed out. This is done by editing the default makefile:

    • Search for the $(NO_ECHO)$(CC) $(CFLAGS) $(INC_PATHS) -c -o $@ $< line in the makefile.
    • Add this to the line above: @echo arm-none-eabi-gcc $(CFLAGS) $(INC_PATHS) -c -o $@ $< and remember to use the same indent.

    Then you can enable the CDT output parser by following the steps described in the "Enable auto discovery of symbols, include paths and compiler settings" section in this Eclipse tutorial.

Reply
  • CDT is capable of parsing the include paths and pre-processor definitions from the build output with the right project configurations; First you need to increase the verbosity level of the build output so that '-I' for includes and '-D' for symbols are being printed out. This is done by editing the default makefile:

    • Search for the $(NO_ECHO)$(CC) $(CFLAGS) $(INC_PATHS) -c -o $@ $< line in the makefile.
    • Add this to the line above: @echo arm-none-eabi-gcc $(CFLAGS) $(INC_PATHS) -c -o $@ $< and remember to use the same indent.

    Then you can enable the CDT output parser by following the steps described in the "Enable auto discovery of symbols, include paths and compiler settings" section in this Eclipse tutorial.

Children
Related