Question about the device not working after pairing is complete

HI

We are currently reviewing a problem with a product currently in mass production and would like to request your assistance.

1. Development environment

- nRF52832 

-  nRF5_SDK_17.1.0 

- NUS / S112

- SEGGAR

2. configuration status

This product connects central and peripheral products to exchange data.

3. Problem Phenomenon

As described below, while the peripheral and the central are connected, the central is reset by external DC power.

The central then resumes BLE scanning when DC power is restored.

The peripheral then resumes averting.

-> The problem is that when the central is re-scanned after a power reset, the peripheral does not perform any actions after re-pairing. 

  ( Interstitial occurrence )

4. Reviewing the Problem

After reviewing in debugging mode, I found that the function below was stuck in an infinite loop.

nrfx_err_t nrfx_uart_tx(nrfx_uart_t const * p_instance, uint8_t const *     p_data, size_t     length)

As I followed Seggar's stack, I confirmed that it was caused by printf() below.

Since UART is not used, set it as follows when powering on.

5. Question

After deleting the printf() statement above and repeating the test, I was unable to reproduce the issue.

However, because the issue occurred intermittently, I'm questioning the accuracy of the information I reviewed above.

6. Other - Settings Status

     

    

   

Please confirm that the problem phenomenon and what I have reviewed are appropriate.

thank you

Parents
  • Hi David, 

    Please try to enable DEBUG in the project setting -> preprocessor definition. 
    So that we can see when there is a fatal error. The log should be able to point you to what caused the error. 


    Another approach is to build with debug mode instead of release mode and you can step into the code and check the app_error_fault_handler() to see at which line and which file the application crashed. 

    You can use RTT for logging if UART doesn't work. 

    If you test with the default example do you see the same problem ? 
    Please be aware that you are using deprecated SDK. The recommended SDK you should use is nRF Connect SDK.  

  • HI

    I found the same results through analysis with the debugging method you suggested.

    "ERROR 13313" occurs in Periphral, and the condition is when Central is reset as mentioned in the text.

    [ RTT ]

     <error> app: ERROR 13313 [Unknown error code] at :0
    PC at: 0x00000000"

    Even though I added the following, I still get ERROR 13313.

    Is there any other solution?

    Also, is the infinite loop in the UART TX interrupt statement above valid?

    void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context) {
        switch (p_ble_evt->header.evt_id) {
            case BLE_GATTS_EVT_SYS_ATTR_MISSING:
                // Handle system attribute missing event
                uint32_t err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);
                APP_ERROR_CHECK(err_code);
                break;
            // ... other BLE events ...
        }
    }

Reply
  • HI

    I found the same results through analysis with the debugging method you suggested.

    "ERROR 13313" occurs in Periphral, and the condition is when Central is reset as mentioned in the text.

    [ RTT ]

     <error> app: ERROR 13313 [Unknown error code] at :0
    PC at: 0x00000000"

    Even though I added the following, I still get ERROR 13313.

    Is there any other solution?

    Also, is the infinite loop in the UART TX interrupt statement above valid?

    void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context) {
        switch (p_ble_evt->header.evt_id) {
            case BLE_GATTS_EVT_SYS_ATTR_MISSING:
                // Handle system attribute missing event
                uint32_t err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);
                APP_ERROR_CHECK(err_code);
                break;
            // ... other BLE events ...
        }
    }

Children
  • Hi David, 
    Error 13313=0x3401=BLE_ERROR_GATTS_SYS_ATTR_MISSING 
    It happen when you try to send a notification to a characteristic that has not set the value for CCCD. As far as I know if you call sd_ble_gatts_sys_attr_set() in BLE_GATTS_EVT_SYS_ATTR_MISSING it should be OK. 
    Have you checked if ble_evt_handler() is added/registered as BLE event handler in your code ? 

  • HI

    As I mentioned in the previous post, I've already added the following to the BLE event handler.

    However, in debug mode, I get an error instead of the BLE_GATTS_EVT_SYS_ATTR_MISSING error below.

    What am I misunderstanding?

    void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context) {
        switch (p_ble_evt->header.evt_id) {
            case BLE_GATTS_EVT_SYS_ATTR_MISSING:
                // Handle system attribute missing event
                uint32_t err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);
                APP_ERROR_CHECK(err_code);
                break;
            // ... other BLE events ...
        }
    }

  • Hi David, 
    Please double check if you the ble_evt_handler() added as the BLE observer with this function: 

    NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler, NULL);

    My understanding is that you don't see event BLE_GATTS_EVT_SYS_ATTR_MISSING and sd_ble_gatts_sys_attr_set() was never called ?
    Do you see the same problem when you test with our example , for example ble_app_proximity ? 

Related