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

"BLE_ERROR_GATTS_SYS_ATTR_MISSING" (0x3401) occurs during continuous BLE transmission

OS in development environment :Windows7
HARD :(Taiyo Yuden)EBSHSN Series Evaluation Board : Central / Peripherals
CPU :(Nordic) nRF52832 / ARMR Cortex-M4F 32 bit processor 28-pin Land Grid Array / 15GPIOs / SWD
Soft Ver:nRF5_SDK_15.3.0_59ac345

“BLE_ERROR_GATTS_SYS_ATTR_MISSING” occurs when 2k bytes of data are sent repeatedly.
Please tell me how to resolve.

* This does not occur when sending a single shot.
* Peripheral device for one central vs. 4 peripheral communication
* The central and peripheral settings are the same.

------------------------< Setting >-------------------------
/* Communication cycle: 15ms to 30ms */
#define MIN_CONN_INTERVAL MSEC_TO_UNITS(15, UNIT_1_25_MS) /**< Minimum acceptable connection interval (15 ms) */
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(30, UNIT_1_25_MS) /**< Maximum acceptable connection interval (30 ms) */
/* Data length: 247byte */
#define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247

------------------------< program >-------------------------
do
{
  uint16_t length = (uint16_t)index;
  err_code = ble_nus_data_send(&m_nus, data_array, &length, m_conn_handle);
  if ((err_code != NRF_ERROR_INVALID_STATE) &&
      (err_code != NRF_ERROR_RESOURCES) &&
      (err_code != NRF_ERROR_NOT_FOUND))
  {
      APP_ERROR_CHECK(err_code);   <---   (Error location)
  }
} while (err_code == NRF_ERROR_RESOURCES);
------------------------------------------------------------

Thanking you in advance

Parents
  • Hello,

    You say that ble_nus_data_send() returns BLE_GATTS_VAR_ATTR_LEN_MAX only when you send a lot of data? Does that mean that it initially return NRF_SUCCES, and then after a while, it returns BLE_GATTS_VAR_ATTR_LEN_MAX? Or does it return BLE_GATTS_VAR_ATTR_LEN_MAX immediately (on the first attempt)?

    What does the following event in your ble_evt_handler() look like?

            case BLE_GATTS_EVT_SYS_ATTR_MISSING:
                // No system attributes have been stored.
                err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);
                APP_ERROR_CHECK(err_code);
                break;

  • 1) Returns BLE_ERROR_GATTS_SYS_ATTR_MISSING when a large amount of data is sent. NRF_SUCCES is returned at first, and BLE_ERROR_GATTS_SYS_ATTR_MISSING is returned after a while.
    ”BLE_ERROR_GATTS_SYS_ATTR_MISSING is not returned from the beginning.
    2) The structure of the BLE_GATTS_EVT_SYS_ATTR_MISSING event of ble_evt_handler () is the same.
    The BLE_GATTS_EVT_SYS_ATTR_MISSING event of ble_evt_handler () does not occur.

Reply
  • 1) Returns BLE_ERROR_GATTS_SYS_ATTR_MISSING when a large amount of data is sent. NRF_SUCCES is returned at first, and BLE_ERROR_GATTS_SYS_ATTR_MISSING is returned after a while.
    ”BLE_ERROR_GATTS_SYS_ATTR_MISSING is not returned from the beginning.
    2) The structure of the BLE_GATTS_EVT_SYS_ATTR_MISSING event of ble_evt_handler () is the same.
    The BLE_GATTS_EVT_SYS_ATTR_MISSING event of ble_evt_handler () does not occur.

Children
  • Ok. Is it possible to reproduce this on a DK so that I can test this here in my office? I have not seen this return value coming "after a while". Only from the beginning. 

  • There seems to be a problem with Central.

    Checked Central Error 4 occurred in UART communication.

  • So you receive the APP_UART_COMMUNICATION_ERROR event?

    Check line 117 in app_uart.h:

    uint32_t error_communication; /**< Field used if evt_type is: APP_UART_COMMUNICATION_ERROR. This field contains the value in the ERRORSRC register for the UART peripheral. The UART_ERRORSRC_x defines from nrf5x_bitfields.h can be used to parse the error code. See also the \nRFXX Series Reference Manual for specification. */

    So the ERRORSRC register is described here.

    If it has the value 4, it means D = 0, C = 1, B = 0, A = 0. C = 1 means framing error. Either you have an unaccurate clock in one end, or you have a floating input pin, so that the UART think it receives data which doesn't match the frames. 

  • Please tell me how to improve the following phenomenon.
    
    When communication is performed from the central side, the DeugTerminal screen is displayed as shown below.
    ---------------------------------------------------
    <warning> ble_nus_c: Connection handle invalid.
    <warning> ble_nus_c: Connection handle invalid.
    <warning> ble_nus_c: Connection handle invalid.
    ---------------------------------------------------
    When a large amount of data is received from the peripheral side, the DeugTerminal screen is displayed as shown below.
    ---------------------------------------------------
    <error> app: app_uart_put failed for index 0x0032.
    <error> app: Fatal error
    ---------------------------------------------------
     
    Or
    ---------------------------------------------------
    <error> app: app_uart_put failed for index 0x0033.
    <error> app: Fatal error
    ---------------------------------------------------
    The error flag was 0x00.
    ERRORSRC =0x00
    Thanks for your cooperation.
  • Hello,

    I suggest that you define DEBUG in your preprocessor defines. This way it will print a bit more info whenever you receive the "Fatal error" in the log. Let me know if you are not sure how to do this. I also need to know what compiler/IDE you use, then.

    "app_uart_put failed for index 0x00XX" means that app_uart_put failed. If you define DEBUG in your preprocessor defines, it should also tell you what app_uart_put returned, which may help pin point the issue.

    "Connection handle invalid" means that you are trying to send data to a connection handle that isn't valid. Are you connected to multiple devices?

    I don't know from where you call this, and with what conn_handle?

    I suspect that if you try to reply to something, then you should be aware of that the BLE_NUS_C_EVT_NUS_TX_EVT doesn't contain the correct conn_handle. (the ble_nus_c service isn't designed for multiple connections). 

    It is a simple fix. Add:

    ble_nus_c_evt.conn_handle = p_ble_evt->evt.gattc_evt.conn_handle;

    before:

    p_ble_nus_c->evt_handler(p_ble_nus_c, &ble_nus_c_evt);

    So:

    1: add DEBUG to your preprocessor defines

    2: From where do you call ble_nus_c_string_send()? And with what conn_handle?

Related