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

install and build asset tracker on Mac OS Catalina

OS: Mac OS Catalina

I installed build tools,nrf connect sdk, sesames, tool chain by following the instructions mentioned in "Getting started assistant" of nRF connect 3.6.0. I am using SDK 1.4.0

I start SES, Open nRF Connect SDK project and select 1.4.0 for SDK (and NONE (use SES settings/environment PATH for tool chain version given that's the only choice I am given)

Projects: asset_tracker

Board name: thingy91_nrf9160ns

Extra Cake build options: -DWEST=/Users/sshenoy105/Library/Python/3.8/bin/west 

Clean build directory is checked..

and I get the following error: "create_nordic_project.py failed(1)

The SES console has the following:
Kconfig header saved to '/Users/sshenoy105/Documents/code/ncs/nrf/applications/asset_tracker/build_thingy91_nrf9160ns/zephyr/include/generated/autoconf.h'

-- The C compiler identification is GNU 8.3.1
-- The CXX compiler identification is GNU 8.3.1
-- The ASM compiler identification is GNU
-- Found assembler: /opt/gnuarmemb/bin/arm-none-eabi-gcc
-- Configuring incomplete, errors occurred!
See also "/Users/sshenoy105/Documents/code/ncs/nrf/applications/asset_tracker/build_thingy91_nrf9160ns/CMakeFiles/CMakeOutput.log".
See also "/Users/sshenoy105/Documents/code/ncs/nrf/applications/asset_tracker/build_thingy91_nrf9160ns/CMakeFiles/CMakeError.log".
Including boilerplate (Zephyr base): /Users/sshenoy105/Documents/code/ncs/zephyr/cmake/app/boilerplate.cmake
thingy91_nrf9160ns.dts.pre.tmp:357.32-361.5: Warning (simple_bus_reg): /soc/cryptocell-sw: missing or empty reg/ranges property
thingy91_nrf9160ns.dts.pre.tmp:56.42-68.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@40000000/flash-controller@39000: duplicate unit-address (also used in node /soc/peripheral@40000000/kmu@39000)
thingy91_nrf9160ns.dts.pre.tmp:305.19-311.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@40000000/clock@5000: duplicate unit-address (also used in node /soc/peripheral@40000000/power@5000)
CMake Error at /Users/sshenoy105/Documents/code/ncs/zephyr/cmake/extensions.cmake:1557 (message):
  Assertion failed: The toolchain is unable to build a dummy C file.  See
  CMakeError.log.
Call Stack (most recent call first):
  /Users/sshenoy105/Documents/code/ncs/zephyr/CMakeLists.txt:42 (assert)

error: cmake failed
create_nordic_project.py failed (1)


CMakeError.log has the following:

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /opt/gnuarmemb/bin/arm-none-eabi-g++
Build flags:
Id flags:

The output was:
1
/opt/gnuarmemb/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /opt/gnuarmemb/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-exit.o): in function `exit':
exit.c:(.text.exit+0x2c): undefined reference to `_exit'
collect2: error: ld returned 1 exit status

I have already tried
  • Run xattr -r -d com.apple.quarantine /path/to/folder where path/to/folder is the path to the enclosing folder where the executables you want to run are located.

  • Open “System Preferences” -> “Security and Privacy” -> “Privacy” and then scroll down to “Developer Tools”. Then unlock the lock to be able to make changes and check the checkbox corresponding to your terminal emulator of choice. This will apply to any executable being launched from such terminal program.

I have been asked to "try" Tool chai manager but it has a not-so-encouraging note right at the top that says "experimental" and I am wondering if getting started can't get me going, will this experimental procesdue do any better..

any help, pointers, will be greatly appreciated

Parents
  • Hi! 

    I'm looking at your case and are trying to test it out here. Will update you on how that goes tomorrow.

    In the meantime, how did you call the xattr command (i.e. which folder did you target). I had to do like this xattr -r -d com.apple.quarantine ~/gnuarmemb/*.

    Best regards,
    Carl Richard

  • good question.. just to be sure I now tried xattr -r -d com.apple.quarantine /opt/gnuarmemb/*  but it made no difference

  • Further discoveries:

    I am only able to get things working when I start SES from the terminal:

    /opt/nordic/ncs/v1.4.0/toolchain/segger_embedded_studio/SEGGER\ Embedded\ Studio.app/Contents/MacOS/emStudio
    and configure ninja under Tools > Options > nRF Connect to the instance I installed using brew:

    brew install ninja

    I tried the ninja instance that comes bundled with the SDK, but encountered the anomalies all over again. My hypothesis therefore is that something's probably amiss with the bundled ninja. It also appears that starting SES from the Toolchain Manager (as opposed to the terminal) 'forces' the bundled tools into play, so will result in anomalies resurfacing. However, I cannot dismiss the possibility that the fault could be rooted in my setup. 

  • Hi again, sshenoy. My apologies, I should have mentioned this: ZEPHYR_BASE should be set by the "source <ncs_root>/zephyr/zephyr-env.sh" script, but it seems like this is not happening. Could you try to do the following:
    - set ZEPHYR_BASE to <path_to_ncs_root>/zephyr
    - Add <path_to_ncs_root>/zephyr/scripts to the PATH environment variable

    Best regards,
    Carl Richard

  • Hi, Zeedel!

    You are using the Toolchain Manager which correctly is flawed too, but the problems are not directly related to what sshenoy105 is experiencing since he/she is doing a manual installation. With that said, I'm glad you made SES work and I can confirm that starting from the command line works here as well. However, I do not believe there is a problem with the bundled ninja as it works consistently here.

    The bug with the Toolchain Manager should be permanently fixed by calling the following command: 

    cmake -P /opt/nordic/ncs/{ncs_version}/toolchain/cmake/NcsToolchainConfig.cmake
    


    Which finishes the configuration of the NCS environment.

    Best regards,
    Carl Richard

  • Hi Carl,

    Thanks for getting back to me.. apologies sshenoy105 for the mixup. I thought we were experiencing the same issue.

    Carl, I tried running the command you suggested, but had not luck:

    xxx-iMac:ncs xxx$ /opt/nordic/ncs/v1.4.0/toolchain/ncsmgr/ncsmgr_init-ncs.sh 
    log: unrecognized option `-n'
    log help: unknown command
    /opt/nordic/ncs/v1.4.0/toolchain/ncsmgr/ncsmgr_init-ncs.sh: line 16: pass: command not found
    log: Unknown subcommand 'Updating repos ...'
    usage:
        log <command>
    
    global options:
        -?, --help
        -q, --quiet
        -v, --verbose
    
    commands:
        collect         gather system logs into a log archive
        config          view/change logging system settings
        erase           delete system logging data
        show            view/search system logs
        stream          watch live system logs
        stats           show system logging statistics
    
    further help:
        log help <command>
        log help predicates
    FATAL ERROR: no west workspace found from "/"; "west update" requires one.
    Things to try:
      - Change directory to somewhere inside a west workspace and retry.
      - Set ZEPHYR_BASE to a zephyr repository path in a west workspace.
      - Run "west init" to set up a workspace here.
      - Run "west init -h" for additional information.
    
    /opt/nordic/ncs/v1.4.0/toolchain/ncsmgr/ncsmgr_init-ncs.sh: line 20: pass: command not found
    usage: west [-h] [-z ZEPHYR_BASE] [-v] [-V] <command> ...
    west: error: argument <command>: invalid choice: 'zephyr-export' (choose from 'init', 'update', 'list', 'manifest', 'diff', 'status', 'forall', 'help', 'config', 'topdir', 'selfupdate')
    CMake Error: Error processing file: toolchain/cmake/NcsToolchainConfig.cmake

    What directory should I run the command from, and are there any preceding steps I may be missing?

    Ta.

  • Hi Ta.

    I gave you the wrong command and I've edited my original answer to reflect the correct solution. This is the correct command:

    cmake -P /opt/nordic/ncs/{version}/toolchain/cmake/NcsToolchainConfig.cmake
    


    If you have any further inquires, please open a new ticket and an engineer will assist you.

    Best regards,
    Carl Richard

Reply Children
Related