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

Issue Building Examples for nRF5 SDK for Mesh

I am using version 4.1 of the Mesh SDK and version 16.0.0 of the nRF5 SDK on Windows. I was able to successfully generate the ninja build files using CMake. However, when I run ninja to build the examples it fails on building ASM object. It seems that the assembler is getting called with some invalid options.

CMake Output:

C:\Users\abumbalo\.nrf\nrf5_SDK_for_Mesh_v4.1.0_src\build>cmake -G Ninja -DPLATFORM=nrf52840_xxAA ..
-- Configuring CMake for nRF5 SDK for Bluetooth Mesh 4.1.0
-- Found PythonInterp: C:/Users/abumbalo/AppData/Local/Programs/Python/Python38-32/python.exe (found version "3.8.3")
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
CMake Warning at CMake/FindSDK.cmake:24 (message):
  Could not find `patch` executable.  Automatic patching of the nRF5 SDK not
  supported.  See for diff to apply.
Call Stack (most recent call first):
  CMakeLists.txt:49 (include)

-- SDK_ROOT=C:/Users/abumbalo/.nrf/nrf5_SDK_for_Mesh_v4.1.0_src/../nRF5_SDK_16.0.0_98a08e2 --- set with default PATH
-- Setting build type to 'RelWithDebInfo' as none was specified.
-- PC-Lint executable not found. Linting disabled.
-- SDK: nRF5_SDK_16.0.0_98a08e2
-- Platform: nrf52840_xxAA
-- Arch: cortex-m4f
-- SoftDevice: s140_7.0.1
-- Board: pca10056
-- The C compiler identification is GNU 9.3.1
-- The ASM compiler identification is GNU
-- Found assembler: C:/Program Files (x86)/GNU Arm Embedded Toolchain/9 2020-q2-update/bin/arm-none-eabi-as.exe
-- Check for working C compiler: C:/Program Files (x86)/GNU Arm Embedded Toolchain/9 2020-q2-update/bin/arm-none-eabi-gcc.exe
-- Check for working C compiler: C:/Program Files (x86)/GNU Arm Embedded Toolchain/9 2020-q2-update/bin/arm-none-eabi-gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
CMake Warning at CMakeLists.txt:110 (message):
  Doxygen not found, documentation build is not available

-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/abumbalo/.nrf/nrf5_SDK_for_Mesh_v4.1.0_src/build

