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

adding dfu service, no memory error

SDK 11.0.0, S132 v2.0.0, nRF52.

I have searched through the many questions already on the dev zone on this topic, but cannot solve my problem. I tried adding the dfu service to a ble project that already contained ble nus and ble_rscs services. When I add the dfu service, the device does not advertising. Through debugging, I found that the dfu_init function, which is the last service initialized in services_init, returns a no memory error.

From what I can see on the dev zone, there are two options:

  1. Increase the attr table and then increase the the start addr of RAM, then decrease the size of RAM accordingly.
  2. Use ble_gatts_vloc_user instead of ble_gatts_vloc_stack, and make sure the attributes are declared as either a static local or global variable.

When I try the first option, I change SOFTDEVICE_GATTS_ATTR_TAB_SIZE to 0x1080 (from 0x580), and I change the RAM start to 0x20002580 (from 0x20002080) and the RAM size to 0xDA80 (from 0xDF80). Despite these changes, I still get the no memory error (0x0004).

When I try the second option, I change the nus attributes that are assigned to ble_gatts_vloc_stack to be assigned to ble_gatts_vloc_user, such as: cccd_md.vloc = BLE_GATTS_VLOC_USER and attr_md.vloc = BLE_GATTS_VLOC_USER. When I try it this way, I get an invalid params error from the function that adds the rx_characteristic (0x0007)

Understandably, when I comment out the initialization for the nordic uart service, the project works just fine.

Were my attempts at a solution correct in and of themselves? Is there something I am missing?

Parents
  • From my point of view, the first solution you tried should fix the problem. Could you double check that you have correctly updated all the mentioned parameters, and that the changes are reflected when linking the project?

    Also note that you have not increased the RAM start (0x20002080 + (0x1080-0x580) = 0x20002b80) or decreased RAM size (64k - 0x2b80 = 0xd480) correctly :)

Reply
  • From my point of view, the first solution you tried should fix the problem. Could you double check that you have correctly updated all the mentioned parameters, and that the changes are reflected when linking the project?

    Also note that you have not increased the RAM start (0x20002080 + (0x1080-0x580) = 0x20002b80) or decreased RAM size (64k - 0x2b80 = 0xd480) correctly :)

Children
Related