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

Eclipse undefined reference

Hello All,

I've finally managed to get Eclipse up and running after migrating from Keil, but now I'm having the following problem: I'm trying to port the buttonless_dfu example in to my project. However the linker gives the following warnings that I can't find the cause of:

"C:/MinGW/bin/mingw32-make" -s --no-print-directory -f C:\Rigado\nRF5_SDK_13.1.0_7ca7556/components/toolchain/gcc/file_list.mk > _build/nrf52832_xxaa.in
Linking target: _build/nrf52832_xxaa.out
"C:/Program Files (x86)/GNU Tools ARM Embedded/4.9 2015q3/bin/arm-none-eabi-gcc" -Wl,-Map=_build/nrf52832_xxaa.map -mthumb -mabi=aapcs -L C:\Rigado\nRF5_SDK_13.1.0_7ca7556/components/toolchain/gcc -Tgriptracer_nrf52.ld -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections --specs=nano.specs -lc -lnosys @_build/nrf52832_xxaa.in -lm -o _build/nrf52832_xxaa.out
_build/nrf52832_xxaa_dfu.c.o: In function `pm_evt_handler':
C:\Rigado\nRF5_SDK_13.1.0_7ca7556\GripTracer/BLE/dfu.c:124: undefined reference to `pm_conn_sec_config_reply'
C:\Rigado\nRF5_SDK_13.1.0_7ca7556\GripTracer/BLE/dfu.c:130: undefined reference to `fds_gc'
C:\Rigado\nRF5_SDK_13.1.0_7ca7556\Project/BLE/dfu.c:149: undefined reference to `pm_local_database_has_changed'
_build/nrf52832_xxaa_dfu.c.o: In function `peer_manager_init':
C:\Rigado\nRF5_SDK_13.1.0_7ca7556\Project/BLE/dfu.c:579: undefined reference to `pm_init'
C:\Rigado\nRF5_SDK_13.1.0_7ca7556\Project/BLE/dfu.c:598: undefined reference to `pm_sec_params_set'
C:\Rigado\nRF5_SDK_13.1.0_7ca7556\Project/BLE/dfu.c:601: undefined reference to `pm_register'
_build/nrf52832_xxaa_dfu.c.o: In function `delete_bonds':
C:\Rigado\nRF5_SDK_13.1.0_7ca7556\Project/BLE/dfu.c:614: undefined reference to `pm_peers_delete'
_build/nrf52832_xxaa_dfu.c.o: In function `gatt_init':
C:\Rigado\nRF5_SDK_13.1.0_7ca7556\Project/BLE/dfu.c:691: undefined reference to `nrf_ble_gatt_init'
_build/nrf52832_xxaa_ble_advertising.c.o: In function `flash_access_in_progress':
C:\Rigado\nRF5_SDK_13.1.0_7ca7556/components/ble/ble_advertising/ble_advertising.c:213: undefined reference to `fs_queued_op_count_get'
collect2.exe: error: ld returned 1 exit status
mingw32-make: *** [_build/nrf52832_xxaa.out] Error 1
C:\Rigado\nRF5_SDK_13.1.0_7ca7556/components/toolchain/gcc/Makefile.common:153: recipe for target '_build/nrf52832_xxaa.out' failed

I've checked my makefile with that of the example and I got all the includes and .c included and all .c files compile without warnings. But when I'm in the editor and try to follow the fds_gc and press F3 to follow the symbol, it brings me to fds.h instead of fds.c. I guess that there's a file not included somewhere in either the makefile or my project?

If anyone could help me find the cause of this error, I'd appreciate that greatly.

  • Have you checked to make sure peer_manager and FDS are enabled in sdk_config.h?

    Sounds like an error I had and enabling them there fixed my problems.

    Do a file compare between your sdk_config.h file and the donor project's sdk_config.h file. I use a free program called ExamDiff - it works very well and can only show you the differences if you want side by side.

    My Eclipse (neon) also points to fds.h when I f3 on fds_gc. If you figure this out, let me know.

    Hope this helps...

  • Indeed I had forgotten to enable the peer, FDS and some other functionalities in the sdk_config.h file. I've used notepadd++ compare to find the missing settings. Now with all the definitions set, my project compiles without warnings. fds_gx still points to its function prototype in fds.h, when I F3 but that's not an issue for me.

Related