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

SoftDevice S140 L2CAP Recombination

I am attempting to port a BLE application to the nRF52840. The original application used a standard HCI serial interface so I am trying to adapt that to use the Nordic SoftDevice.

I am trying to determine how L2CAP recombination/reassembly is performed when using the SoftDevice. HCI ACL packets include the PB flags which indicate first and continuing packets that the host can use to reassemble L2CAP packets.

Based on my examination of nRF5_SDK_16.0.0_98a08e2 source code and SoftDevice API documentation, it seems that I need to register an observer using NRF_SDH_BLE_OBSERVER to receive BLE notifications from the SoftDevice and subsequently retrieve events using `sd_ble_evt_get()` and then look for various event types such as BLE_L2CAP_EVT_CH_RX to receive the L2CAP packets.

However, I can find no mention of the PB flags in the `ble_evt_t` struct returned by `sd_ble_evt_get()`.

Does the SoftDevice handle recombination (reassembly)?

Regards,

mike

Parents
  • Hi,

    The SoftDevice does not use the HCI defined in the Bluetooth specification, as it (simply put) implements both host and controller as one opaque unit. You interface it through the SoftDevice API (which can also be serialized, if you use the SoC running the SoftDevice for network mcu.)

    There is a BLE HCI controller example which is part of the Zephyr project, that is compatible with the nRF52 series devices, if a pure Bluetooth HCI controller is what you are looking for.

    With a bit more information about the project, I may be able to better point you in the right direction. I am afraid it is a bit unclear to me at the moment, what you need.

    Regards,
    Terje

  • Thank you . You answered my question about L2CAP recombination/reassembly and more.

    I went through the process of installing Zephyr (Yikes!) and building the hci_uart example for the nrf52840_pca10056 board to track down the nordic source files for that implementation

    It appears that Zephyr is using the nRF5 hardware directly with no use of the SoftDevice, which to my mind is quite interesting.

    In particular the `subsys/bluetooth/controller` directory, all of which seems to contain that implementations from Nordic which I *assume* adapts the nRF5 to the Zephyr environment.

    I'm going to need a lot of coffee.

    Please correct me if I'm on the wrong track.

  • Hi,

    From your descriptions it sounds like basing things off of Zephyr might be a good direction, as Zephyr already uses the BLE HCI protocol that your current project uses.

    Please note that while we have made some contributions to the Zephyr project we have not and do not currently provide support for Zephyr based projects for the nRF52 series devices. Our new SDK, the nRF Connect SDK (NCS), integrates Zephyr, but to date NCS only supports the nRF53 series and the nRF91 series. For nRF52 projects we therefore refer to the Zephyr community.

    You are of course free to ask nRF52 + BLE + Zephyr related questions here in DevZone, as other users may still give valuable help and feedback, just be aware that the Zephyr community is probably the best resource on Zephyr related matters.

    Regards,
    Terje

  • After a month, I have succeeded in porting my HCI based Bluetooth Mesh stack to the Zephyr OS using the nRF52840. I started with the `hci_uart` example and stripped the UART code using the HCI queues directly. It required a bit of tweaking of the Zephyr HCI code to get it fully working, but I now have the system working.

    Thank you for the pointers,

    mike

  • Hi,

    Thank you for the status update. I am happy to hear that you got everything up and running!

    Regards,
    Terje

Reply Children
No Data
Related