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

Getting started with nRF5340 - error loading HCI RPMsg project

Just got a nRF5340 DK, testing on macOS 10.15.2. Setup was smooth – the nRF Connect assistant is pretty good. The only feedback would be that an explanation of the "Variables" would be good, especially the ncs_tag, and also the ability to type the GnuArmEmb_path (can't browse to /usr/local with Finder easily).

Once the assistant process is complete, there is no guidance as to which sample projects will work with the nRF5340. I found the documentation on this here. Regarding the Bluetooth: HCI_RPMsg sample it states "This sample must be programmed to the network core to run any Bluetooth Low Energy samples on nRF5340.", so that's the first step then.

Then the first problem. After configuring SES as guided, when opening the hci_rpmsg project I get these errors:

Zephyr version: 2.1.0
nrf5340_dk_nrf5340_cpuapp.dts.pre.tmp:84.42-96.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@50000000/flash-controller@39000: duplicate unit-address (also used in node /soc/peripheral@50000000/kmu@39000)
nrf5340_dk_nrf5340_cpuapp.dts.pre.tmp:301.19-307.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@50000000/clock@5000: duplicate unit-address (also used in node /soc/peripheral@50000000/power@5000)

warning: BT_CTLR_ASSERT_HANDLER (defined at subsys/bluetooth/controller/Kconfig:881) was assigned
the value 'y' but got the value 'n'. You can check symbol information (including dependencies) in
the 'menuconfig' interface (see the Application Development Primer section of the manual), or in the
Kconfig reference at
http://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_BT_CTLR_ASSERT_HANDLER.html (which is
updated regularly from the master branch). See the 'Setting configuration values' section of the
Board Porting Guide as well.
CMake Error at ../../../cmake/extensions.cmake:1413 (message):
  Assertion failed: The toolchain is unable to build a dummy C file.  See
  CMakeError.log.
Call Stack (most recent call first):
  ../../../CMakeLists.txt:42 (assert)

It seems that for some reason, compiler ID testing is failing. From CMakeError.log:

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: /usr/local/bin/arm-none-eabi-gcc 
Build flags: 
Id flags:  

The output was:
1
/usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.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


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

The output was:
1
/usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.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

Searching around it seems the flag `--specs=nosys.specs` can fix this, and compiling the ID file manually with that flag does work. However, I can't seem to get CMake to use that flag, and I'm not sure why this isn't just working out of the box.

Related