Bsim for central_hr example

Hey guys,

for testing purposes on nrf52833 and SDK 2.8.0 I want to use a simulation and stumbled upon bsim.

I followed the instructions there and can build and run the hello world for the hardware and for the simulation.
But the step with the central_hr does not work for me. Building for hardware is ok but not simulation, because if I run:

export BSIM_OUT_PATH=${ZEPHYR_BASE}/../tools/bsim/
export BSIM_COMPONENTS_PATH=${BSIM_OUT_PATH}/components
rm -rf build_sim && west build -b nrf52_bsim -d build_sim


I get

  This combination of SoC and floating point ABI is notsupported by the
  SoftDevice Controller lib.

 
From here I have to use zephyr BLE controller instead of the Softdevice. So in prj.conf I add:

CONFIG_BT_LL_SW_SPLIT=y


and again with

export BSIM_OUT_PATH=${ZEPHYR_BASE}/../tools/bsim/
export BSIM_COMPONENTS_PATH=${BSIM_OUT_PATH}/components
rm -rf build_sim && west build -b nrf52_bsim -d build_sim

I get:

FAILED: zephyr/CMakeFiles/native_runner_executable zephyr/zephyr.exe ~/nordic/central_hr/build_sim/central_hr/zephyr/CMakeFiles/native_runner_executable ~/nordic/central_hr/build_sim/central_hr/zephyr/zephyr.exe
cd ~/nordic/central_hr/build_sim/central_hr/zephyr && /usr/bin/make -f ~/ncs/v2.8.0/zephyr/scripts/native_simulator/Makefile all --warn-undefined-variables -r NSI_CONFIG_FILE=~/nordic/central_hr/build_sim/central_hr/zephyr/NSI/nsi_config
/usr/bin/ld: ~/nordic/central_hr/build_sim/central_hr/zephyr/NSI~/nordic/central_hr/build_sim/central_hr/zephyr/zephyr.elf.loc_cpusw.o:(.data.bt_dev+0x158): undefined reference to `__device_dts_ord_86'
collect2: error: ld returned 1 exit status
make: *** [~/ncs/v2.8.0/zephyr/scripts/native_simulator/Makefile:131: ~/nordic/central_hr/build_sim/central_hr/zephyr/zephyr.exe] Error 1
ninja: build stopped: subcommand failed.

This seems to be related to the device tree, but I am not sure how.

With this video starting at ~20mins I could track it down to

struct bt_dev bt_dev = {
 .init = { .handler = (init_work), },
 .hci = (&__device_dts_ord_86),
};

in

build_sim/central_hr/zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/hci_core.c.i

Related