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

nRF52 project in Eclipse doesn't see makefile defines

Hey all,

I followed Vidar's excellent tutorial, and it works! I can compile without errors. However, when I try to walk through the project in Eclipse (the blinky example), a bunch of stuff is grayed out (for example:

#if LEDS_NUMBER > 0
static const uint8_t m_board_led_list[LEDS_NUMBER] = LEDS_LIST;
#endif

...is grayed out.

LEDS_NUMBER is defined in the makefile, and I followed the instructions for changing the CDT GCC Build Output Parser string. No joy.

If I define the LEDS_NUMBER explicitly in main.c, I get an error saying that it's been defined twice, because, well, it has been defined twice.

How do I make Eclipse see the makefile defines?

  • Hi, if you look at the GCC tutorial, devzone.nordicsemi.com/.../, under the chapter, Enable auto discovery of symbols, include paths and compiler settings, there is a description of the problem (Vidar told me that he thinks this is the problem). New patched makefile.common files are included in the bottom of the tutorial.

  • Hi Stian,

    I'm sorry, I should have been more clear--the GCC tutorial is the one I referenced in my post. I'd already followed the instructions under the Enable auto discovery chapter, and grabbed the patched makefile.common before posting to this forum. Here are some screenshots:

    CDT GCC Built-in Compile Settings Cross ARM

    CDT GCC Build Output Parser

    I've been through the tutorial three times, and can't figure out where I went wrong.

    Note that it compiles fine. No errors. The problem is that the defines in the makefile (not the makefile.common, but the makefile in ./examples/ble_peripheral/experimental_ble_app_eddystone/pca10040/s132/armgcc) aren't recognized by Eclipse. This makes Eclipse pretty useless as an IDE.

  • Hi Calvin, please include the build output as well. In addition, open the entries tab in the pre-processor view and expand the CDT GCC Build output Parser entry to see which symbols/include paths were included. Suspect the pre-processor symbols are missing (key symbol on entry indicates that it is partially working at least).

  • Hi Vidar,

    Here's a screenshot of the CDT entries:

    CDT Entries

    As for the build output--do you mean the info shown in the console window? It isn't very interesting, but here you go:

    07:31:53 **** Build of configuration Default for project Basicalle **** make all mkdir _build Compiling file: nrf_log_backend_serial.c Compiling file: nrf_log_frontend.c Compiling file: aes.c Compiling file: app_button.c Compiling file: app_error.c Compiling file: app_error_weak.c Compiling file: app_scheduler.c Compiling file: app_timer.c Compiling file: app_timer_appsh.c Compiling file: app_util_platform.c

    Compiling file: blockwise.c Compiling file: cifra_eax_aes.c Compiling file: cmac.c Compiling file: crc16.c Compiling file: eax.c Compiling file: es_adv.c Compiling file: es_adv_frame.c Compiling file: es_adv_timing.c Compiling file: es_adv_timing_resolver.c Compiling file: es_battery_voltage_saadc.c Compiling file: es_flash.c Compiling file: es_gatts.c Compiling file: es_security.c Compiling file: es_security_timing.c Compiling file: es_slot.c Compiling file: es_slot_reg.c Compiling file: es_tlm.c Compiling file: fds.c Compiling file: fstorage.c Compiling file: gf128.c Compiling file: hardfault_implementation.c Compiling file: modes.c Compiling file: nrf_assert.c Compiling file: nrf_ble_es.c Compiling file: sdk_errors.c Compiling file: sensorsim.c Compiling file: RTT_Syscalls_GCC.c Compiling file: SEGGER_RTT.c Compiling file: SEGGER_RTT_printf.c Compiling file: boards.c Compiling file: nrf_drv_clock.c Compiling file: nrf_drv_common.c Compiling file: nrf_drv_gpiote.c Compiling file: nrf_drv_saadc.c Compiling file: nrf_drv_uart.c Compiling file: nrf_saadc.c Compiling file: softdevice_handler.c Compiling file: bsp.c Compiling file: bsp_btn_ble.c Compiling file: bsp_nfc.c Compiling file: main.c Compiling file: ble_advdata.c Compiling file: ble_advertising.c Compiling file: ble_conn_params.c Compiling file: ble_srv_common.c Assembling file: gcc_startup_nrf52.S Compiling file: system_nrf52.c Compiling file: nrf_ble_escs.c Linking target: _build/nrf52832_xxaa.out '' text data bss dec hex filename 72904 188 4032 77124 12d44 _build/nrf52832_xxaa.out '' Preparing: _build/nrf52832_xxaa.hex Preparing: _build/nrf52832_xxaa.bin

    07:32:31 Build Finished (took 38s.179ms)

  • Sorry--that wasn't very clean...and I can't edit. Basically, the console output just shows the compiles. I think maybe I need to set verbose levels higher to get more interesting information?

Related