Multiprotocol Service Layer (MPSL) - BLE coexistence with proprietary communication stack

Background

In our company, we have developed a prioprietary synchronized communication stack that we would like to run on nRF52 devices simultaneously with BLE. To date, our solution works without BLE flawlessly on nRF52832 and nRF52833 devices using the nRF SDK (using low-level HAL functions).

We would like to go a little further and have our communication stack running simultaneously with BLE using the Zephyr ecosystem. I have done some research and as far as I know, MPSL should be used for this purpose. My main and only source of information is the documentation published on your website: developer.nordicsemi.com/.../README.html

I did some experiments with MPSL. I ran the LBS example with Zephyr and added some code to test the MPSL API. Everything seems to work as intended.

Questions

(1) A convenient handler for handling radio procedures initialized by mpsl_radio_notification_cfg_set is provided. What is the right solution to distinguish which component is using the radio?
If BLE is active, its activity is handled within the same radio notification. At this time, I request a timeslot, resulting in mixed radio activity from BLE and my application. Given that the application's time allocation can be delayed, blocked or canceled, any external solution seems difficult to implement.

(2) How do I integrate my own wireless PHY with BLE? Can I reconfigure all radio registers and use RADIO_IRQ interrupt in the active MPSL slot?
nrfx has no KConfig option to enable the radio controller. It appears that there is no low-level driver available. However, the nrf_radio.h header with low-level functions is available and is quite similar to the radio functions from the previous nRF SDK.

  • Hi,

    1. You can only use the radio in a timeslot, and MPSL will only grant you timesltos when the radio is not used by BLE. So as long as you only use it within a timeslot (and this is a strict requierment), you do have full freedom.

    2. You have full control over the readio including interrupts when in a timeslot. You can use the radio driver and HAL. For using the timeslot API itself you can refer to the MPSL timeslot exxample. And for an example of a simple radio protocol you can refer to the ESB samples (many simple propritary protocols are based on ESB).

  • Thank you for your reply. I checked the ESB source files and used a similar interrupt handling method.

    Experiment
    I have done some further experiments. I got our radio driver running with MPSL. The important thing was to enable dynamic interrupts in KConfig:
    - CONFIG_DYNAMIC_INTERRUPTS=y
    - CONFIG_DYNAMIC_DIRECT_INTERRUPTS=y
    - CONFIG_MPSL_DYNAMIC_INTERRUPTS=y

    The interrupt connection routine (called only once during first initialization):

    irq_disable(RADIO_IRQn);
    irq_connect_dynamic(RADIO_IRQn, 1, radio_isr, NULL, 0);
    irq_enable(RADIO_IRQn);

    Even with the BLE Peripheral and advertising enabled, I was able to send packets correctly. However BLE stack cannot connect to peer. I tried to narrow down the problem:

    (1) BLE works correctly when our driver initializes and deinitializes during MPSL without setting IRQs.
    (2) BLE works correctly when our driver initializes, sends a frame without using IRQ, and deinitializes during the MPSL time slot.
    (3) BLE advertises itself but cannot connect to the peer when the ISR is connected via irq_connect_dynamic. This happens even when the interrupt handler routine is empty and the radio has no interrupt enabled. No assertion, no error on the Peripheral side. Central prints: "reason: BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED" (I use nRF Connect for desktop Bluetooth Low Energy Standalone with PCA10040 DK).

    It should also be noted that in the latest version of nRF Connect, which comes with Zephyr 3.4.99 there is no 

    irq_disconnect_dynamic()
     function. It has been available since version 3.5.0.

    Questions

    (1) What to do next? What else can I do to make it work?

    (2) Is my RADIO0 IRQ priority selection independent of the BLE stack (I tried with priority 0,1,2)?

  • Hi,

    matkub said:
    (1) What to do next? What else can I do to make it work?

    It seems you got most things working. As you get BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED that means that packets are not exchanged after the connection was established after the connection indication was sent from the central). You cannot say much more when observing from the central if the issue is on the peripheral side. Can you try to add a bit logging and see if that tells us anything? Of instance with this in your prj.con:

    CONFIG_BT_LOG_LEVEL_DBG=y
    CONFIG_BT_DEBUG_SMP=y
    CONFIG_BT_DEBUG_LOG=y
    CONFIG_BT_DEBUG_CONN=y

     

    matkub said:
    (2) Is my RADIO0 IRQ priority selection independent of the BLE stack (I tried with priority 0,1,2)?

    I do not immediately see a problem with using a different priority in a timeslot, but  in case there is an issue I am not aware of you could make sure you use priority 0 for the radio for now.

  • Than you for your help.

    I provide you 3 files with logs from the device:

    #1: Custom radio driver initializes, transmits, deinitializes in every timeslot (st - start/stop of frame), BLE not connecting to peer. When central tries to connect no log appears.

    stststststststD: Registered SoftDevice Controller
    D: BT mempool size: 2010, required: 1648
    
    
    Starting Bluetooth Peripheral LBS example
    D: 
    D: Started
    D: 
    D: Calling k_poll with 2 events
    D: Open
    I: SoftDevice Controller build revision: 
    I: c5 93 ba a9 14 4d 8d 05 |.....M..
    I: 30 4e 9b 92 d7 71 1e e8 |0N...q..
    I: aa 02 50 3c             |..P<    
    D: opcode 0x0c03 params_lten 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x0c03 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x0c03 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x0c03) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x0c03
    D: opcode 0x0c03 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x0c03 len 1
    D: status 0x00
    D: opcode 0x1003 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x1003 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x1003 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x1003) status: 0x00, ncmd: 1, len 12
    D: buf 0x20005a30 len 14
    D: opcode 0x1003
    D: opcode 0x1003 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x1003 len 9
    D: status 0x00
    D: opcode 0x1001 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x1001 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x1001 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x1001) status: 0x00, ncmd: 1, len 12
    D: buf 0x20005a30 len 14
    D: opcode 0x1001
    D: opcode 0x1001 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x1001 len 9
    D: status 0x00
    D: opcode 0x1002 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x1002 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x1002 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x1002) status: 0x00, ncmd: 1, len 68
    D: buf 0x20005a30 len 70
    D: opcode 0x1002
    D: opcode 0x1002 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x1002 len 65
    D: status 0x00
    D: opcode 0x2003 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2003 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2003 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x2003) status: 0x00, ncmd: 1, len 12
    D: buf 0x20005a30 len 14
    D: opcode 0x2003
    D: opcode 0x2003 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2003 len 9
    D: status 0x00
    D: opcode 0x2002 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2002 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2002 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x2002) status: 0x00, ncmd: 1, len 7
    D: buf 0x20005a30 len 9
    D: opcode 0x2002
    D: opcode 0x2002 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2002 len 4
    D: status 0x00
    D: ACL LE buffers: pkts 3 mtu 27
    D: opcode 0x201c param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x201c len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x201c (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x201c) status: 0x00, ncmd: 1, len 12
    D: buf 0x20005a30 len 14
    D: opcode 0x201c
    D: opcode 0x201c status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x201c len 9
    D: status 0x00
    D: opcode 0x2001 param_len 8
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2001 len 11
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2001 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 11 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x2001) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x2001
    D: opcode 0x2001 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2001 len 1
    D: opcode 0x0c01 param_len 8
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x0c01 len 11
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x0c01 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 11 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x0c01) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x0c01
    D: opcode 0x0c01 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x0c01 len 1
    D: LE SC enabled
    D: opcode 0x2025 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2025 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2025 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Status (0x2025) status: 0x00
    D: buf 0x20005a30 len 6
    D: opcode 0x2025
    D: opcode 0x2025 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2025 len 0
    I: No ID address. App must call settings_load()
    Bluetooth initialized
    D: 
    D: opcode 0x1009 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x1009 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x1009 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x1009) status: 0x00, ncmd: 1, len 10
    D: buf 0x20005a30 len 12
    D: opcode 0x1009
    D: opcode 0x1009 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x1009 len 7
    D: Controller has no public address
    I: Identity: D5:87:D9:B4:9A:75 (random)
    I: HCI: version 5.4 (0x0d) revision 0x1102, manufacturer 0x0059
    I: LMP: version 5.4 (0x0d) subver 0x1102
    D: D5:87:D9:B4:9A:75
    D: opcode 0x2005 param_len 6
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2005 len 9
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2005 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 9 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x2005) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x2005
    D: opcode 0x2005 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2005 len 1
    D: opcode 0x2006 param_len 15
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2006 len 18
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2006 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 18 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x2006) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x2006
    D: opcode 0x2006 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2006 len 1
    D: opcode 0x2008 param_len 32
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2008 len 35
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2008 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 35 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x2008) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x2008
    D: opcode 0x2008 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2008 len 1
    D: opcode 0x2009 param_len 32
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2009 len 35
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2009 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 35 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x2009) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x2009
    D: opcode 0x2009 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2009 len 1
    D: disconnected -> connecting-adv
    D: handle 0 ref 1 -> 2
    D: opcode 0x200a param_len 1
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x200a len 4
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x200a (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 4 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x200a) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x200a
    D: opcode 0x200a status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x200a len 1
    D: handle 0 ref 2 -> 1
    Advertising successfully started
    D: buf 0x2000586c len 68
    D: Getting net_buf from queue
    D: buf 0x2000586c type 1 len 68
    D: event 0x3e
    D: subevent 0x08
    D: status: 0x00
    D: 
    ststststststststststststststst

    #2: Custom radio driver initializes and deinitializes only in every timeslot (isr registerred), BLE not connecting to peer. When central tries to connect no log appears.

    ststststD: Registered SoftDevice Controller
    D: BT mempool size: 2010, required: 1648
    
    
    Starting Bluetooth Peripheral LBS example
    D: 
    D: Started
    D: 
    D: Calling k_poll with 2 events
    D: Open
    I: SoftDevice Controller build revision: 
    I: c5 93 ba a9 14 4d 8d 05 |.....M..
    I: 30 4e 9b 92 d7 71 1e e8 |0N...q..
    I: aa 02 50 3c             |..P<    
    D: opcode 0x0c03 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x0c03 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x0c03 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x0c03) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x0c03
    D: opcode 0x0c03 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x0c03 len 1
    D: status 0x00
    D: opcode 0x1003 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x1003 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x1003 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x1003) status: 0x00, ncmd: 1, len 12
    D: buf 0x20005a30 len 14
    D: opcode 0x1003
    D: opcode 0x1003 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x1003 len 9
    D: status 0x00
    D: opcode 0x1001 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x1001 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x1001 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x1001) status: 0x00, ncmd: 1, len 12
    D: buf 0x20005a30 len 14
    D: opcode 0x1001
    D: opcode 0x1001 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x1001 len 9
    D: status 0x00
    D: opcode 0x1002 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x1002 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x1002 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x1002) status: 0x00, ncmd: 1, len 68
    D: buf 0x20005a30 len 70
    D: opcode 0x1002
    D: opcode 0x1002 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x1002 len 65
    D: status 0x00
    D: opcode 0x2003 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2003 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2003 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x2003) status: 0x00, ncmd: 1, len 12
    D: buf 0x20005a30 len 14
    D: opcode 0x2003
    D: opcode 0x2003 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2003 len 9
    D: status 0x00
    D: opcode 0x2002 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2002 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2002 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x2002) status: 0x00, ncmd: 1, len 7
    D: buf 0x20005a30 len 9
    D: opcode 0x2002
    D: opcode 0x2002 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2002 len 4
    D: status 0x00
    D: ACL LE buffers: pkts 3 mtu 27
    D: opcode 0x201c param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x201c len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x201c (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x201c) status: 0x00, ncmd: 1, len 12
    D: buf 0x20005a30 len 14
    D: opcode 0x201c
    D: opcode 0x201c status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x201c len 9
    D: status 0x00
    D: opcode 0x2001 param_len 8
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2001 len 11
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2001 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 11 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x2001) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x2001
    D: opcode 0x2001 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2001 len 1
    D: opcode 0x0c01 param_len 8
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x0c01 len 11
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x0c01 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 11 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x0c01) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x0c01
    D: opcode 0x0c01 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x0c01 len 1
    D: LE SC enabled
    D: opcode 0x2025 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2025 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2025 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Status (0x2025) status: 0x00
    D: buf 0x20005a30 len 6
    D: opcode 0x2025
    D: opcode 0x2025 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2025 len 0
    I: No ID address. App must call settings_load()
    Bluetooth initialized
    D: 
    D: opcode 0x1009 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x1009 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x1009 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x1009) status: 0x00, ncmd: 1, len 10
    D: buf 0x20005a30 len 12
    D: opcode 0x1009
    D: opcode 0x1009 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x1009 len 7
    D: Controller has no public address
    I: Identity: D5:87:D9:B4:9A:75 (random)
    I: HCI: version 5.4 (0x0d) revision 0x1102, manufacturer 0x0059
    I: LMP: version 5.4 (0x0d) subver 0x1102
    D: D5:87:D9:B4:9A:75
    D: opcode 0x2005 param_len 6
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2005 len 9
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2005 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 9 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x2005) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x2005
    D: opcode 0x2005 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2005 len 1
    D: opcode 0x2006 param_len 15
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2006 len 18
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2006 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 18 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x2006) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x2006
    D: opcode 0x2006 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2006 len 1
    D: opcode 0x2008 param_len 32
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2008 len 35
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2008 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 35 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x2008) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x2008
    D: opcode 0x2008 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2008 len 1
    D: opcode 0x2009 param_len 32
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2009 len 35
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2009 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 35 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x2009) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x2009
    D: opcode 0x2009 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2009 len 1
    D: disconnected -> connecting-adv
    D: handle 0 ref 1 -> 2
    D: opcode 0x200a param_len 1
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x200a len 4
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x200a (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 4 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x200a) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x200a
    D: opcode 0x200a status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x200a len 1
    D: handle 0 ref 2 -> 1
    Advertising successfully started
    D: buf 0x2000586c len 68
    D: Getting net_buf from queue
    D: buf 0x2000586c type 1 len 68
    D: event 0x3e
    D: subevent 0x08
    D: status: 0x00
    D: 

    #3 Custom radio driver initializes and deinitializes only in every timeslot (no isr registration), BLE properly connects to peer. When Central tries to connect adequate log appears.

    D: Registered SoftDevice Controller
    D: BT mempool size: 2010, required: 1648
    
    
    Starting Bluetooth Peripheral LBS example
    D: 
    D: Started
    D: 
    D: Calling k_poll with 2 events
    D: Open
    I: SoftDevice Controller build revision: 
    I: c5 93 ba a9 14 4d 8d 05 |.....M..
    I: 30 4e 9b 92 d7 71 1e e8 |0N...q..
    I: aa 02 50 3c             |..P<    
    D: opcode 0x0c03 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x0c03 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x0c03 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x0c03) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x0c03
    D: opcode 0x0c03 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x0c03 len 1
    D: status 0x00
    D: opcode 0x1003 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x1003 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x1003 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x1003) status: 0x00, ncmd: 1, len 12
    D: buf 0x20005a30 len 14
    D: opcode 0x1003
    D: opcode 0x1003 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x1003 len 9
    D: status 0x00
    D: opcode 0x1001 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x1001 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x1001 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x1001) status: 0x00, ncmd: 1, len 12
    D: buf 0x20005a30 len 14
    D: opcode 0x1001
    D: opcode 0x1001 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x1001 len 9
    D: status 0x00
    D: opcode 0x1002 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x1002 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x1002 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x1002) status: 0x00, ncmd: 1, len 68
    D: buf 0x20005a30 len 70
    D: opcode 0x1002
    D: opcode 0x1002 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x1002 len 65
    D: status 0x00
    D: opcode 0x2003 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2003 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2003 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x2003) status: 0x00, ncmd: 1, len 12
    D: buf 0x20005a30 len 14
    D: opcode 0x2003
    D: opcode 0x2003 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2003 len 9
    D: status 0x00
    D: opcode 0x2002 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2002 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2002 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x2002) status: 0x00, ncmd: 1, len 7
    D: buf 0x20005a30 len 9
    D: opcode 0x2002
    D: opcode 0x2002 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2002 len 4
    D: status 0x00
    D: ACL LE buffers: pkts 3 mtu 27
    D: opcode 0x201c param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x201c len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x201c (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x201c) status: 0x00, ncmd: 1, len 12
    D: buf 0x20005a30 len 14
    D: opcode 0x201c
    D: opcode 0x201c status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x201c len 9
    D: status 0x00
    D: opcode 0x2001 param_len 8
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2001 len 11
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2001 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 11 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x2001) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x2001
    D: opcode 0x2001 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2001 len 1
    D: opcode 0x0c01 param_len 8
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x0c01 len 11
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x0c01 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 11 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x0c01) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x0c01
    D: opcode 0x0c01 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x0c01 len 1
    D: LE SC enabled
    D: opcode 0x2025 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2025 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2025 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Status (0x2025) status: 0x00
    D: buf 0x20005a30 len 6
    D: opcode 0x2025
    D: opcode 0x2025 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2025 len 0
    I: No ID address. App must call settings_load()
    Bluetooth initialized
    D: 
    D: opcode 0x1009 param_len 0
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x1009 len 3
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x1009 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 3 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x1009) status: 0x00, ncmd: 1, len 10
    D: buf 0x20005a30 len 12
    D: opcode 0x1009
    D: opcode 0x1009 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x1009 len 7
    D: Controller has no public address
    I: Identity: D5:87:D9:B4:9A:75 (random)
    I: HCI: version 5.4 (0x0d) revision 0x1102, manufacturer 0x0059
    I: LMP: version 5.4 (0x0d) subver 0x1102
    D: D5:87:D9:B4:9A:75
    D: opcode 0x2005 param_len 6
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2005 len 9
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2005 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 9 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x2005) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x2005
    D: opcode 0x2005 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2005 len 1
    D: opcode 0x2006 param_len 15
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2006 len 18
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2006 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 18 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x2006) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x2006
    D: opcode 0x2006 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2006 len 1
    D: opcode 0x2008 param_len 32
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2008 len 35
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2008 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 35 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x2008) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x2008
    D: opcode 0x2008 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2008 len 1
    D: opcode 0x2009 param_len 32
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2009 len 35
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2009 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 35 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x2009) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x2009
    D: opcode 0x2009 status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x2009 len 1
    D: disconnected -> connecting-adv
    D: handle 0 ref 1 -> 2
    D: opcode 0x200a param_len 1
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x200a len 4
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x200a (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 4 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x200a) status: 0x00, ncmd: 1, len 4
    D: buf 0x20005a30 len 6
    D: opcode 0x200a
    D: opcode 0x200a status 0x00 buf 0x20005a30
    D: 
    D: Calling k_poll with 2 events
    D: rsp 0x20005a30 opcode 0x200a len 1
    D: handle 0 ref 2 -> 1
    Advertising successfully started
    D: buf 0x2000586c len 68
    D: Getting net_buf from queue
    D: buf 0x2000586c type 1 len 68
    D: event 0x3e
    D: subevent 0x08
    D: status: 0x00
    D: 
    D: LE Meta Event (0x01), len (19)
    D: buf 0x2000586c len 21
    D: Getting net_buf from queue
    D: buf 0x2000586c type 1 len 21
    D: event 0x3e
    D: subevent 0x01
    D: status 0x00 role 1 DD:07:29:9B:F9:4B (random)
    D: status 0x00 handle 0 role 1 peer DD:07:29:9B:F9:4B (random) peer RPA 00:00:00:00:00:00
    D: local RPA 00:00:00:00:00:00
    D: DD:07:29:9B:F9:4B (random)
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: Host cannot resume connectable advertising (-12)
    D: connecting-adv -> connected
    D: conn 0x20001948 handle 0
    D: conn 0x20001948 chan 0x200028b0
    D: ch 0x200028b0 cid 0x0005
    D: conn 0x20001948 handle 0
    D: conn 0x20001948 chan 0x20001b44
    D: chan 0x20001b44 cid 0x0006
    D: conn 0x20001948 handle 0
    D: att 0x20005bc4 chan 0x20005600 flags 0
    D: conn 0x20001948 chan 0x20005604
    D: chan 0x20005604 cid 0x0004
    D: conn 0x20001948
    D: DD:07:29:9B:F9:4B (random)
    D: chan 0x20005604 status 0x20005614
    Connected
    D: opcode 0x2016 param_len 2
    D: buf 0x20005a30
    D: buf 0x20005a30 opcode 0x2016 len 5
    D: Data: handle (0x00), PB(2), BC(0), len(11)
    D: buf 0x2000588c len 15
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2016 (buf 0x20005a30) to driver
    D: buf 0x20005a30 len 5 type 0
    D: 
    D: 
    D: Exit: 0
    D: ev->state 1
    D: Command Status (0x2016) status: 0x00
    D: buf 0x20005a30 len 6
    D: opcode 0x2016
    D: opcode 0x2016 status 0x00 buf 0x20005a30
    D: 
    D: Adding conn 0x20001948 to poll list
    D: wait on host fifo
    D: Calling k_poll with 3 events
    D: LE Meta Event (0x04), len (12)
    D: buf 0x200058ac len 14
    D: rsp 0x20005a30 opcode 0x2016 len 0
    D: handle 0 ref 2 -> 1
    D: Getting net_buf from queue
    D: buf 0x2000588c type 3 len 15
    D: buf 0x2000588c
    D: handle 0 len 11 flags 2
    D: handle 0 ref 1 -> 2
    D: conn 0x20001948
    D: handle 0 len 11 flags 02
    D: First, len 11 final 7
    D: Successfully parsed 11 byte L2CAP packet
    D: Packet for CID 4 len 7
    D: chan 0x20005604 len 7
    D: Received ATT chan 0x20005600 code 0x10 len 6
    D: start_handle 0x0001 end_handle 0xffff type 2800
    D: re-using REQ buf 0x2000588c for RSP
    D: handle 0x0001
    D: handle 0x0000 offset 0 length 2
    D: handle 0x0002
    D: handle 0x0000 offset 0 length 2
    D: handle 0x0007
    D: handle 0x0000 offset 0 length 5
    D: code 0x11
    D: conn 0x20001948 cid 4 len 14
    D: conn handle 0 buf len 18 cb 0x176fd user_data 0x2000565c
    D: handle 0 ref 2 -> 1
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001948
    D: conn 0x20001948 buf 0x2000588c len 18
    D: send single
    D: conn 0x20001948 buf 0x2000588c len 18 flags 0x02
    D: buf 0x2000588c len 22 type 2
    D: 
    D: 
    D: Exit: 0
    D: 
    D: Adding conn 0x20001948 to poll list
    D: wait on host fifo
    D: Calling k_poll with 3 events
    D: Getting net_buf from queue
    D: buf 0x200058ac type 1 len 14
    D: event 0x3e
    D: subevent 0x04
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: Event (0x13) len 5
    D: buf 0x20005984 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: Data: handle (0x00), PB(2), BC(0), len(11)
    D: buf 0x200058ac len 15
    D: Getting net_buf from queue
    D: buf 0x200058ac type 3 len 15
    D: buf 0x200058ac
    D: handle 0 len 11 flags 2
    D: handle 0 ref 1 -> 2
    D: conn 0x20001948
    D: tx 0x20002880 cb 0x176fd user_data 0x2000565c
    D: conn 0x20001948 chan 0x20005604
    D: chan 0x20005600
    D: chan 0x20005600
    D: handle 0 len 11 flags 02
    D: First, len 11 final 7
    D: Successfully parsed 11 byte L2CAP packet
    D: Packet for CID 4 len 7
    D: chan 0x20005604 len 7
    D: Received ATT chan 0x20005600 code 0x10 len 6
    D: start_handle 0x0007 end_handle 0xffff type 2800
    D: re-using REQ buf 0x200058ac for RSP
    D: handle 0x0007
    D: handle 0x0000 offset 0 length 16
    D: code 0x11
    D: conn 0x20001948 cid 4 len 22
    D: conn handle 0 buf len 26 cb 0x176fd user_data 0x2000565c
    D: handle 0 ref 2 -> 1
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001948
    D: conn 0x20001948 buf 0x200058ac len 26
    D: send single
    D: conn 0x20001948 buf 0x200058ac len 26 flags 0x02
    D: buf 0x200058ac len 30 type 2
    D: 
    D: 
    D: Exit: 0
    D: 
    D: Adding conn 0x20001948 to poll list
    D: wait on host fifo
    D: Calling k_poll with 3 events
    D: conn 0x20001948
    D: conn 0x20001948
    D: Event (0x13) len 5
    D: buf 0x20005984 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: Data: handle (0x00), PB(2), BC(0), len(11)
    D: buf 0x200058ac len 15
    D: Getting net_buf from queue
    D: buf 0x200058ac type 3 len 15
    D: buf 0x200058ac
    D: handle 0 len 11 flags 2
    D: handle 0 ref 1 -> 2
    D: conn 0x20001948
    D: tx 0x20002890 cb 0x176fd user_data 0x2000565c
    D: conn 0x20001948 chan 0x20005604
    D: chan 0x20005600
    D: chan 0x20005600
    D: handle 0 len 11 flags 02
    D: First, len 11 final 7
    D: Successfully parsed 11 byte L2CAP packet
    D: Packet for CID 4 len 7
    D: chan 0x20005604 len 7
    D: Received ATT chan 0x20005600 code 0x10 len 6
    D: start_handle 0x000d end_handle 0xffff type 2800
    D: re-using REQ buf 0x200058ac for RSP
    D: re-using REQ buf 0x200058ac for RSP
    D: code 0x01
    D: conn 0x20001948 cid 4 len 5
    D: conn handle 0 buf len 9 cb 0x176fd user_data 0x2000565c
    D: handle 0 ref 2 -> 1
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001948
    D: conn 0x20001948 buf 0x200058ac len 9
    D: send single
    D: conn 0x20001948 buf 0x200058ac len 9 flags 0x02
    D: buf 0x200058ac len 13 type 2
    D: 
    D: 
    D: Exit: 0
    D: 
    D: Adding conn 0x20001948 to poll list
    D: wait on host fifo
    D: Calling k_poll with 3 events
    D: conn 0x20001948
    D: conn 0x20001948
    D: Event (0x13) len 5
    D: buf 0x20005984 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: Data: handle (0x00), PB(2), BC(0), len(7)
    D: buf 0x200058ac len 11
    D: Getting net_buf from queue
    D: buf 0x200058ac type 3 len 11
    D: buf 0x200058ac
    D: handle 0 len 7 flags 2
    D: handle 0 ref 1 -> 2
    D: conn 0x20001948
    D: tx 0x20002880 cb 0x176fd user_data 0x2000565c
    D: conn 0x20001948 chan 0x20005604
    D: chan 0x20005600
    D: chan 0x20005600
    D: handle 0 len 7 flags 02
    D: First, len 7 final 3
    D: Successfully parsed 7 byte L2CAP packet
    D: Packet for CID 4 len 3
    D: chan 0x20005604 len 3
    D: Received ATT chan 0x20005600 code 0x0a len 2
    D: handle 0x0007
    D: re-using REQ buf 0x200058ac for RSP
    D: handle 0x0007
    D: handle 0x0000 offset 0 length 16
    D: code 0x0b
    D: conn 0x20001948 cid 4 len 17
    D: conn handle 0 buf len 21 cb 0x176fd user_data 0x2000565c
    D: handle 0 ref 2 -> 1
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001948
    D: conn 0x20001948 buf 0x200058ac len 21
    D: send single
    D: conn 0x20001948 buf 0x200058ac len 21 flags 0x02
    D: buf 0x200058ac len 25 type 2
    D: 
    D: 
    D: Exit: 0
    D: 
    D: Adding conn 0x20001948 to poll list
    D: wait on host fifo
    D: Calling k_poll with 3 events
    D: conn 0x20001948
    D: conn 0x20001948
    D: Event (0x13) len 5
    D: buf 0x20005984 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: conn 0x20001948
    D: conn 0x20001948
    D: tx 0x20002890 cb 0x176fd user_data 0x2000565c
    D: conn 0x20001948 chan 0x20005604
    D: chan 0x20005600
    D: chan 0x20005600
    D: Data: handle (0x00), PB(2), BC(0), len(11)
    D: buf 0x200058ac len 15
    D: Getting net_buf from queue
    D: buf 0x200058ac type 3 len 15
    D: buf 0x200058ac
    D: handle 0 len 11 flags 2
    D: handle 0 ref 1 -> 2
    D: conn 0x20001948
    D: handle 0 len 11 flags 02
    D: First, len 11 final 7
    D: Successfully parsed 11 byte L2CAP packet
    D: Packet for CID 4 len 7
    D: chan 0x20005604 len 7
    D: Received ATT chan 0x20005600 code 0x08 len 6
    D: start_handle 0x0002 end_handle 0x0006 type 2803
    D: re-using REQ buf 0x200058ac for RSP
    D: handle 0x0003
    D: handle 0x0000 offset 0 length 5
    D: handle 0x0005
    D: handle 0x0000 offset 0 length 5
    D: code 0x09
    D: conn 0x20001948 cid 4 len 16
    D: conn handle 0 buf len 20 cb 0x176fd user_data 0x2000565c
    D: handle 0 ref 2 -> 1
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001948
    D: conn 0x20001948 buf 0x200058ac len 20
    D: send single
    D: conn 0x20001948 buf 0x200058ac len 20 flags 0x02
    D: buf 0x200058ac len 24 type 2
    D: 
    D: 
    D: Exit: 0
    D: 
    D: Adding conn 0x20001948 to poll list
    D: wait on host fifo
    D: Calling k_poll with 3 events
    D: Event (0x13) len 5
    D: buf 0x20005984 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: Data: handle (0x00), PB(2), BC(0), len(7)
    D: buf 0x200058ac len 11
    D: Getting net_buf from queue
    D: buf 0x200058ac type 3 len 11
    D: buf 0x200058ac
    D: handle 0 len 7 flags 2
    D: handle 0 ref 1 -> 2
    D: conn 0x20001948
    D: tx 0x20002880 cb 0x176fd user_data 0x2000565c
    D: conn 0x20001948 chan 0x20005604
    D: chan 0x20005600
    D: chan 0x20005600
    D: handle 0 len 7 flags 02
    D: First, len 7 final 3
    D: Successfully parsed 7 byte L2CAP packet
    D: Packet for CID 4 len 3
    D: chan 0x20005604 len 3
    D: Received ATT chan 0x20005600 code 0x0a len 2
    D: handle 0x0004
    D: re-using REQ buf 0x200058ac for RSP
    D: handle 0x0004
    D: handle 0x0000 offset 0 length 10
    D: code 0x0b
    D: conn 0x20001948 cid 4 len 11
    D: conn handle 0 buf len 15 cb 0x176fd user_data 0x2000565c
    D: handle 0 ref 2 -> 1
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001948
    D: conn 0x20001948 buf 0x200058ac len 15
    D: send single
    D: conn 0x20001948 buf 0x200058ac len 15 flags 0x02
    D: buf 0x200058ac len 19 type 2
    D: 
    D: 
    D: Exit: 0
    D: 
    D: Adding conn 0x20001948 to poll list
    D: wait on host fifo
    D: Calling k_poll with 3 events
    D: Event (0x13) len 5
    D: buf 0x20005984 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: Data: handle (0x00), PB(2), BC(0), len(7)
    D: buf 0x200058ac len 11
    D: Getting net_buf from queue
    D: buf 0x200058ac type 3 len 11
    D: buf 0x200058ac
    D: handle 0 len 7 flags 2
    D: handle 0 ref 1 -> 2
    D: conn 0x20001948
    D: tx 0x20002890 cb 0x176fd user_data 0x2000565c
    D: conn 0x20001948 chan 0x20005604
    D: chan 0x20005600
    D: chan 0x20005600
    D: handle 0 len 7 flags 02
    D: First, len 7 final 3
    D: Successfully parsed 7 byte L2CAP packet
    D: Packet for CID 4 len 3
    D: chan 0x20005604 len 3
    D: Received ATT chan 0x20005600 code 0x0a len 2
    D: handle 0x0006
    D: re-using REQ buf 0x200058ac for RSP
    D: handle 0x0006
    D: handle 0x0000 offset 0 length 2
    D: code 0x0b
    D: conn 0x20001948 cid 4 len 3
    D: conn handle 0 buf len 7 cb 0x176fd user_data 0x2000565c
    D: handle 0 ref 2 -> 1
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001948
    D: conn 0x20001948 buf 0x200058ac len 7
    D: send single
    D: conn 0x20001948 buf 0x200058ac len 7 flags 0x02
    D: buf 0x200058ac len 11 type 2
    D: 
    D: 
    D: Exit: 0
    D: 
    D: Adding conn 0x20001948 to poll list
    D: wait on host fifo
    D: Calling k_poll with 3 events
    D: conn 0x20001948
    D: conn 0x20001948
    D: Event (0x13) len 5
    D: buf 0x20005984 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: conn 0x20001948
    D: conn 0x20001948
    D: tx 0x20002880 cb 0x176fd user_data 0x2000565c
    D: conn 0x20001948 chan 0x20005604
    D: chan 0x20005600
    D: chan 0x20005600
    D: Data: handle (0x00), PB(2), BC(0), len(9)
    D: buf 0x200058ac len 13
    D: Getting net_buf from queue
    D: buf 0x200058ac type 3 len 13
    D: buf 0x200058ac
    D: handle 0 len 9 flags 2
    D: handle 0 ref 1 -> 2
    D: conn 0x20001948
    D: handle 0 len 9 flags 02
    D: First, len 9 final 5
    D: Successfully parsed 9 byte L2CAP packet
    D: Packet for CID 4 len 5
    D: chan 0x20005604 len 5
    D: Received ATT chan 0x20005600 code 0x04 len 4
    D: start_handle 0x0005 end_handle 0x0006
    D: re-using REQ buf 0x200058ac for RSP
    D: handle 0x0005
    D: handle 0x0006
    D: code 0x05
    D: conn 0x20001948 cid 4 len 10
    D: conn handle 0 buf len 14 cb 0x176fd user_data 0x2000565c
    D: handle 0 ref 2 -> 1
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001948
    D: conn 0x20001948 buf 0x200058ac len 14
    D: send single
    D: conn 0x20001948 buf 0x200058ac len 14 flags 0x02
    D: buf 0x200058ac len 18 type 2
    D: 
    D: 
    D: Exit: 0
    D: 
    D: Adding conn 0x20001948 to poll list
    D: wait on host fifo
    D: Calling k_poll with 3 events
    D: Event (0x13) len 5
    D: buf 0x20005984 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: Data: handle (0x00), PB(2), BC(0), len(9)
    D: buf 0x200058ac len 13
    D: Getting net_buf from queue
    D: buf 0x200058ac type 3 len 13
    D: buf 0x200058ac
    D: handle 0 len 9 flags 2
    D: handle 0 ref 1 -> 2
    D: conn 0x20001948
    D: tx 0x20002890 cb 0x176fd user_data 0x2000565c
    D: conn 0x20001948 chan 0x20005604
    D: chan 0x20005600
    D: chan 0x20005600
    D: handle 0 len 9 flags 02
    D: First, len 9 final 5
    D: Successfully parsed 9 byte L2CAP packet
    D: Packet for CID 4 len 5
    D: chan 0x20005604 len 5
    D: Received ATT chan 0x20005600 code 0x04 len 4
    D: start_handle 0x0007 end_handle 0x0006
    D: re-using REQ buf 0x200058ac for RSP
    D: code 0x01
    D: conn 0x20001948 cid 4 len 5
    D: conn handle 0 buf len 9 cb 0x176fd user_data 0x2000565c
    D: handle 0 ref 2 -> 1
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001948
    D: conn 0x20001948 buf 0x200058ac len 9
    D: send single
    D: conn 0x20001948 buf 0x200058ac len 9 flags 0x02
    D: buf 0x200058ac len 13 type 2
    D: 
    D: 
    D: Exit: 0
    D: 
    D: Adding conn 0x20001948 to poll list
    D: wait on host fifo
    D: Calling k_poll with 3 events
    D: conn 0x20001948
    D: conn 0x20001948
    D: Event (0x13) len 5
    D: buf 0x20005984 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: Data: handle (0x00), PB(2), BC(0), len(7)
    D: buf 0x200058ac len 11
    D: Getting net_buf from queue
    D: buf 0x200058ac type 3 len 11
    D: buf 0x200058ac
    D: handle 0 len 7 flags 2
    D: handle 0 ref 1 -> 2
    D: conn 0x20001948
    D: tx 0x20002880 cb 0x176fd user_data 0x2000565c
    D: conn 0x20001948 chan 0x20005604
    D: chan 0x20005600
    D: chan 0x20005600
    D: handle 0 len 7 flags 02
    D: First, len 7 final 3
    D: Successfully parsed 7 byte L2CAP packet
    D: Packet for CID 4 len 3
    D: chan 0x20005604 len 3
    D: Received ATT chan 0x20005600 code 0x0a len 2
    D: handle 0x0004
    D: re-using REQ buf 0x200058ac for RSP
    D: handle 0x0004
    D: handle 0x0000 offset 0 length 10
    D: code 0x0b
    D: conn 0x20001948 cid 4 len 11
    D: conn handle 0 buf len 15 cb 0x176fd user_data 0x2000565c
    D: handle 0 ref 2 -> 1
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001948
    D: conn 0x20001948 buf 0x200058ac len 15
    D: send single
    D: conn 0x20001948 buf 0x200058ac len 15 flags 0x02
    D: buf 0x200058ac len 19 type 2
    D: 
    D: 
    D: Exit: 0
    D: 
    D: Adding conn 0x20001948 to poll list
    D: wait on host fifo
    D: Calling k_poll with 3 events
    D: conn 0x20001948
    D: conn 0x20001948
    D: Event (0x13) len 5
    D: buf 0x20005984 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: conn 0x20001948
    D: conn 0x20001948
    D: tx 0x20002890 cb 0x176fd user_data 0x2000565c
    D: conn 0x20001948 chan 0x20005604
    D: chan 0x20005600
    D: chan 0x20005600

  •   I compared those logs, and the initialization part looks exactly the same. I all cases BLE is advertising, but in case #1 and #2 the Peripheral device (the developed one) cannot connect to the Central. In aforementioned cases there is no additional log indicating that device tries to connect to the Central.

    I've run out of ideas what else to do. is it worth to try the same application on another device, eg. nRF52833?

Related