天天看点

[nrf51822] nrf51 创建服务出现 NRF_ERROR_NO_MEM

err_code = sd_ble_uuid_vs_add(&base_uuid, &p_led->uuid_type);
[nrf51822] nrf51 创建服务出现 NRF_ERROR_NO_MEM

原因1:数量不够

  1. 增大uuid_count数量

原因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). */