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

Unable to fix all unresolved symbols in GCC Eclipse project using SDK v12.2.0

I have two questions with the remaining unresolved symbols being the most critical. I will decribed the situation I have encountered as a sequrence of chronological steps below:

  1. I am using a GCC and Eclipse (Mars 2) development environment to investigate and verify some custom prototype hardware based on the nRF52832. I am using SDK v12.2.0. I started out not using Vidar's custom version of Makefile.common and did not have incremental builds available.

  2. I cloned an existing working project for out prototype board that did build properly in order to look at a different aspect of the board.

  3. The actual make succeded and produced a working executable but Eclipse displayed many unresolved symbols.

  4. Looking at Vidar's tutorial "Development with GCC and Eclipse" (Tutorial 7), I decided that I should try using his version of Makefile.common that is available through a link in the tutorial. When I did this, the project failed to build with the following errors:

09:00:40 **** Build of configuration Default for project separated_stim_pulse_generator_CStim_1_0_0_SDK_12_2 **** make VERBOSE=1 all mkdir _build Compiling file: nrf_log_backend_serial.c 'C:/Program Files/GNU Tools ARM Embedded/5.3 2016q1/bin/arm-none-eabi-gcc' -MP -MD -std=c99 -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52 -DNRF52_PAN_51 -DNRF52_PAN_36 -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_64 -DNRF52_PAN_55 -DBOARD_CStim_1_0_0 -DNRF52_PAN_31 -DNRF52832 -DBSP_DEFINES_ONLY -mcpu=cortex-m4 -mthumb -mabi=aapcs -Wall -Werror -O0 -g3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -I"../../../../../../components" -I"../../../../../../components/libraries/util" -I"../../../../../../components/toolchain/gcc" -I"../../../../../../components/drivers_nrf/uart" -I"../../../../../../components/drivers_nrf/timer" -I"../../../../../../components/drivers_nrf/saadc" -I"../config" -I"../../../../../../components/drivers_nrf/common" -I"../../.." -I"../../../../../../components/drivers_nrf/twi_master" -I"../../../../../../external/segger_rtt" -I"../../../../../../components/libraries/bsp" -I"../../../../../../components/drivers_nrf/nrf_soc_nosd" -I"../../../../../../components/toolchain" -I"../../../../../../components/device" -I"../../../../../../components/libraries/log" -I"../../../../../../components/boards" -I"../../../../../../components/drivers_nrf/delay" -I"../../../../../../components/toolchain/cmsis/include" -I"../../../../../../components/drivers_nrf/hal" -I"../../../../../../components/libraries/scheduler" -I"../../../../../../components/libraries/log/src" -c -o _build/nrf52832_xxaa_nrf_log_backend_serial.c.o ../../../../../../components/libraries/log/src/nrf_log_backend_serial.c ''C:' is not recognized as an internal or external command, operable program or batch file. make: *** [_build/nrf52832_xxaa_nrf_log_backend_serial.c.o] Error 1

09:00:41 Build Finished (took 662ms)

  1. I did a diff between the two version of Makefile.common and found that the toolpaths were quoted wih single quotes in Vidar's version but with double quotes in the other version so I changed Vidar's version to use double quotes resulting in the following changed lines:

CC := "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-gcc" CXX := "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-c++" AS := "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-as" AR := "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-ar" -r LD := "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-ld" NM := "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-nm" OBJDUMP := "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-objdump" OBJCOPY := "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-objcopy" SIZE := "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-size"

The build no longer failed completely but still resulted in the unresolved symbols. I also checked and, as expected, incremental builds now worked.

  1. I then did a very careful check of the project properties and found a typo in the "Compiler command pattern". After fixing the typo the majority of the unresolved symbols were no longer unresolved. However, a number of unresolved symbols were still there.

  2. The majority of the remaining unresolved symbols came from the bsp header file in .../components/boards that defines our prototype board (equivalent to ,say, pca10040.h.) There were still a few that did not come from that file as well.

  3. I added out BSP header file to Project Explorer under Board Definition in the relevant project. When I opened this file in the Eclipse editor, it displayed the error 'unresolved include "nrf_gpio.h" at the line that reads '#include "nrf_gpio.h"'.

  4. All the user code for this test project is in main.c so I checked under the "Preprocessor Include Paths..." property for the main.c file. All the appropriate paths are listed under "CDT GCC Build Output Parser" as far as I can tell.

  5. In summary:

There are two issues that I would appreciate some help with:

i) What should I be looking for to determine why the unmodified version of Vidar's Makefile.common fails?

ii) What should I be looking for to determine why I still have unresolved symbols particularly from the BSP header file.

Related