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

nRF52840 BT Characteristic Notify only works when debugger is attached

Hello,

nRF52840-DK

SDK: 15.3.0

s140

OS: Ubuntu

IDE: SES

Our application is has a notify characteristic that works when attached to the JLink debugger. I can get the notify update within nRF connect, but when the application is not attached to the debugger the notify does not get updated. The notify is attached to a switch that is configured with app_button.

The order I took:

  1. Target >> Connect J-Link
  2. Target >> Download Application
  3. Connect with BT using nRF Connect
    1. Turn on notify
    2. press switch several times
      1. Result: No value update occurs with characteristic notify on phone
  4. Target >> Attach Debugger
  5. Press Switch
    1. Result: Notify Value updates on phone

Note: additionally if loaded with the play button in SES, the notify works as expected.

One thought is that printf, or NRF_LOG_INFO is causing an issue, but that is a loose theory.

Has this behavior been seen before? I have found some posts that are similar, but not the exact same issue.

https://devzone.nordicsemi.com/f/nordic-q-a/35380/scanner-freezes-application-without-debugger-connected-on-sd-6-0-0

The solution suggested in the post works, switching SEGGER_RTT_CONFIG_DEFAULT_MODE from 2, to 1, Blocking to Trim. The notify works while attached to the debugger and not attached to the debugger.

Do you know why this behavior is the case? Is this expected?

Parents
  • Hi,

     

     SEGGER_RTT_CONFIG_DEFAULT_MODE is configured for the RTT behavior if the buffer is full in sdk_config.h by setting it to the mode you want.

    The following modes are supported:

    SKIP - Do not block, output nothing.

    TRIM - Do not block, output as much as fits

    BLOCK - Wait until there is space in the buffer

    The default mode is SKIP. 

    Could you also test with <nRF5_SDK>\examples\ble_peripheral\ble_app_uart? Do you see the same symptom? If not, could you compare the sdk_config.h to see the differences? 

    -Amanda H.

Reply
  • Hi,

     

     SEGGER_RTT_CONFIG_DEFAULT_MODE is configured for the RTT behavior if the buffer is full in sdk_config.h by setting it to the mode you want.

    The following modes are supported:

    SKIP - Do not block, output nothing.

    TRIM - Do not block, output as much as fits

    BLOCK - Wait until there is space in the buffer

    The default mode is SKIP. 

    Could you also test with <nRF5_SDK>\examples\ble_peripheral\ble_app_uart? Do you see the same symptom? If not, could you compare the sdk_config.h to see the differences? 

    -Amanda H.

Children
Related