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

ANCS minimum requirement

Hi,

I'm working on integrating ANCS on our existing and futur products. I started to port the Nordic SDK example (12.x) and it seems to work fine on nRF52, which will be fine for our futur product line that will probably based on it.

But I also try to port it on nRF51, because we have released products based on it. I can make a working implementation on the DK, but the SDK example for ANCS is too big (FLASH and RAM) to cohabit with our existing Firmware.

So my question is the following. On the ANCS SDK example, what are the minimum requirement for a working ANCS peripheral ?

I understand it need at least the Service and Characteristics. What about pairing and db_discovery ? Can this be simplified at some points ?

Any experience, link or feedback is welcome on this subject.

Note that I'm using SD130

Thanks

  • Hi Thierry,

    We do have the example in SDK v12.2 for nRF51 (inside PCA10028 folder). Could you simply use the example for nRF51 ?

    Which nRF51 chip variant you have on your product? You may have issue with the size of RAM since we made the example for the 32kB RAM variant. If it doesn't fit your chip, we will have to simplify the code.

  • We use the nRF51822 CE AA. So yes, only 16 kB of RAM (and cannot change now). And yes, I used the PCA10028 example, ported on my product. I just stub some log and nrf functions, and use my own code for advertising. But it's sill about 4 kB of RAM and ~25 kB of Flash. I can make it work if I cut important part of my code, but now I'm looking for space in general (RAM + FLASH).

  • Hi Thierry,

    Have you reconfigured the RAM setting for softdevice to match with what you need (the number of central and peripheral connection) ? The actual RAM needed for single link peripheral is just 0x2078 not 0x3340 as in the default configuration.

    There are some other module that consume quite a lot of RAM such as db_discovery, peer manager/database , ble_advertising that you may be able to improve and squeeze some juice from.

  • Yes, I adjusted the RAM needed for the SoftDevice to the minimum required for my setup. Still not enough. I also skipped ble_advertising, since what needed was already done on my code. And I also saw that db_discovery and peer manager / database were the most resource consuming, and probably where I'll search to squeeze, as you suggest. But difficult to extract just the minimum required from it, that's where I'm (as optimizing my code).

  • I assume you also used MicroLIB so the 2kB of heap is not counted (you can remove 2kB heap manually also) I don't think it would be simpler to write your own discovery module as you focusing on just single ANCS service and know which handles exactly you want to discover and store.

    About the peer manager, maybe you can try to use device manager (removed from SDK v12) instead, it should use less RAM than peer manager. Or you can think of making your own module, simply store the bond information and get read it back when needed.

    How much RAM/flash still exceeded after all you've done ?

Related