Ninja Output:
C:\Users\abumbalo\.nrf\nrf5_SDK_for_Mesh_v4.1.0_src\build>ninja
[66/2229] Building ASM object examples/beaconing/CMakeFiles/beaconing_nrf52840_xxAA_s...ers/abumbalo/.nrf/nRF5_SDK_16.0.0_98a08e2/modules/nrfx/mdk/gcc_startup_nrf52840.S.obj
FAILED: examples/beaconing/CMakeFiles/beaconing_nrf52840_xxAA_s140_7.0.1.dir/C_/Users/abumbalo/.nrf/nRF5_SDK_16.0.0_98a08e2/modules/nrfx/mdk/gcc_startup_nrf52840.S.obj
C:\PROGRA~2\GNUARM~1\92020-~1\bin\ARM-NO~3.EXE -DBOARD_PCA10056 -DCONFIG_GPIO_AS_PINRESET -DNRF52840 -DNRF52840_XXAA -DNRF52_SERIES -DNRF_SD_BLE_API_VERSION=7 -DS140 -DSOFTDEVICE_PRESENT -DUSE_APP_CONFIG -I../examples/beaconing/include -I../examples/beaconing/../include -I../examples/common/include -I../../nRF5_SDK_16.0.0_98a08e2/components/ble/common -I../../nRF5_SDK_16.0.0_98a08e2/components/softdevice/common -I../../nRF5_SDK_16.0.0_98a08e2/components/libraries/strerror -I../../nRF5_SDK_16.0.0_98a08e2/components/libraries/atomic -I../models/foundation/config/include -I../models/foundation/health/include -I../mesh/stack/api -I../mesh/core/api -I../mesh/core/include -I../mesh/access/api -I../mesh/access/include -I../mesh/dfu/api -I../mesh/dfu/include -I../mesh/prov/api -I../mesh/prov/include -I../mesh/bearer/api -I../mesh/bearer/include -I../mesh/gatt/api -I../mesh/gatt/include -I../mesh/friend/api -I../mesh/friend/include -I../../nRF5_SDK_16.0.0_98a08e2/components/softdevice/s140/headers -I../../nRF5_SDK_16.0.0_98a08e2/components/softdevice/s140/headers/nrf52 -I../../nRF5_SDK_16.0.0_98a08e2/modules/nrfx -I../../nRF5_SDK_16.0.0_98a08e2/modules/nrfx/mdk -I../../nRF5_SDK_16.0.0_98a08e2/modules/nrfx/hal -I../../nRF5_SDK_16.0.0_98a08e2/components/toolchain/cmsis/include -I../../nRF5_SDK_16.0.0_98a08e2/components/toolchain/gcc -I../../nRF5_SDK_16.0.0_98a08e2/components/toolchain/cmsis/dsp/GCC -I../../nRF5_SDK_16.0.0_98a08e2/components/boards -I../../nRF5_SDK_16.0.0_98a08e2/integration/nrfx -I../../nRF5_SDK_16.0.0_98a08e2/components/libraries/util -I../../nRF5_SDK_16.0.0_98a08e2/components/libraries/timer -I../../nRF5_SDK_16.0.0_98a08e2/components/libraries/log -I../../nRF5_SDK_16.0.0_98a08e2/components/libraries/log/src -I../../nRF5_SDK_16.0.0_98a08e2/components/libraries/experimental_section_vars -I../../nRF5_SDK_16.0.0_98a08e2/components/libraries/delay -I../external/rtt/include -I../external/micro-ecc -I../external/micro-ecc/../../mesh/core/include -O2 -g -DNDEBUG   -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -MD -MT examples/beaconing/CMakeFiles/beaconing_nrf52840_xxAA_s140_7.0.1.dir/C_/Users/abumbalo/.nrf/nRF5_SDK_16.0.0_98a08e2/modules/nrfx/mdk/gcc_startup_nrf52840.S.obj -MF examples\beaconing\CMakeFiles\beaconing_nrf52840_xxAA_s140_7.0.1.dir\C_\Users\abumbalo\.nrf\nRF5_SDK_16.0.0_98a08e2\modules\nrfx\mdk\gcc_startup_nrf52840.S.obj.d -o examples/beaconing/CMakeFiles/beaconing_nrf52840_xxAA_s140_7.0.1.dir/C_/Users/abumbalo/.nrf/nRF5_SDK_16.0.0_98a08e2/modules/nrfx/mdk/gcc_startup_nrf52840.S.obj -c C:/Users/abumbalo/.nrf/nRF5_SDK_16.0.0_98a08e2/modules/nrfx/mdk/gcc_startup_nrf52840.S
C:\PROGRA~2\GNUARM~1\92020-~1\bin\ARM-NO~3.EXE: unrecognized option `-BOARD_PCA10056'
[79/2229] Building C object examples/beaconing/CMakeFiles/beaconing_nrf52840_xxAA_s140_7.0.1.dir/__/__/external/app_timer/app_timer_mesh.c.obj
ninja: build stopped: subcommand failed.
I have also attached the build.ninja file that was generated by CMake
Parents
  • Hi,

    Did you follow this documentation when using CMake? Can you try including this command -DTOOLCHAIN=<toolchain>, when you generate the build files in step 1? Does it make any difference?

  • I had no problem building it here. Can you try with a fresh copy of the SDK? 

  • I reinstalled the entire toolchain including CMake and Ninja. There build fails at the same point but the error is slightly different this time. It seems that the Ninja build files being generated by CMake have errors in them.

    [51/2229] Building ASM object examples/beaconing/CMakeFile...16.0.0_98a08e2/modules/nrfx/mdk/gcc_startup_nrf52840.S.obj
    FAILED: examples/beaconing/CMakeFiles/beaconing_nrf52840_xxAA_s140_7.0.1.dir/C_/Users/abumbalo/.nrf/nRF5_SDK_16.0.0_98a08e2/modules/nrfx/mdk/gcc_startup_nrf52840.S.obj
    C:\PROGRA~2\GNUARM~1\92020-~1\bin\ARM-NO~3.EXE --defsym BOARD_PCA10056 --defsym CONFIG_GPIO_AS_PINRESET --defsym NRF52840 --defsym NRF52840_XXAA --defsym NRF52_SERIES --defsym NRF_SD_BLE_API_VERSION=7 --defsym S140 --defsym SOFTDEVICE_PRESENT --defsym USE_APP_CONFIG -I../examples/beaconing/include -I../examples/beaconing/../include -I../examples/common/include -I../../nRF5_SDK_16.0.0_98a08e2/components/ble/common -I../../nRF5_SDK_16.0.0_98a08e2/components/softdevice/common -I../../nRF5_SDK_16.0.0_98a08e2/components/libraries/strerror -I../../nRF5_SDK_16.0.0_98a08e2/components/libraries/atomic -I../models/foundation/config/include -I../models/foundation/health/include -I../mesh/stack/api -I../mesh/core/api -I../mesh/core/include -I../mesh/access/api -I../mesh/access/include -I../mesh/dfu/api -I../mesh/dfu/include -I../mesh/prov/api -I../mesh/prov/include -I../mesh/bearer/api -I../mesh/bearer/include -I../mesh/gatt/api -I../mesh/gatt/include -I../mesh/friend/api -I../mesh/friend/include -I../../nRF5_SDK_16.0.0_98a08e2/components/softdevice/s140/headers -I../../nRF5_SDK_16.0.0_98a08e2/components/softdevice/s140/headers/nrf52 -I../../nRF5_SDK_16.0.0_98a08e2/modules/nrfx -I../../nRF5_SDK_16.0.0_98a08e2/modules/nrfx/mdk -I../../nRF5_SDK_16.0.0_98a08e2/modules/nrfx/hal -I../../nRF5_SDK_16.0.0_98a08e2/components/toolchain/cmsis/include -I../../nRF5_SDK_16.0.0_98a08e2/components/toolchain/gcc -I../../nRF5_SDK_16.0.0_98a08e2/components/toolchain/cmsis/dsp/GCC -I../../nRF5_SDK_16.0.0_98a08e2/components/boards -I../../nRF5_SDK_16.0.0_98a08e2/integration/nrfx -I../../nRF5_SDK_16.0.0_98a08e2/components/libraries/util -I../../nRF5_SDK_16.0.0_98a08e2/components/libraries/timer -I../../nRF5_SDK_16.0.0_98a08e2/components/libraries/log -I../../nRF5_SDK_16.0.0_98a08e2/components/libraries/log/src -I../../nRF5_SDK_16.0.0_98a08e2/components/libraries/experimental_section_vars -I../../nRF5_SDK_16.0.0_98a08e2/components/libraries/delay -I../external/rtt/include -I../external/micro-ecc -I../external/micro-ecc/../../mesh/core/include -O2 -g -DNDEBUG -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 --MD examples\beaconing\CMakeFiles\beaconing_nrf52840_xxAA_s140_7.0.1.dir\C_\Users\abumbalo\.nrf\nRF5_SDK_16.0.0_98a08e2\modules\nrfx\mdk\gcc_startup_nrf52840.S.obj.d -o examples/beaconing/CMakeFiles/beaconing_nrf52840_xxAA_s140_7.0.1.dir/C_/Users/abumbalo/.nrf/nRF5_SDK_16.0.0_98a08e2/modules/nrfx/mdk/gcc_startup_nrf52840.S.obj -c C:/Users/abumbalo/.nrf/nRF5_SDK_16.0.0_98a08e2/modules/nrfx/mdk/gcc_startup_nrf52840.S
    Assembler messages:
    Fatal error: bad defsym; format is --defsym name=value
    [64/2229] Building C object examples/beaconing/CMakeFiles/...xAA_s140_7.0.1.dir/__/__/mesh/core/src/flash_manager.c.obj
    ninja: build stopped: subcommand failed.

  • Upon further inspection it appears that the new errors were caused by me having installed CMake Release Candidate version 3.18.0-rc2. After uninstalling and installing the latest stable release, 3.17.3, the error in my original post above persists. 

  • This seems really strange, do you have a different computer to try on?

  • I am able to successfully build that SDK and all examples on my personal Windows 10 machine. Unfortunately this doesn't help resolve the issue on my work machine. My personal computer has Windows 10 Pro version 1909 and the work computer is running Windows 10 Enterprise version 1809.

    For anyone who comes across this thread in the future, I'd suggest just trying a different computer instead of wasting time trying to hunt this one down. It seems to be a unique issue that has more to do with the specific system than errors in the toolchain.

  • Found the issue. CMake was not automatically picking up the path for the toolchain assembler so I was setting it manually through the ASM environment variable. Turns out that this build system uses arm-none-eabi-gcc.exe as the assmbler, not arm-none-eabi-as.exe like I had assumed (didn't realize gcc could be used as an assembler, I thought that was what as was for). Pointing my ASM environment variable to the GCC executable instead of the AS executable resolved the build issue.

Reply
  • Found the issue. CMake was not automatically picking up the path for the toolchain assembler so I was setting it manually through the ASM environment variable. Turns out that this build system uses arm-none-eabi-gcc.exe as the assmbler, not arm-none-eabi-as.exe like I had assumed (didn't realize gcc could be used as an assembler, I thought that was what as was for). Pointing my ASM environment variable to the GCC executable instead of the AS executable resolved the build issue.

Children
No Data
Related