How to enable esb on ncs find-my

example: ncs/v3.0.1/find my/pair before use

I want to implement the ptx and prx of the ESB in the find my  example "pair before use". That is, how do I operate when both BLE and ESB are working together (such as in SDK 17.1 where BLE_app_uart + ESB_timeslot are used)?

best regard

Parents Reply Children
  • Hi
    Could this example support the switching between PRX and PTX?
    i want my device work as PRX most of the time and work as PTX sometimes
    Best regard

  • Hi 
    I attempted to first transfer the ptx code to the nRF52832, but in the timeslot_handler, the RADIO_HANDLER could not be found in the definition. How should I make the modification?
    Here is the build information



  • I am sorry, I knew about this. There is an API change that happened after NCSv2.7 and this has been mentioned and discussed in this thread.

    Your build error comes from calling that old symbol from the timeslot callback. In 2.7+ it was replaced by an internal static function (radio_dynamic_irq_handler()), so your app can’t see it and link fails.

    To make that sample work on later nrf connect sdk, you might need to hack it a bit.

    in subsys/esb/esb.c -> you need to remove the static keywork for the radio handler to expose it to the application

    -static void radio_dynamic_irq_handler(const void *args)

    +void radio_dynamic_irq_handler(const void *args)

    And in your application where you are handling your timeslot events you can do something like below

    app/src/timeslot_handler.c
    ...
    ...
         switch (signal_type) {
         case MPSL_TIMESLOT_SIGNAL_RADIO:
    -        /* Old samples used this symbol, removed in NCS >= 2.7 */
    -        RADIO_IRQHandler();
    +        extern void radio_dynamic_irq_handler(const void *args);
    +        radio_dynamic_irq_handler(NULL);
             ret->callback_action = MPSL_TIMESLOT_SIGNAL_ACTION_NONE;
             break;

    Note that this hack is an attempt to port that sample made for older SDK to make it to try to work on newer SDKs, otherwise, we do not have any official native support on what you are trying to achieve.

Related