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

hci_usb does not compile with Nordic's proprietary controller

I'm trying to compile hci_usb sample of Zephyr with Nordic Connect SDK v1.3.0 using Nordic's proprietary controller but apparently it fails.

I'm using following configuration:

diff --git a/samples/bluetooth/hci_usb/prj.conf b/samples/bluetooth/hci_usb/prj.conf
index 9a86ef3596..d977bc4ec0 100644
--- a/samples/bluetooth/hci_usb/prj.conf
+++ b/samples/bluetooth/hci_usb/prj.conf
@@ -10,3 +10,5 @@ CONFIG_USB=y
 CONFIG_USB_DEVICE_STACK=y
 CONFIG_USB_DEVICE_BLUETOOTH=y
 CONFIG_USB_DEVICE_BLUETOOTH_VS_H4=y
+CONFIG_BT_LL_NRFXLIB=y
+CONFIG_BT_MAX_CONN=10

And getting following error:

matias@matias-virtual-machine:~/ext-git/ncs/zephyr/samples/bluetooth/hci_usb$ west build -b nrf52840_pca10056
-- west build: generating a build system
Including boilerplate (Zephyr base): /home/matias/ext-git/ncs/zephyr/cmake/app/boilerplate.cmake
-- Application: /home/matias/ext-git/ncs/zephyr/samples/bluetooth/hci_usb
-- Zephyr version: 2.3.0-rc1 (/home/matias/ext-git/ncs/zephyr)
-- Found Python3: /usr/bin/python3.6 (found suitable exact version "3.6.9") found components:  Interpreter
-- Board: nrf52840_pca10056
CMake Warning at /home/matias/ext-git/ncs/zephyr/cmake/app/boilerplate.cmake:210 (message):
  Deprecated BOARD=nrf52840_pca10056 name specified, board automatically
  changed to: nrf52840dk_nrf52840.
Call Stack (most recent call first):
  /home/matias/ext-git/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  /home/matias/ext-git/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
  CMakeLists.txt:4 (find_package)
-- Found toolchain: zephyr (/home/matias/zephyr-sdk-0.11.1)
-- Found west: /home/matias/.local/bin/west (found suitable version "0.7.2", minimum required is "0.7.1")
-- Found dtc: /home/matias/zephyr-sdk-0.11.1/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (/home/matias/gnuarmemb)
-- Found BOARD.dts: /home/matias/ext-git/ncs/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
-- Generated zephyr.dts: /home/matias/ext-git/ncs/zephyr/samples/bluetooth/hci_usb/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /home/matias/ext-git/ncs/zephyr/samples/bluetooth/hci_usb/build/zephyr/include/generated/devicetree_unfixed.h
Parsing /home/matias/ext-git/ncs/zephyr/samples/bluetooth/hci_usb/Kconfig
Loaded configuration '/home/matias/ext-git/ncs/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig'
Merged configuration '/home/matias/ext-git/ncs/zephyr/samples/bluetooth/hci_usb/prj.conf'
Configuration saved to '/home/matias/ext-git/ncs/zephyr/samples/bluetooth/hci_usb/build/zephyr/.config'
Kconfig header saved to '/home/matias/ext-git/ncs/zephyr/samples/bluetooth/hci_usb/build/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: /home/matias/gnuarmemb/bin/arm-none-eabi-gcc
-- Cache files will be written to: /home/matias/.cache/zephyr
CMake Warning at ../../../subsys/usb/CMakeLists.txt:28 (message):
  CONFIG_USB_DEVICE_VID has default value 0x2FE3.
  This value is only for testing and MUST be configured for USB products.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/matias/ext-git/ncs/zephyr/samples/bluetooth/hci_usb/build
