I have an embedded C project that builds and runs just fine using make on the console, but Eclipse CDT is giving me errors.
In main.c
, this function uses a macro, APP_BUTTON_INIT
:
static void buttons_init(void)
{
static app_button_cfg_t buttons[] =
{
{SIGNAL_ALERT_BUTTON, false, NRF_GPIO_PIN_NOPULL, button_event_handler},
{BONDMNGR_DELETE_BUTTON_PIN_NO, false, NRF_GPIO_PIN_NOPULL, NULL}
};
APP_BUTTON_INIT(buttons, sizeof(buttons) / sizeof(buttons[0]), BUTTON_DETECTION_DELAY, false);
}
The APP_BUTTON_INIT
macro is defined in app_button.h
like this:
#define APP_BUTTON_INIT(BUTTONS, BUTTON_COUNT, DETECTION_DELAY, USE_SCHEDULER) \
do \
{ \
uint32_t ERR_CODE = app_button_init((BUTTONS), \
(BUTTON_COUNT), \
(DETECTION_DELAY), \
(USE_SCHEDULER) ? app_button_evt_schedule : NULL); \
APP_ERROR_CHECK(ERR_CODE); \
} while (0)
The error is
Symbol 'app_button_evt_schedule' could not be resolved
But that function is defined further down in the very same header file, app_button.h
:
static __INLINE uint32_t app_button_evt_schedule(app_button_handler_t button_handler,
uint8_t pin_no)
{
app_button_event_t buttons_event;
buttons_event.button_handler = button_handler;
buttons_event.pin_no = pin_no;
return app_sched_event_put(&buttons_event, sizeof(buttons_event), app_button_evt_get);
}
I've tried Project right click -> Index -> Rebuild and Freshen all files, no joy. I'm using Eclipse Kepler SR1 with CDT 8.2.1. Why can't Eclipse see this function?
The first operation of the Makefile
is this (this works):
mkdir _build
"/Users/Eliot/dev/gcc-arm/bin/arm-none-eabi-gcc" -DNRF51822_QFAA_CA -mcpu=cortex-m0 -mthumb -mabi=aapcs -DNRF51 -DBOARD_NRF6310 -DNRF51822_QFAA_CA --std=gnu99 -Wall -Werror -mfloat-abi=soft -DDEBUG -g3 -O0 -I"/Users/Eliot/dev/nrf51822/Include/ble" -I"/Users/Eliot/dev/nrf51822/Include/ble/softdevice" -I"/Users/Eliot/dev/nrf51822/Include/app_common" -I"/Users/Eliot/dev/nrf51822/Include/ble/ble_services" -I"../" -I"/Users/Eliot/dev/nrf51822/Include" -I"/Users/Eliot/dev/nrf51822/Include/gcc" -I"/Users/Eliot/dev/nrf51822/Include/ext_sensors" -M ../main.c -MF "_build/main.d" -MT _build/main.o
Screenshots for my CDT project config for includes, symbols and the tool chain are here:
https://dl.dropboxusercontent.com/u/12173473/screenshot_cdt_includes.png https://dl.dropboxusercontent.com/u/12173473/screenshot_cdt_symbols.png https://dl.dropboxusercontent.com/u/12173473/screenshot_cdt_toolchain.png
I'm not using a toolchain because my project started out as the sample CDT project from the hardware manufacturer (Nordic Semiconductor) and that project also had no toolchain configured. To be honest, I doubt CDT is finding the right gcc executable.