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

Run time error

I am facing one another problem basically i am  sending some AT command from central to peripheral but after some time its hang and wait app_erroc. c (__disable_irq();->while (loop);->__enable_irq();)  file or ses_startup_nrf52.s file(pls. find attaced file)4111.Image.docx

Parents Reply
  • I suggest you try to increase the size of the Softdevice write queue to see if it may help. This will allow for more calls to ble_nus_c_string_send() before it will start returning NRF_ERROR_NO_MEM. If it doesn't, you will have to look at ways to improve the BLE throughput, reduce the number of calls to ble_nus_c_string_send(), or consider to drop data when you run out of buffers.

    Code snippet: Increasing Softdevice TX Queue size for GATTC write commands

    /**@brief Function for initializing the BLE stack.
     *
     * @details Initializes the SoftDevice and the BLE event interrupt.
     */
    static void ble_stack_init(void)
    {
        ret_code_t err_code;
    
        err_code = nrf_sdh_enable_request();
        APP_ERROR_CHECK(err_code);
    
        // Configure the BLE stack using the default settings.
        // Fetch the start address of the application RAM.
        uint32_t ram_start = 0;
        err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &ram_start);
        APP_ERROR_CHECK(err_code);
    
        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.gattc_conn_cfg.write_cmd_tx_queue_size = 30; // Number of packets in queue
    
        err_code = sd_ble_cfg_set(BLE_CONN_CFG_GATTC, &ble_cfg, ram_start);
        APP_ERROR_CHECK(err_code);
        
        // Enable BLE stack.
        err_code = nrf_sdh_ble_enable(&ram_start);
        APP_ERROR_CHECK(err_code);
    
        // Register a handler for BLE events.
        NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler, NULL);
    }

Children
No Data
Related