-- west build: building application
[1/171] Preparing syscall dependency handling
[166/171] Linking C executable zephyr/zephyr_prebuilt.elf
FAILED: zephyr/zephyr_prebuilt.elf
: && ccache /home/matias/gnuarmemb/bin/arm-none-eabi-gcc    zephyr/CMakeFiles/zephyr_prebuilt.dir/misc/empty_file.c.obj  -o zephyr/zephyr_prebuilt.elf  -Wl,-T zephyr/linker.cmd -Wl,-Map=/home/matias/ext-git/ncs/zephyr/samples/bluetooth/hci_usb/build/zephyr/zephyr_prebuilt.map -Wl,--whole-archive app/libapp.a zephyr/libzephyr.a zephyr/arch/common/libarch__common.a zephyr/arch/arch/arm/core/aarch32/libarch__arm__core__aarch32.a zephyr/arch/arch/arm/core/aarch32/cortex_m/libarch__arm__core__aarch32__cortex_m.a zephyr/arch/arch/arm/core/aarch32/cortex_m/mpu/libarch__arm__core__aarch32__cortex_m__mpu.a zephyr/lib/libc/minimal/liblib__libc__minimal.a zephyr/lib/posix/liblib__posix.a zephyr/soc/arm/common/cortex_m/libsoc__arm__common__cortex_m.a zephyr/soc/arm/nordic_nrf/nrf52/libsoc__arm__nordic_nrf__nrf52.a zephyr/subsys/bluetooth/common/libsubsys__bluetooth__common.a zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a zephyr/subsys/net/libsubsys__net.a zephyr/subsys/random/libsubsys__random.a zephyr/drivers/gpio/libdrivers__gpio.a zephyr/drivers/serial/libdrivers__serial.a zephyr/drivers/entropy/libdrivers__entropy.a modules/nrf/lib/multithreading_lock/lib..__nrf__lib__multithreading_lock.a modules/nrf/lib/fatal_error/lib..__nrf__lib__fatal_error.a modules/nrf/subsys/bluetooth/controller/lib..__nrf__subsys__bluetooth__controller.a modules/nrf/subsys/mpsl/lib..__nrf__subsys__mpsl.a modules/nrf/drivers/mpsl/clock_control/lib..__nrf__drivers__mpsl__clock_control.a modules/nrf/drivers/hw_cc310/lib..__nrf__drivers__hw_cc310.a modules/nordic/lib..__modules__hal__nordic.a -Wl,--no-whole-archive zephyr/kernel/libkernel.a zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj -L"/home/matias/gnuarmemb/bin/../lib/gcc/arm-none-eabi/8.3.1/thumb/v7e-m/nofp" -L/home/matias/ext-git/ncs/zephyr/samples/bluetooth/hci_usb/build/zephyr -lgcc -Wl,--print-memory-usage /home/matias/ext-git/ncs/nrfxlib/crypto/nrf_cc310_platform/lib/cortex-m4/soft-float/no-interrupts/libnrf_cc310_platform_0.9.2.a -mcpu=cortex-m4 -mthumb -mabi=aapcs -Wl,--gc-sections -Wl,--build-id=none -Wl,--sort-common=descending -Wl,--sort-section=alignment -Wl,-u,_OffsetAbsSyms -Wl,-u,_ConfigAbsSyms -nostdlib -static -no-pie -Wl,-X -Wl,-N -Wl,--orphan-handling=warn /home/matias/ext-git/ncs/nrfxlib/ble_controller/lib/cortex-m4/soft-float/libble_controller_s140.a /home/matias/ext-git/ncs/nrfxlib/mpsl/lib/cortex-m4/soft-float/libmpsl.a && :
Memory region         Used Size  Region Size  %age Used
           FLASH:      154480 B         1 MB     14.73%
            SRAM:       38420 B       256 KB     14.66%
        IDT_LIST:         184 B         2 KB      8.98/home/matias/gnuarmemb/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: zephyr/libzephyr.a(bluetooth.c.obj): in function `vs_read_usb_transport_mode':
/home/matias/ext-git/ncs/zephyr/subsys/usb/class/bluetooth.c:248: undefined reference to `bt_hci_cmd_complete_create'
/home/matias/gnuarmemb/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a(hci_raw.c.obj): in function `bt_cmd_complete_ext':
/home/matias/ext-git/ncs/zephyr/subsys/bluetooth/host/hci_raw.c:200: undefined reference to `bt_hci_cmd_complete_create'
collect2: error: ld returned 1 exit status
%
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /home/matias/cmake-3.15.2-Linux-x86_64/bin/cmake --build /home/matias/ext-git/ncs/zephyr/samples/bluetooth/hci_usb/build

I have also tried to disable `CONFIG_USB_DEVICE_BLUETOOTH_VS_H4` which fixes the compile error but hciconfig does not show the controller and dmesg shows some error:

[141643.198977] usb 2-2.2: new full-speed USB device number 18 using uhci_hcd
[141643.320560] usb 2-2.2: New USB device found, idVendor=2fe3, idProduct=000b
[141643.320562] usb 2-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[141643.320563] usb 2-2.2: Product: USB-DEV
[141643.320563] usb 2-2.2: Manufacturer: ZEPHYR
[141643.320564] usb 2-2.2: SerialNumber: E19DCC07F1EC020A
[141643.629056] usb 2-2.2: can't set config #1, error -32

hci_uart sample seems to be working fine.

Parents Reply Children
Related