MPSL not working correctly with custom ble hci_rpmsg image

We have been trying to get MPSL up and running in a BLE and ESB coexistence project but haven't had much luck.

We use an app core image that enables the BLE interface and listens for RPC events from the net core. The net core is a modified version of the BLE hci_rpmsg image with support added for RPC and ESB. We use RPC to notify the app core when data is received over ESB from other Nordic devices. BLE only needs to run for a short period of time and that period of time is user initiated. When implementing the MPSL piece, the BLE hci image is able to bind to "zephyr_bt_hci_rpmsg_ipc" but the "net_buf_get" while loop that delivers data to the app core is blocked from sending anything. We haven't been able to figure out how to allow "net_buf_get" to send BLE data to the app core once MPSL is implemented. 

When we init MPSL, we schedule a request to open a session and create a time slot. This process completes without any issues and we are notified that the time slot has begun. At this time, we'll enable ESB and send some data to a nearby nrf5340dk and that process is also successful. After this happens, we would assume that we would notify MPSL that the process has completed and that the bluetooth communication channel should be allowed to continue. 

We have reviewed the following MPSL sample projects but continue to run into errors with the bluetooth hci communication piece.

  1. https://github.com/too1/ncs-esb-ble-mpsl-demo/tree/master
  2. https://github.com/nrfconnect/sdk-nrf/tree/main/samples/mpsl/timeslot

Oddly enough, the bluetooth portion worked without any issues until we enabled the following kconfig values for MPSL.

CONFIG_MPSL=y
CONFIG_MPSL_TIMESLOT_SESSION_COUNT=2
CONFIG_RING_BUFFER=y
CONFIG_DYNAMIC_INTERRUPTS=y
CONFIG_DYNAMIC_DIRECT_INTERRUPTS=y

Are there any examples where MPSL is used for BLE and ESB coexistence on a board with an app core and a net core? Unfortunately the first link above looks like it runs on an older infrastructure that doesn't apply to our use-case. Any help would be appreciated as we've spent a lot of time trying to get MPSL working correctly.

Parents
  • Hi Mike

    The only sample showing how to run ESB and BLE in timeslot on the nRF53 is this one.

    I have an ambition to update the ncs-esb-ble-mpsl-demo sample to run on the nRF53 as well, but I don't know how much time I will need to get this implemented. When I start work on this I will use the other sample for reference, no need to reinvent the wheel. 

    Best regards
    Torbjørn 

  • Thanks for the response.

    We tried building the project that you suggested but there are quite a few build errors. For the app core, the build complains about unknown type name 'NRF_RADIO_Type'. For the net core, the build complains about undefined reference to `mpsl_work_q'. 

    For the NRF_RADIO_Type error, I see that nrf5340_network.h contains that definition but I'm unsure why the application core is trying to reference it.

    Do you have any recommendations for getting the project to build correctly?

  • Hi Mike

    Have you had any more progress in the last couple of days? 

    I am starting work on porting the ncs-esb-ble-mpsl-demo to the nRF53 now. While I am planning to look to the jori example for inspiration, I wasn't planning to spend time getting it to run it its original form since it is quite old anyway.

    Best regards
    Torbjørn

  • No progress on my end unfortunately. The furthest I got was running the example using SDK 2.1.0 but I couldn't get the ESB portion to ever come online. The BLE portion was working correctly though.

    I appreciate you taking the time to get a sample up and running. We've invested a lot of time and resources into our product and the ESB and BLE coexistence part is the last piece of the puzzle for us. Let me know if there's anything I can do to assist you. 

  • Hi Mike

    I have started the porting work, and will share my developments in a separate branch of the example here

    To my surprise it was quite easy to get the demo application to run in the nRF5340 netcore, but I get MPSL asserts quite often so stability is not good, and the communication between the appcore and netcore is not yet functional. 

    Expect more updates in the coming weeks. 

    Best regards
    Torbjørn

  • Thanks for the quick response and all your work on this.

    I'll take a look at the sample and see how the progress is coming along. I ran into some issues with mpsl asserts as well but wasn't sure how to make heads or tails of them. Is there documentation around the mpsl assert codes?

  • Hi Mike

    There is no external documentation for the MPSL asserts unfortunately. They are linked to specific lines of code in the SoftDevice controller source code, and since the source is not shared neither is the exact nature of these asserts. 

    If you let me know which asserts you see I can look it up internally and help figure out what they mean. 

    Best regards
    Torbjørn

Reply
  • Hi Mike

    There is no external documentation for the MPSL asserts unfortunately. They are linked to specific lines of code in the SoftDevice controller source code, and since the source is not shared neither is the exact nature of these asserts. 

    If you let me know which asserts you see I can look it up internally and help figure out what they mean. 

    Best regards
    Torbjørn

Children
Related