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

Cannot build nRF5 SDK Mesh

I am having errors building the examples in the latest SDK for Mesh (nrf5_SDK_for_Mesh_v0.10.0-Alpha_src). I ran cmake -DTOOLCHAIN=gccarmemb -DPLATFORM=nrf52840_xxAA .. in my build directory which appears to be working just fine. However when I do make I have errors linkings the c executable.

[ 25%] Linking C executable beaconing_nrf52840_xxAA_s140_5.0.0-3.alpha.elf

CMakeFiles/beaconing_nrf52840_xxAA_s140_5.0.0-3.alpha.dir/src/main.c.obj: In function `rx_callback':

main.c:(.text.rx_callback+0xdc): undefined reference to `log_printf'

main.c:(.text.rx_callback+0x104): undefined reference to `g_log_debug_msk'

main.c:(.text.rx_callback+0x108): undefined reference to `g_log_debug_level'

main.c:(.text.rx_callback+0x10c): undefined reference to `g_log_hex_digits'

CMakeFiles/beaconing_nrf52840_xxAA_s140_5.0.0-3.alpha.dir/src/main.c.obj: In function `main':

main.c:(.text.startup.main+0x42): undefined reference to `log_init'

main.c:(.text.startup.main+0x5a): undefined reference to `nrf_mesh_rx_cb_set'

main.c:(.text.startup.main+0x66): undefined reference to `advertiser_instance_init'

main.c:(.text.startup.main+0x6e): undefined reference to `advertiser_packet_alloc'

main.c:(.text.startup.main+0x88): undefined reference to `advertiser_packet_send'

main.c:(.text.startup.main+0x98): undefined reference to `nrf_mesh_process'

main.c:(.text.startup.main+0xc0): undefined reference to `log_printf'

main.c:(.text.startup.main+0xe8): undefined reference to `log_printf'

main.c:(.text.startup.main+0x124): undefined reference to `g_log_debug_msk'

main.c:(.text.startup.main+0x128): undefined reference to `log_callback_rtt'

main.c:(.text.startup.main+0x12c): undefined reference to `g_log_debug_level'

...... (didn't copy the full error message)

collect2: error: ld returned 1 exit status

make[2]: *** [examples/beaconing/beaconing_nrf52840_xxAA_s140_5.0.0-3.alpha.elf] Error 1

make[1]: *** [examples/beaconing/CMakeFiles/beaconing_nrf52840_xxAA_s140_5.0.0-3.alpha.dir/all] Error 2

make: *** [all] Error 2

Any idea why?

  • Hi cdugue,

    The specific problem seems to be that the linker can't find the objects from nrf_mesh.c, log.c and advertiser.c. Did you modify the SDK in any way? Which platform are you using? Windows, Linux or Mac OS? I tried replicating your issue by downloading a fresh copy of the SDK and building it in the following way, but it didn't return any errors for me:

    wget www.nordicsemi.com/.../126781 -O mesh_sdk.zip
    unzip mesh_sdk.zip -d mesh_sdk
    mkdir mesh_sdk/build
    cd mesh_sdk/build
    cmake -DTOOLCHAIN=gccarmemb -DPLATFORM=nrf52840_xxAA ..
    make
    

    Output from CMake:

    -- Configuring CMake for nRF5 SDK for Bluetooth Mesh 0.10.0-Alpha
    -- Found PythonInterp: /home/ths1/dev/mesh/bin/python (found version "3.5.2") 
    -- Found Doxygen: /usr/bin/doxygen (found version "1.8.11") found components:  doxygen dot 
    -- Setting build type to 'Release' as none was specified.
    -- SDK_ROOT=/tmp/external/nRF5_SDK_14.0.0_3bcc1f7 --- set with default PATH
    -- Platform: nrf52840_xxAA
    -- Arch: cortex-m4f
    -- SoftDevice: s140_5.0.0-3.alpha
    -- Board: pca10056
    -- PC-Lint executable not found. Linting disabled.
    -- The C compiler identification is GNU 6.3.1
    -- The ASM compiler identification is GNU
    -- Found assembler: /usr/bin/arm-none-eabi-gcc
    -- Check for working C compiler: /usr/bin/arm-none-eabi-gcc
    -- Check for working C compiler: /usr/bin/arm-none-eabi-gcc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /tmp/mesh_sdk/build
    

    Edit: This was done on Ubuntu MATE 16.04.

    Hope this helps,
    Thomas

  • Hi Thomas,

    Thanks for your help. I followed your steps on my mac and it worked just fine, I was able to build the files.

Related