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

Mesh compilation error

Based on mesh sdk 3.1, open NRF_LOG_ENABLED in the light_switch_server example, ie NRF_LOG_ENABLED 1, the following error occurred during compilation:
Linking light_switch_server_nrf52840_xxAA_s140_6.1.0.elf
build/light_switch_server_nrf52840_xxAA_s140_6.1.0_Debug/obj/nrf_sdh_ble.o: in function `nrf_sdh_ble_default_cfg_set':
undefined reference to `nrf_strerror_get'
E:\Nordic\nRF5_SDK_15.2.0_9412b96\components\softdevice\common/nrf_sdh_ble.c:133: undefined reference to `nrf_log_frontend_std_1'
E:\Nordic\nRF5_SDK_15.2.0_9412b96\components\softdevice\common/nrf_sdh_ble.c:149: undefined reference to `nrf_strerror_get'
E:\Nordic\nRF5_SDK_15.2.0_9412b96\components\softdevice\common/nrf_sdh_ble.c:149: undefined reference to `nrf_log_frontend_std_1'
E:\Nordic\nRF5_SDK_15.2.0_9412b96\components\softdevice\common/nrf_sdh_ble.c:162: undefined reference to `nrf_strerror_get'
E:\Nordic\nRF5_SDK_15.2.0_9412b96\components\softdevice\common/nrf_sdh_ble.c:162: undefined reference to `nrf_log_frontend_std_1'
E:\Nordic\nRF5_SDK_15.2.0_9412b96\components\softdevice\common/nrf_sdh_ble.c:175: undefined reference to `nrf_strerror_get'
E:\Nordic\nRF5_SDK_15.2.0_9412b96\components\softdevice\common/nrf_sdh_ble.c:175: undefined reference to `nrf_log_frontend_std_1'
E:\Nordic\nRF5_SDK_15.2.0_9412b96\components\softdevice\common/nrf_sdh_ble.c:186: undefined reference to `nrf_strerror_get'
E:\Nordic\nRF5_SDK_15.2.0_9412b96\components\softdevice\common/nrf_sdh_ble.c:186: undefined reference to `nrf_log_frontend_std_1'
E:\Nordic\nRF5_SDK_15.2.0_9412b96\components\softdevice\common/nrf_sdh_ble.c:197: undefined reference to `nrf_strerror_get'
E:\Nordic\nRF5_SDK_15.2.0_9412b96\components\softdevice\common/nrf_sdh_ble.c:197: undefined reference to `nrf_log_frontend_std_1'
build/light_switch_server_nrf52840_xxAA_s140_6.1.0_Debug/obj/nrf_sdh_ble.o: in function `nrf_sdh_ble_enable':
undefined reference to `nrf_log_frontend_std_0'
E:\Nordic\nRF5_SDK_15.2.0_9412b96\components\softdevice\common/nrf_sdh_ble.c:231: undefined reference to `nrf_log_frontend_std_2'
E:\Nordic\nRF5_SDK_15.2.0_9412b96\components\softdevice\common/nrf_sdh_ble.c:233: undefined reference to `nrf_log_frontend_std_1'
E:\Nordic\nRF5_SDK_15.2.0_9412b96\components\softdevice\common/nrf_sdh_ble.c:254: undefined reference to `nrf_strerror_get'
E:\Nordic\nRF5_SDK_15.2.0_9412b96\components\softdevice\common/nrf_sdh_ble.c:254: undefined reference to `nrf_log_frontend_std_1'
Build failed

why?How to solve it?

Parents Reply Children
  • open NRF_LOG_ENABLED in the light_switch_server example, ie NRF_LOG_ENABLED 1

    A NRF_LOG_ENABLED of 0 can be compiled successfully. Which macros do you need to define when NRF_LOG_ENABLED is set to 1?

  • You can use the free Keil download to view the sdk_config.h structure:

    There is also the 3rd-party Java utility, "CMSIS Configuration Wizard", but I find Keil far superior:

    https://devzone.nordicsemi.com/f/nordic-q-a/45362/cmsis-configuration-wizard---option-highlighting/178343#178343

    Keil can also show you the plain text - where you can read the comments describing each option:

    :

    Again, look at the settings in a project where the NRF_LOG is enabled & working - and use that to make appropriate settings.

    EDIT

    You can run 2 (or more) instances of uVision to view 2 (or more) sdk_config.h files side-by-side.

    The attached ZIP file contains a uVision Project for viewing & editing the sdk_config.h file and nothing else.

    Simply extract the sdk_config.uvoptx and sdk_config.uvprojx files into the same folder as the sdk_config.h file.

    2262.uvision_sdk_config.zip

  • Have you set up the SDK ROOT macro

    I think would have other problems if that were the issue?

    eg,

    A NRF_LOG_ENABLED of 0 can be compiled successfully

    I don't think that would happen with a missing or incorrect SDK_ROOT ?

    Clearly, if NRF_LOG is enabled, then all its required configurations also need to be present & correct.

  • Hi.

    Try adding these includes:

    And the source files:

    nrf_strerror.c

    nrf_balloc.c

    nrf_memobj.c

    nrf_log_frontend.c

    Best regards,

    Andreas

  • Hi AndreasF

      How does SEGGER Embedded Studio add a header file path?