Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to set device_manager_cnfg.h parameter ?

Hi, 

My problem that the RAM is insufficient for my project. 

Please, I want to know how to set optimization configuration. By the way, my central device only connect our peripheral.

Below these parameter that I don't know how to set:

DEVICE_MANAGER_MAX_BONDS : Is this represent how many device could bond in my device ? (My device is central type, and then I want to bond four peripherals) 

DM_GATT_CCCD_COUNT : Is this represent how many CCCD of service in the connected of peripheral ?

DEVICE_MANAGER_APP_CONTEXT_SIZE : I don't know why this parameter is 20 in ble_app_hrs_c ?

Parents
  • Hi, what SDK and nRF chip are you working on? All nRF5 SDK releases since v12 .x have been using peer manager (replaced device manager).

    To quickly answer your question:

    About DEVICE_MANAGER_MAX_BONDS: Yes.

    About DM_GATT_CCCD_COUNT: Yes.

    About DEVICE_MANAGER_APP_CONTEXT_SIZE: This means you can store up to 20bytes of application specific data to the bond, that may be something like "johannas heartrate".

     

  • Hi Kenneth:

     

    Thanks for your reply, this is very clearly answer. But I still have some questions that need your help, please. Below this I use version, chip, purpose and questions.

    • The SDK v11.0.0 and S130. The chip is nRF51822 by RAM 16K. 
    • Purpose: My project role is central. I have to store 4 peripherals bond of information, and then I just connect 1 device at the same time. So I ram setting refer app_ram_base.h. I select ram is #define APP_RAM_BASE_CENTRAL_LINKS_4_PERIPH_LINKS_0_SEC_COUNT_0_MID_BW 0x20002968

    (Q1). SEC_COUNT_0 : I don't know why this parameter always set SEC_COUNT_0 in CHECK_RAM_START_ADDR_INTERN(CENTRAL_LINK_COUNT, PERIPHERAL_LINK_COUNT). Because I thought the parameter is depend how many peripherals be connected in security of bond.

    (Q2). What is difference the MID_BW and _LOW_BW ?

    (Q3). Last question discuss two parameters: DM_GATT_CCCD_COUNT and DEVICE_MANAGER_APP_CONTEXT_SIZE. I only know mean in the word, but I don't how to development in project. Could you teach how to set two parameters in this example? Such as my central only connect the ble_app_uart of peripheral. How to set two parameters in my central?

    (Q4). Could you suggest what ram size is optimum in my project? Because my nRF51822 ram is 16K, so I set Ram=0x20002968 is still insufficient.

  • (A1) If you plan to support bonding (sometimes called pairing), then you should should set SECurity COUNT to 1 or more (depending on how many concurrent bonding operations you plan to execute in parallel, 1 is sufficent in most Applications). You can still bond to more than 1, it is just that the procedure to bond only support 1 at a time.

    (A2) LOW means that you will only exchange only 1 packet in each connection interval (small buffer required in the softdevice) , while MID means 3 packets in each connection interval. I recommend MID for most Applications.

    (A3) While developing the Application I suggest to set DM_GATT_CCCD_COUNT to 10, you can reduce it later if need be (but the savings are minimal), the DEVICE_MANAGER_APP_CONTEXT_SIZE can be set 0 for most Applications. 

    (A4) You write "..and then I just connect 1 device at the same time", that means the ram requirement you are interested in is likely APP_RAM_BASE_CENTRAL_LINKS_1_PERIPH_LINKS_0_SEC_COUNT_1_MID_BW 0x20001eb0. In that case the softdevice will require 7856bytes, in addition you will likely have a 1.5kB Call stack (shared between softdevice and Application). The remaing  7kB can be used for the Application.

Reply
  • (A1) If you plan to support bonding (sometimes called pairing), then you should should set SECurity COUNT to 1 or more (depending on how many concurrent bonding operations you plan to execute in parallel, 1 is sufficent in most Applications). You can still bond to more than 1, it is just that the procedure to bond only support 1 at a time.

    (A2) LOW means that you will only exchange only 1 packet in each connection interval (small buffer required in the softdevice) , while MID means 3 packets in each connection interval. I recommend MID for most Applications.

    (A3) While developing the Application I suggest to set DM_GATT_CCCD_COUNT to 10, you can reduce it later if need be (but the savings are minimal), the DEVICE_MANAGER_APP_CONTEXT_SIZE can be set 0 for most Applications. 

    (A4) You write "..and then I just connect 1 device at the same time", that means the ram requirement you are interested in is likely APP_RAM_BASE_CENTRAL_LINKS_1_PERIPH_LINKS_0_SEC_COUNT_1_MID_BW 0x20001eb0. In that case the softdevice will require 7856bytes, in addition you will likely have a 1.5kB Call stack (shared between softdevice and Application). The remaing  7kB can be used for the Application.

Children
No Data
Related