bt_enable returns -11 in debug mode

Good morning Nordic support,

I'm a beginner with the nRF Connect SDK and the nRF5340 microcontroller.

I'm using SDK v2.9.0 (the latest available for my Mac).

I started from the peripheral_csc example.

Since I'm using the internal 32kHz oscillator, I added the following settings in the prj.conf file:

CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y

CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y

CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y

I also created an hci_rpmsg.conf file in the child_image folder where I added the three configurations above. I left everything else unchanged as in the example.

Everything works correctly, but I have the following questions:

1) I noticed that I have to create 2 build configurations, one for the app core and another for the network core. Then, I have to compile and upload the firmware separately. Why? I remember that with an older version of the SDK I was able to use only the build configuration of the app core and compile and upload both cores simultaneously. Why can't I do this with version v2.9.0?

2) If I start debugging, the code fails at the bt_enable instruction which returns the error -11. Why does this happen and why only in debug mode? How do I solve it?

Thanks to anyone who can help me.

Kind regards.

  • Hello,

    1. The error message indicates that the network core is not responding. A common reason for this is if the network image is not configured with the same LF clock source as the application core. Please check the generated .config files for each project (ipc_radio and B0n if dfu is enabled) to confirm if the CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC is selected or if it is enabling CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL which is the default if building for the 5340DK board. 

    If it is not selected, you can apply configuration changes to these projects by creating a folder named sysbuild in your project root directory with a Kconfig fragment for each image.   

    <PROJ_DIR>/sysbuild/
    ├── b0n.conf
    └── ipc_radio.conf

    Note: it is neccessary to perform a pristine build after adding the sysbuild folder or new Kconfig fragments in the folder for the build system to detect the change.

    2. It's not possible to single step code when using BLE application, since the BLE controller will not meet the realtime requirements, and hence quickly fault. Instead you need to rely on logging, or restart after setting a breakpoint.

    Kenneht

Related