首页 > 其他分享 >[nrf51822] nrf51 创建服务出现 NRF_ERROR_NO_MEM

[nrf51822] nrf51 创建服务出现 NRF_ERROR_NO_MEM

时间:2022-10-31 18:09:09浏览次数:58  
标签:enable ATTR NO nrf51822 nrf51 uuid GATTS TAB SIZE


err_code = sd_ble_uuid_vs_add(&base_uuid, &p_led->uuid_type);

[nrf51822] nrf51 创建服务出现 NRF_ERROR_NO_MEM_#define


softdevice_handler.c–softdevice_enable_get_default_config()

原因1:数量不够

  1. 增大uuid_count数量

p_ble_enable_params->common_enable_params.vs_uuid_count = 2;

原因2:空间大小不够

  1. p_ble_enable_params->gatts_enable_params.attr_tab_size = SOFTDEVICE_GATTS_ATTR_TAB_SIZE;
    修改宏定义,增大空间[BLE_GATTS_ATTR_TAB_SIZE_DEFAULT]
#define SOFTDEVICE_GATTS_ATTR_TAB_SIZE      BLE_GATTS_ATTR_TAB_SIZE_DEFAULT
/** @defgroup BLE_GATTS_ATTR_TAB_SIZE Attribute Table size
* @{
*/
#define BLE_GATTS_ATTR_TAB_SIZE_MIN 256 /**< Minimum Attribute Table size */
#define BLE_GATTS_ATTR_TAB_SIZE_DEFAULT 0x000 /**< Default Attribute Table size (0x580 bytes for this version of the SoftDevice). */


标签:enable,ATTR,NO,nrf51822,nrf51,uuid,GATTS,TAB,SIZE
From: https://blog.51cto.com/xuejianqiang/5810711

相关文章