BLE_GATT_STATUS_ATTERR_REQUEST_NOT_SUPPORTED, when trying a Write Characterisitc?

Part: nrf52833

Soft Device: SD140 (recently switched from SD 122 because SD140 supports more BLE 5.x features)

Application: Replace legacy Central host device with nrf53833.

Problem: One of our production peripherals will make a connection, but the Characteristic writes  fail after to switching from SD 122 to SD 140.

The gstt_status fault code is 0x106.  BLE_GATT_STATUS_ATTERR_REQUEST_NOT_SUPPORTED

One of our peripherals gets an error when a Write Characteristic is requested, type_2 passes the request.

This is a high priority to get working?  Is there any way to tell why SD122 did not have this issue?

Thanks,

Dan

Customer Sensor Peripheral type 1:  gets a gatt_status failure

00> <warning> ble_nus_c: WRITING TO THE AUTH CHAR
00> <debug> app: GATT STATUS FAULT CODE 0x106

Customer sensor Peripheral type 2: no failure, is it possible that sensor 1 does not support the MTU exchange below that sensor 2 shows?

00> <debug> nrf_ble_gatt: Peer on connection 0x0 requested an ATT MTU of 247 bytes.
00> <debug> nrf_ble_gatt: Updating ATT MTU to 23 bytes (desired: 23) on connection 0x0.
00> <info> app: Ble NUS max data length set to 0x14(20)

Parents
  • Hello,

    It looks like you central project is not configured to support long ATT MTUs, which means your payload is effectively limited to 20 bytes for each write without response packet (GATTC Characteristic Value Write Without Response). I suggest you try to increase the MTU in your project to allow for longer packets.

    Increasing the max. ATT MTU Size

    In gatt_init():

    /**@brief Function for initializing the GATT library. */
    void gatt_init(void)
    {
        ret_code_t err_code;
    
        err_code = nrf_ble_gatt_init(&m_gatt, gatt_evt_handler);
        APP_ERROR_CHECK(err_code);
    
        err_code = nrf_ble_gatt_att_mtu_central_set(&m_gatt, NRF_SDH_BLE_GATT_MAX_MTU_SIZE);
        APP_ERROR_CHECK(err_code);
    }

    and in sdk_config.h:

    // <o> NRF_SDH_BLE_GATT_MAX_MTU_SIZE - Static maximum MTU size. 
    #ifndef NRF_SDH_BLE_GATT_MAX_MTU_SIZE
    #define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247
    #endif

    One of our peripherals gets an error when a Write Characteristic is requested, type_2 passes the request.

    I guess you were trying to do a "long write" (GATTC Characteristic or Descriptor Value Long Write) when you got the error? Either way,  BLE_GATT_STATUS_ATTERR_REQUEST_NOT_SUPPORTED is indicating that you tried to issue an request that is not supported by the peripheral.

    Best regards,

    Vidar

Reply
  • Hello,

    It looks like you central project is not configured to support long ATT MTUs, which means your payload is effectively limited to 20 bytes for each write without response packet (GATTC Characteristic Value Write Without Response). I suggest you try to increase the MTU in your project to allow for longer packets.

    Increasing the max. ATT MTU Size

    In gatt_init():

    /**@brief Function for initializing the GATT library. */
    void gatt_init(void)
    {
        ret_code_t err_code;
    
        err_code = nrf_ble_gatt_init(&m_gatt, gatt_evt_handler);
        APP_ERROR_CHECK(err_code);
    
        err_code = nrf_ble_gatt_att_mtu_central_set(&m_gatt, NRF_SDH_BLE_GATT_MAX_MTU_SIZE);
        APP_ERROR_CHECK(err_code);
    }

    and in sdk_config.h:

    // <o> NRF_SDH_BLE_GATT_MAX_MTU_SIZE - Static maximum MTU size. 
    #ifndef NRF_SDH_BLE_GATT_MAX_MTU_SIZE
    #define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247
    #endif

    One of our peripherals gets an error when a Write Characteristic is requested, type_2 passes the request.

    I guess you were trying to do a "long write" (GATTC Characteristic or Descriptor Value Long Write) when you got the error? Either way,  BLE_GATT_STATUS_ATTERR_REQUEST_NOT_SUPPORTED is indicating that you tried to issue an request that is not supported by the peripheral.

    Best regards,

    Vidar

Children
No Data
Related