Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

uart function is not working in nfc example.

Hello, nordic.

I have added uart functionality to hrs example, to add OBB pairing to uart example.

I have replaced as hrs --> nus and have inserted uart_init(), uart_event_handler and so on.

When I add uart_init () to main.c, it says that there is no problem with the code, but the LED is switching so fast that it looks a little bit and the advertising does not start.

I use

- SDK v11

- nRF52832

These issues do not make progress.
Please help me.

Thanks.

(Can I attach additional project files? If you need me to help you, I will attach it.)

Parents Reply Children
  • You need to see why this happens. Have you checked the error handler, or the disconnect reason? If you enable logging it might give some hints on why it disconnects. You can also set a breakpoint on the disconnection event, and check what disconnect reason that is reported. 

    Depending on how you have set up your project, this may be a bit different for you, but in most of our examples in SDK 11, you will have the event BLE_GAP_EVT_DISCONNECTED inside on_ble_evt(...) in main.c.

    Inside this event, check the disconnect reason:

    case BLE_GAP_EVT_DISCONNECTED:
                m_conn_handle = BLE_CONN_HANDLE_INVALID;
                uint8_t reason = p_ble_evt->evt.gap_evt.params.disconnected.reason;
                break;

    Check this reason to see if that can give any hints on the disconnect. If this is never reached in your project, it is probably because of an err_code != NRF_SUCCESS passed into an APP_ERROR_CHECK(err_code) in your project, which should be detected in app_error.c

     

    Best regards,

    Edvin

Related