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

NRF_ERROR_RESOURCES

When I send 90 KB data via BLE. Sometime I am getting NRF_ERROR_RESOURCES error. I have tried all the things that are available in support site. I am reading data from SPI and send it via BLE. I set SPI irq priority is 6. If I set SPI irq priority to 7 I am not getting Event for SPI transfer done. I think I am facing this issue because of irq handling. so please suggest me.

Parents
  • Hi,

    The function sd_ble_gatts_hvx() will return NRF_ERROR_RESOURCES when too many notifications are queued, i.e. the internal SoftDevice buffer is full.

    Try increasing NRF_SDH_BLE_GAP_EVENT_LENGTH  in sdk_config.h , it should indirectly increase the buffer size.

    The size could also be set directly like this (should be added to ble_stack_init() in main.c ):

        ble_cfg_t ble_cfg;
        memset(&ble_cfg, 0, sizeof ble_cfg);
        ble_cfg.conn_cfg.conn_cfg_tag           = APP_BLE_CONN_CFG_TAG;
        ble_cfg.conn_cfg.params.gatts_conn_cfg.hvn_tx_queue_size = 20;
        err_code = sd_ble_cfg_set(BLE_CONN_CFG_GATTS, &ble_cfg, ram_start);
        APP_ERROR_CHECK(err_code);

Reply
  • Hi,

    The function sd_ble_gatts_hvx() will return NRF_ERROR_RESOURCES when too many notifications are queued, i.e. the internal SoftDevice buffer is full.

    Try increasing NRF_SDH_BLE_GAP_EVENT_LENGTH  in sdk_config.h , it should indirectly increase the buffer size.

    The size could also be set directly like this (should be added to ble_stack_init() in main.c ):

        ble_cfg_t ble_cfg;
        memset(&ble_cfg, 0, sizeof ble_cfg);
        ble_cfg.conn_cfg.conn_cfg_tag           = APP_BLE_CONN_CFG_TAG;
        ble_cfg.conn_cfg.params.gatts_conn_cfg.hvn_tx_queue_size = 20;
        err_code = sd_ble_cfg_set(BLE_CONN_CFG_GATTS, &ble_cfg, ram_start);
        APP_ERROR_CHECK(err_code);

Children
Related