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.

  • Ok. good. So app_uart_put() returns 4 (NRF_ERROR_NO_MEM).

    Is it app_fifo_put() inside app_uart_put() that returns NRF_ERROR_NO_MEM? I need you to check this. Try to set a breakpoint here and see if that triggers.

    What is the size of your UART buffers? In the ble_app_uart_c example, it is called UART_RX_BUF_SIZE and UART_TX_BUF_SIZE, but it may be called something else in your application. It should be the second and third parameter in APP_UART_FIFO_INIT(). 

    Best regards,

    Edvin

  • Stopped at "return NRF_ERROR_NO_MEM" of "app_fifo_put ()".
    The buffer size is 256.

    --------------------------------------------------------------------------------------

    #define UART_TX_BUF_SIZE 256 /**< UART TX buffer size. */
    #define UART_RX_BUF_SIZE 256 /**< UART RX buffer size. */

    --------------------------------------------------------------------------------------

  • Ok. So that means that your buffer is full. 

    Do you see anything printed on your uart from this chip? Is flow control enabled on the UART? 

    Have you changed anything in the UART or FIFO library? 

    What is your UART connected to?

  • 1) Not printing with UART.
    2) Flow control is enabled.
    3) The FIFO library has not changed.
    4) The UART is converted to USB (using the evaluation board) and connected to the PC.

  • Can you try to disable the flow control? It is not always the computers interpret the flow control correctly when it goes through the segger chip on the DK.

    Are you using the nRF52832 DK? You have not changed the UART pin configurations, right? They are still RX P0.08 and TX P0.06?

    BR,

    Edvin

Reply Children
  • 1) EBSHSN (Evaluation board) is used.
    2) Flow control can be disabled.
    3) The UART pin is not changed.
    ---------------------------------------------------------------------------------
    #define RX_PIN_NUMBER 8
    #define TX_PIN_NUMBER 6
    #define CTS_PIN_NUMBER 7
    #define RTS_PIN_NUMBER 5
    ---------------------------------------------------------------------------------
    * Flow control is enabled in “main.c”, but flow control is not set in the “pca10040.h” board setting.

    * Even when flow control is prohibited, the same error occurred.

    *If flow control was disabled, an overrun error occurred during reception.

  • Are you sure that you use the correct baudrate? Is anything connected to the UART pins? I am not familiar with the evaluation board that you use. Is it possible to reproduce this issue with an nRF52832 DK?

  • 1)A label is used to set the baud rate.
    ---------------------------------------------------------------------------------------------------------------
    app_uart_comm_params_t const comm_params =
    {
    .rx_pin_no = RX_PIN_NUMBER,
    .tx_pin_no = TX_PIN_NUMBER,
    .rts_pin_no = RTS_PIN_NUMBER,
    .cts_pin_no = CTS_PIN_NUMBER,
    .flow_control = APP_UART_FLOW_CONTROL_ENABLED,
    .use_parity = false,
    .baud_rate = UART_BAUDRATE_BAUDRATE_Baud230400
    };
    ---------------------------------------------------------------------------------------------------------------
    2)Nothing is connected to the UART port.
    3)nRF52832 Cannot reproduce because there is no DK.
    * Is it related to being the center of multi-connections?

  • yokokawa said:
    Nothing is connected to the UART port.

     If nothing is connected to the UART, and you use flow control, then it will not be able to write anything on the UART, because it doesn't get the Clear To Send signal, and hence, your UART buffer will fill up. If you don't intend to use the UART, you should remove it from your application. 

  • There was a defect in the explanation.
    The device in which the error has occurred is a BLE multi-connection central device.
    Is there a relationship between BLE multi-connection and UART error?

Related