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

Including "FDS.c" causes many undefined references errors

I am using ble_app_uart as my code base. I included FDS.c and FDS.h when I compiled, it presented many config errors. I compared the two config files for the FDS example and ble_app_uart, adding lines to my sdk_config.h to combine them into one. However when I compile it, the terminal prints out undefined references. How would I go around fixing this issue?

nRF52840 DK, and SDK 15.3.0.

Here is my debug log:

Linking target: _build/nrf52840_xxaa.out
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/nrf_log_frontend.c.o: in function `log_cmd':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/log/src/nrf_log_frontend.c:1554: undefined reference to `nrf_cli_fprintf'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/log/src/nrf_log_frontend.c:1550: undefined reference to `nrf_cli_help_print'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/nrf_log_frontend.c.o: in function `log_cmd_backends_list':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/log/src/nrf_log_frontend.c:1411: undefined reference to `nrf_cli_fprintf'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/log/src/nrf_log_frontend.c:1404: undefined reference to `nrf_cli_fprintf'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/log/src/nrf_log_frontend.c:1391: undefined reference to `nrf_cli_help_print'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/nrf_log_frontend.c.o: in function `nrf_cli_backend_cmd_execute':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/log/src/nrf_log_frontend.c:1118: undefined reference to `nrf_cli_fprintf'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/log/src/nrf_log_frontend.c:1118: undefined reference to `nrf_cli_fprintf'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/nrf_log_frontend.c.o: in function `log_status':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/log/src/nrf_log_frontend.c:1139: undefined reference to `nrf_cli_fprintf'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/log/src/nrf_log_frontend.c:1140: undefined reference to `nrf_cli_fprintf'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/log/src/nrf_log_frontend.c:1151: undefined reference to `nrf_cli_fprintf'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/nrf_log_frontend.c.o:C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/log/src/nrf_log_frontend.c:1137: more undefined references to `nrf_cli_fprintf' follow
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/nrf_log_frontend.c.o: in function `log_config_store_cmd':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/log/src/nrf_log_frontend.c:1502: undefined reference to `nrf_cli_help_print'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/nrf_log_frontend.c.o: in function `log_config_load_cmd':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/log/src/nrf_log_frontend.c:1484: undefined reference to `nrf_cli_fprintf'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/log/src/nrf_log_frontend.c:1488: undefined reference to `nrf_cli_fprintf'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/log/src/nrf_log_frontend.c:1477: undefined reference to `nrf_cli_help_print'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/nrf_balloc.c.o: in function `nrf_balloc_status':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/balloc/nrf_balloc.c:104: undefined reference to `nrf_cli_fprintf'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/balloc/nrf_balloc.c:87: undefined reference to `nrf_cli_fprintf'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/balloc/nrf_balloc.c:81: undefined reference to `nrf_cli_help_print'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/main.c.o: in function `gc_record_copy':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/fds/fds.c:990: undefined reference to `nrf_fstorage_write'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/main.c.o: in function `gc_swap_erase':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/fds/fds.c:951: undefined reference to `nrf_fstorage_erase'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/fds/fds.c:951: undefined reference to `nrf_fstorage_erase'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/main.c.o: in function `page_tag_write_data':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/fds/fds.c:359: undefined reference to `nrf_fstorage_write'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/main.c.o: in function `init_execute':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/fds/fds.c:1162: undefined reference to `nrf_fstorage_erase'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/main.c.o: in function `page_tag_write_swap':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/fds/fds.c:350: undefined reference to `nrf_fstorage_write'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/main.c.o: in function `record_header_flag_dirty':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/fds/fds.c:797: undefined reference to `nrf_fstorage_write'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/main.c.o: in function `gc_page_erase':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/fds/fds.c:966: undefined reference to `nrf_fstorage_erase'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/main.c.o: in function `gc_record_copy':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/fds/fds.c:990: undefined reference to `nrf_fstorage_write'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/main.c.o: in function `record_header_write_begin':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/fds/fds.c:749: undefined reference to `nrf_fstorage_write'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/main.c.o: in function `record_header_flag_dirty':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/fds/fds.c:797: undefined reference to `nrf_fstorage_write'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/main.c.o: in function `record_header_write_id':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/fds/fds.c:765: undefined reference to `nrf_fstorage_write'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/main.c.o: in function `record_write_data':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/fds/fds.c:878: undefined reference to `nrf_fstorage_write'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/main.c.o:C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/fds/fds.c:749: more undefined references to `nrf_fstorage_write' follow
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/main.c.o: in function `gc_swap_erase':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/fds/fds.c:951: undefined reference to `nrf_fstorage_erase'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/main.c.o: in function `page_tag_write_data':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/fds/fds.c:359: undefined reference to `nrf_fstorage_write'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/main.c.o: in function `flash_subsystem_init':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/fds/fds.c:1662: undefined reference to `nrf_fstorage_init'
c:/users/sam/appdata/roaming/xpacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.7.1/.content/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/main.c.o: in function `pages_init':
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc/../../../../../../components/libraries/fds/fds.c:677: undefined reference to `nrf_fstorage_sd'
collect2.exe: error: ld returned 1 exit status
make: *** [../../../../../../components/toolchain/gcc/Makefile.common:294: _build/nrf52840_xxaa.out] Error 1
C:\Users\sam\Desktop\project_work\nRF5_SDK_15.3.0_59ac345\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_uart\project\s140\armgcc>

Parents
  • Hi,

    "Undefined reference" from the linker means that whatever has not been defined was not compiled. Typically, that is either because you have not included the .c files in your project, or that the preprocessor has stripped out what you needed (typically because of it not being enabled in sdk_config.h when you are working with the nRF5 SDK).

    There are several methods to solve this, but I suggest the following:

    • Look at a project that uses FDS (for instance the Flash Data Storage Example). Add any files and include paths that you are missing from there.
    • Check the sdk_config of the example project, and update your SDK config so that it enabled what seems relevant.

    This would hopefully solve some of the errors. For the rest, you should systematically start from the top and:

    • See which reference is missing
    • Search the code for the reference, and make sure that you include the source file which has it implemented.
    • Then check the source file to see if there are any preprocessor macros (#if, #ifdef, etc.) that controls if it s included. Often there is, and it is controlled by defines in sdk_config.h. If so, update your sdk_config.h to include the relevant configuration.
    • Build and start from the top with the next error
    • When done, there should not be any more errors.
Reply
  • Hi,

    "Undefined reference" from the linker means that whatever has not been defined was not compiled. Typically, that is either because you have not included the .c files in your project, or that the preprocessor has stripped out what you needed (typically because of it not being enabled in sdk_config.h when you are working with the nRF5 SDK).

    There are several methods to solve this, but I suggest the following:

    • Look at a project that uses FDS (for instance the Flash Data Storage Example). Add any files and include paths that you are missing from there.
    • Check the sdk_config of the example project, and update your SDK config so that it enabled what seems relevant.

    This would hopefully solve some of the errors. For the rest, you should systematically start from the top and:

    • See which reference is missing
    • Search the code for the reference, and make sure that you include the source file which has it implemented.
    • Then check the source file to see if there are any preprocessor macros (#if, #ifdef, etc.) that controls if it s included. Often there is, and it is controlled by defines in sdk_config.h. If so, update your sdk_config.h to include the relevant configuration.
    • Build and start from the top with the next error
    • When done, there should not be any more errors.
Children
Related