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

Ram Memory of Attribute Size question

Hi, 

I have some question below: note: the project_uuid belong uuid-16bit by my define uuid of product myself.

1. My project uses project_uuid and DFU_btn_less services. I figure out If my definition is wrong. I set "#define NRF_SDH_BLE_VS_UUID_COUNT 1", but my project still running OK. Is the setting right?

2. Receives writes, How many NRF_SDH_BLE_VS_UUID_COUNT if following I call how many time sd_ble_uuid_vs_add in services_init()?

3. My project includes many services(project_uuid, HID, TMP, and DFU), and then I addition ATT_MTU = 247 from 23. Now my service_init happen error message "NRF_ERROR_NO_MEM = sd_ble_gatts_characteristic_add", but execute nrf_sdh_ble_enable(&ram_start) is OK, what's the problem?

4. Receives writes, I try to fix NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE = 2048 from 1408, and then this "NRF_SUCCESS= sd_ble_gatts_characteristic_add". Really fix the problem in this way?

5. Could you explain "NRF_SDH_BLE_SERVICE_CHANGED"? I just follow some example to turn on, but I think to occupy Ram size when I turn on NRF_SDH_BLE_SERVICE_CHANGED.

Parents
  • Hi Ken

    Sorry, but I'm still having some trouble understanding some of your questions, I hope these answers will be helpful.

    Q1-2: Yes, you'll need to increase your NRF_SDH_BLE_VS_UUID_COUNT if you're using the sd_ble_uuid_vs_add() function.

    Q3: Sorry, for recent SoftDevices it's usually easier to just increase the size of your GATT table.

    Q4: I misunderstood your initial question, you're correct. Increasing the size of NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE will make more space for services in RAM and likely fix your problem.

    Q5: Hopefully this will help you understand, as we don't have any official documentation except what can be found on the Infocenter

    The NRF_SDH_BLE_SERVICE_CHANGED is used in nrf_sdh_ble.c, in the sd_ble_cfg_set(), inside the bl_cfg struct.

    As long as nrf_sdh_ble_default_cfg_set() returns NRF_SUCCESS, you should be fine.

    Remember to set the RAM settings according to when you have NRF_SDH_BLE_SERVICE_CHANGED = 1. This way, you will ensure that the SoftDevice has enough memory to work with the NRF_SDH_BLE_SERVICE_CHANGED when needed. It is not a problem that the SoftDevice has too much RAM.

    Note that it is not possible to delete services with the SoftDevice. Only add them. But of course, if you disable and enable the SoftDevice again, all the services have to be initialized again. If you skip one service after enabling it so that it isn't enabled, it will be "deleted" (not included).

    Q6: Do you have to increase the ATT_MTU size? The ATT_MTU Throughput Example shows you how to increase the ATT_MTU size.

    Best regards,

    Simon

  • Hi Simonr: Thank you for your answer.

    excuse me, I forgot to say I used SDK 15.2.0. 

    Follow your answer, we continue to discuss, thanks.

    Q1-Q2: This's done.

    Q3: Follow your answer 5 days ago, you told me "You can move your characteristics to userspace and if you are using a recent SoftDevice you can increase the size of the GATT table.", I don't know what is userspace, and how to use userspace, Is like to set NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE ?

    Q4: This's done.

    Q5: What kind the product need to add this service? (example: HID_mouse, heart rate sensor)  Because I consider if this service adds to our product. what do you recommend?

    Q6: I modify NRF_SDH_BLE_GAP_DATA_LENGTH and NRF_SDH_BLE_GATT_MAX_MTU_SIZE, I set NRF_SDH_BLE_GAP_DATA_LENGTH is 27 change to 251, and I set NRF_SDH_BLE_GATT_MAX_MTU_SIZE is 23 change to 247. Actually, I refer to the ATT_MTU Throughput Example already. But my project happen  "NRF_ERROR_NO_MEM = sd_ble_gatts_characteristic_add".

    Note: you told me that "I can move your characteristics to userspace" or "re-set NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE". what different in two methods? and which one can fix the Q6 problem?

    Thank you for your patience.

Reply
  • Hi Simonr: Thank you for your answer.

    excuse me, I forgot to say I used SDK 15.2.0. 

    Follow your answer, we continue to discuss, thanks.

    Q1-Q2: This's done.

    Q3: Follow your answer 5 days ago, you told me "You can move your characteristics to userspace and if you are using a recent SoftDevice you can increase the size of the GATT table.", I don't know what is userspace, and how to use userspace, Is like to set NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE ?

    Q4: This's done.

    Q5: What kind the product need to add this service? (example: HID_mouse, heart rate sensor)  Because I consider if this service adds to our product. what do you recommend?

    Q6: I modify NRF_SDH_BLE_GAP_DATA_LENGTH and NRF_SDH_BLE_GATT_MAX_MTU_SIZE, I set NRF_SDH_BLE_GAP_DATA_LENGTH is 27 change to 251, and I set NRF_SDH_BLE_GATT_MAX_MTU_SIZE is 23 change to 247. Actually, I refer to the ATT_MTU Throughput Example already. But my project happen  "NRF_ERROR_NO_MEM = sd_ble_gatts_characteristic_add".

    Note: you told me that "I can move your characteristics to userspace" or "re-set NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE". what different in two methods? and which one can fix the Q6 problem?

    Thank you for your patience.

Children
No Data
Related