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

Running central_hids on nRF52833DK.

Hi,

I have been looking into connecting two development boards over BT. 

Previously, I managed to connect an nRF52833DK to an nRF9160DK.

https://devzone.nordicsemi.com/f/nordic-q-a/63976/connecting-the-nrf9160dk-to-the-nrf52833-over-bluetooth

Since then, I have started to simplify the system, and have replaced the nRF52833DK with an nRF52840DK dongle.

This works great, although the range is limited.

I have tried to replace the nRF9160DK with the nRF52833DK, this effectively means running the central_hids on the nRF52833DK.

I am seeing the following error.

uart:~$ ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:370
        k_sem_take failed with err -11
E: r0/a1:  0x00000003  r1/a2:  0x0000000a  r2/a3:  0x00000001
E: r3/a4:  0x00030d36 r12/ip:  0x2000192c r14/lr:  0x0000c439
E:  xpsr:  0x61000000
E: Faulting instruction address (r15/pc): 0x0000c444
E: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
E: Current thread: 0x20002c9c (unknown)
E: Resetting system
*** Booting Zephyr OS build v2.3.0-rc1-ncs1  ***
Starting Bluetooth Central HIDS example
I: 6 Sectors of 4096 bytes
I: alloc wra: 0, f40
I: data wra: 0, 178

Would appreciate your thoughts

Rod

  • Hello, Rod!
    Could you share the prj.conf you used for the application as well as how you built the sample for the nRF52833?

    The nRF9160DK uses an nRF52840 as a network MCU for BLE, so the process is a bit different when building the application for native BLE devices (like the nRF528433).

    Best regards,
    Carl Richard

  • Hey Carl,

    Here is my prj.conf file

    #
    # Copyright (c) 2019 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
    #
    
    # General config
    CONFIG_ASSERT=y
    CONFIG_TEST_RANDOM_GENERATOR=y
    CONFIG_GPIO=y
    CONFIG_SERIAL=y
    CONFIG_UART_INTERRUPT_DRIVEN=y
    CONFIG_TEST_RANDOM_GENERATOR=y
    CONFIG_NEWLIB_LIBC=y
    CONFIG_CONSOLE_SUBSYS=y
    CONFIG_CONSOLE_GETCHAR=y
    CONFIG_STDOUT_CONSOLE=y
    
    CONFIG_NCS_SAMPLES_DEFAULTS=y
    
    CONFIG_BT=y
    CONFIG_BT_DEBUG_LOG=y
    CONFIG_BT_CENTRAL=y
    CONFIG_BT_SMP=y
    CONFIG_BT_L2CAP_TX_BUF_COUNT=5
    CONFIG_BT_GATT_CLIENT=y
    CONFIG_BT_GATT_DM=y
    CONFIG_HEAP_MEM_POOL_SIZE=2048
    CONFIG_BT_GATT_HIDS_C=y
    CONFIG_BT_H4=y
    CONFIG_BT_WAIT_NOP=y
    CONFIG_MAIN_STACK_SIZE=8192
    
    CONFIG_BT_SCAN=y
    CONFIG_BT_SCAN_FILTER_ENABLE=y
    CONFIG_BT_SCAN_UUID_CNT=1
    CONFIG_BT_PRIVACY=y
    
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    
    CONFIG_BT_SETTINGS=y
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_NVS=y
    CONFIG_SETTINGS=y
    
    CONFIG_DK_LIBRARY=y
    
    CONFIG_CPLUSPLUS=y
    #CONFIG_LOG=y
    CONFIG_SHELL=y
    CONFIG_REBOOT=y
    CONFIG_PRINTK=y
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    
    

    and this is by build process

    rm -R  build
    mkdir build
    cd build
    cmake -GNinja -DBOARD=nrf52833dk_nrf52833 -DCONF_FILE="prj.conf"  ..
    ninja
    cd zephyr
    nrfjprog --program zephyr.hex -f nrf52 --sectorerase -r --verify

    its the standard code, no change. The only changes I made was too the prj.conf file as suggested in my other ticket, detailed above

    Thanks for looking at this

    Rod

  • Hi again, Rod!

    I see. From my tests there is an error in your prj.conf. Could you try the unaltered one for the sample? It should work for the nRF52833DK without any alteration. I've attached it below: 

    #
    # Copyright (c) 2019 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
    #
    CONFIG_NCS_SAMPLES_DEFAULTS=y
    
    CONFIG_BT=y
    CONFIG_BT_DEBUG_LOG=y
    CONFIG_BT_CENTRAL=y
    CONFIG_BT_SMP=y
    CONFIG_BT_L2CAP_TX_BUF_COUNT=5
    CONFIG_BT_GATT_CLIENT=y
    CONFIG_BT_GATT_DM=y
    CONFIG_HEAP_MEM_POOL_SIZE=2048
    CONFIG_BT_GATT_HIDS_C=y
    
    CONFIG_BT_SCAN=y
    CONFIG_BT_SCAN_FILTER_ENABLE=y
    CONFIG_BT_SCAN_UUID_CNT=1
    CONFIG_BT_PRIVACY=y
    
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    
    CONFIG_BT_SETTINGS=y
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_NVS=y
    CONFIG_SETTINGS=y
    
    CONFIG_DK_LIBRARY=y

    Then there will be a matter of finding out which configs that leads to the crash.

    Best regards,
    Carl Richard

  • Hi Carl,

    I have tried this file and get the following error

    19/209] Building C object CMakeFiles/app.dir/src/main.c.obj
    ../src/main.c: In function 'hids_c_notify_cb':
    ../src/main.c:381:12: warning: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
      381 |    temp = (sqrt(temp) + Z1) / Z4;
          |            ^~~~
    [204/209] Linking C executable zephyr/zephyr_prebuilt.elf
    FAILED: zephyr/zephyr_prebuilt.elf 

    so I added the following line 

    CONFIG_NEWLIB_LIBC=y

    and this seems to work!

    *** Booting Zephyr OS build v2.3.0-rc1-ncs1  ***
    Starting Bluetooth Central HIDS example
    I: 6 Sectors of 4096 bytes
    I: alloc wra: 0, f38
    I: data wra: 0, 188
    I: HW Platform: Nordic Semiconductor (0x0002)
    I: HW Variant: nRF52x (0x0002)
    I: Firmware: Standard Bluetooth controller (0x00) Version 2.3 Build 0
    I: No ID address. App must call settings_load()
    Bluetooth initialized
    E: set-value failure. key: bt/ccc/fbf136fdaa521 error(-2)
    I: Identity: f0:67:2e:98:d5:22 (random)
    I: HCI: version 5.2 (0x0b) revision 0x0000, manufacturer 0x05f1
    I: LMP: version 5.2 (0x0b) subver 0xffff
    Scanning successfully started
    

    I will program the dongle transmitter later and confirm connection

    Rod

  • Hi!

    That makes sense. Good that you found a fix! 

    Best regards,
    Carl Richard

Related