undefined reference to `ble_advertising_on_ble_evt' errors

I use SKD 17.1.0, pca10100 and nRF52833.

When I execute "make -j all" at "armgcc" folder" in the terminal. I get the following errors:

PS C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc> make -j all
Linking target: _build/nrf52833_xxaa.out
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52833_xxaa/main.c.o: in function `ble_evt_handler':
C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc/../../../main.c:502: undefined reference to `bsp_indication_set'
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52833_xxaa/main.c.o: in function `sleep_mode_enter':
C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc/../../../main.c:443: undefined reference to `bsp_indication_set'
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc/../../../main.c:447: undefined reference to `bsp_btn_ble_sleep_mode_prepare'
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52833_xxaa/main.c.o: in function `bsp_event_handler':
C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc/../../../main.c:643: undefined reference to `ble_advertising_restart_without_whitelist'
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52833_xxaa/main.c.o: in function `advertising_start':
C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc/../../../main.c:749: undefined reference to `ble_advertising_start'
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52833_xxaa/main.c.o: in function `pm_evt_handler':
C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc/../../../main.c:212: undefined reference to `pm_conn_sec_config_reply'
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc/../../../main.c:218: undefined reference to `fds_gc'
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52833_xxaa/main.c.o: in function `on_adv_evt':
C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc/../../../main.c:470: undefined reference to `bsp_indication_set'
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52833_xxaa/main.c.o: in function `sleep_mode_enter':
C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc/../../../main.c:443: undefined reference to `bsp_indication_set'
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc/../../../main.c:447: undefined reference to `bsp_btn_ble_sleep_mode_prepare'
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc/../../../main.c:447: undefined reference to `bsp_btn_ble_sleep_mode_prepare'
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52833_xxaa/main.c.o: in function `buttons_leds_init':
C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc/../../../main.c:694: undefined reference to `bsp_init'
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc/../../../main.c:697: undefined reference to `bsp_btn_ble_init'

c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52833_xxaa/main.c.o: in function `services_init':
C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc/../../../main.c:363: undefined reference to `our_service_init'
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52833_xxaa/main.c.o: in function `advertising_init':
C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc/../../../main.c:678: undefined reference to `ble_advertising_init'
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc/../../../main.c:681: undefined reference to `ble_advertising_conn_cfg_tag_set'
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52833_xxaa/main.c.o: in function `peer_manager_init':
C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc/../../../main.c:577: undefined reference to `pm_init'
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc/../../../main.c:596: undefined reference to `pm_sec_params_set
'
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc/../../../main.c:599: undefined reference to `pm_register'     
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52833_xxaa/main.c.o: in function `delete_bonds':
C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc/../../../main.c:612: undefined reference to `pm_peers_delete'
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52833_xxaa/main.c.o: in function `advertising_start':
C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc/../../../main.c:749: undefined reference to `ble_advertising_start'
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52833_xxaa/main.c.o:C:\Users\alper\Desktop\nRF5_SDK\nRF5_SDK_17.1.0\nRF5_SDK_17.1.0_ddde560\examples\my_projects\fw_adv_template_copy_service_sdkconfig\pca10100\s140\armgcc/../../../main.c:124: undefined reference to `ble_advertising_on_ble_evt'
Memory region         Used Size  Region Size  %age Used
           FLASH:       23800 B       356 KB      6.53%
             RAM:        3384 B     120088 B      2.82%
collect2.exe: error: ld returned 1 exit status
make: *** [../../../../../../components/toolchain/gcc/Makefile.common:294: _build/nrf52833_xxaa.out] Error 1

This is my project folder.

I tried to change the values of some "#define" statements in "config" files but it didn't work.

Thanks,

Omer

  • Hi Omer,

    Either you are missing the source files and/or include directories in your Makefile or the correct configurations are not set in sdk_config.h.

    Please make sure that the following source files are added to SRC_FILES:

    • components/libraries/bsp/bsp_btn_ble.c
    • components/ble/peer_manager/peer_manager.c
    • components/ble/ble_advertising/ble_advertising.c
    • components/libraries/bsp/bsp.c

    And the following include directories to INC_FOLDERS:

    • components/libraries/bsp
    • components/ble/peer_manager
    • components/ble/ble_advertising
    • components/libraries/bsp

    Then make sure that the following are enabled (set to 1) in sdk_config.h:

    • BSP_BTN_BLE_ENABLED
    • PEER_MANAGER_ENABLED
    • BLE_ADVERTISING_ENABLED

    Best regards,

    Marte

  • Hey Marte,

    I really appreciate your feedback since it turned out to be a very fundamental problem to solve. With the help of you, I managed to see it clearly and solve it.

    Thanks,

    Omer

Related