Peripheral uart example - disconnection callback non called

Hello,

I'm running the "peripheral uart" example included in 2.7.0 SDK on a nRF52810.

It works fine but when central application disconnects no advertising messages are restarted and than no others connections are possible.

I tried to insert a call to bt_le_adv_start() in diconnected callback without success.

Adding some debug messages I discovered that when centrall application disconnects, no diconnected callback is actually called (instead, when central app connections, connection callback is correctly called).

So, it seems that nRF52810 doesn't feel the disconnection by central.

As central application I use nRFConnect App and others generic BLE master application (in particular BLE Scanner) on Android smartphone and the behaviour is always the same.

Please can you give some suggestions to fix this issue?

Many thanks and Best Regards

Fabiano

  • Hi, 

    I'm running the "peripheral uart" example included in 2.7.0 SDK on a nRF52810.

    Are you using the unmodified nrf\samples\bluetooth\peripheral_uart? Are you using a custom board? 

    I cannot reproduce the issue with unmodified nrf\samples\bluetooth\peripheral_uart and nRFConnect App or nrf\samples\bluetooth\central_uart sample on nRF52DK_nRF52810. The unmodified peripheral_uart will auto-advertise after disconnecting. Since nRF52810 has limited space to enable debug logs, you could use another device such as nRF52DK to debug them and move back to nRF52810. 

    Regards,
    Amanda H.

  • Hi, thanks for the answer and sorry for my late reply.

    Yes, I'm using the example you mentioned on a custom board. This board is equipped with Ezurio BL651 (that features a nRF52810)

    Starting from the example I made the following changes:

    - use the base configuration prj_minimal.conf due to limitation of nRF52810

    - added the following defines to prj_minimal.conf:

    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y

    CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y

    These defines are needed since on my board I don't have the external oscillator and I have to use the internal RC

    In any case after some check and investigations I discovered that the problem is that, when central app disconnects, the application crashes before calling the disconnection callback.

    After some (many) others checks and investigations I fixed the problem increasing the following stack define in prj_minimal.conf

    CONFIG_MPSL_WORK_STACK_SIZE=256

    Increasing it to 512 the application works perfectly

    Reagrds

    Fabiano

Related