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

How large is the size peer manager uses?

I'm trying to determine DFU_APP_DATA_RESERVED and FDS_VIRTUAL_PAGES. According to this Q&A, DFU_APP_DATA_RESERVED must be the same FDS_VIRTUAL_PAGES, if FDS_VIRTUAL_PAGE_SIZE is 1024.

My application uses 11 pages, so 11+the size peer manager uses must be FDS_VIRTUAL_PAGES( and DFU_APP_DATA_RESERVED). Is this right?

However, I cannot find how large size peer manager uses is.

Would you tell me the size?

  • Ok. So, I change the expression of this question. I assign my data to file id & key set like below.

    576 byte * 7 set(that is, 1 file id and 7 key, data size for 1 set is 576 byte, so total size is 4032 byte)
    
    774 byte * 1 set(that is, 1 file id and 1 key, data size for 1 set is 774 byte, so total size is 774 byte)
    
    691 byte * 2 set(that is, 1 file id and 2 key, data size for 1 set is 691 byte, so total size is 1382 byte)
    
    144 byte * 1 set(that is, 1 file id and 1 key, data size for 1 set is 144 byte, so total size is 144 byte)
    

    And I uses the peer manager.

    What is the enough number for FDS_VIRTUAL_PAGES to store all above data.

    (I have thought 1 file id & key set uses 1024 byte. This must be wrong according your(Mr. Petters') explanation.)

    Thank you.

  • You can see the storage format here.

    For each record you have 3 words (12 bytes) of overhead. It seems you have 11 records? Then it would be:

    Header + content = words in record

    3          + 144       = 147
    3          + 144       = 147
    3          + 144       = 147
    3          + 144       = 147
    3          + 144       = 147
    3          + 144       = 147
    3          + 144       = 147
    
    3          + 194       = 197
    
    3          + 173       = 176
    3          + 173       = 176
    
    3          + 36       = 39
    

    This totals into 1617 words, or 6468 bytes. This is the minimum amount required. One flash page is 4096 bytes, so 2 pages should be enough. In addition you need 1 swap page, so FDS_VIRTUAL_PAGES should be set to 3. Be ware that this is not taking Peer Manager into account.

  • I see. So, how large is the size Peer Manager uses?

    What is the enough number for FDS_VIRTUAL_PAGES if we take Peer Manager into account?

  • It is not a fixed number. It depends on how many bonds you store and what kind of data you store with each bond.

  • I store 1 bond.

    data with the bond is like below.


    define SEC_PARAM_BOND 1 /**< Perform bonding. */

    define SEC_PARAM_MITM 1 /**< Man In The Middle protection not required. */

    define SEC_PARAM_LESC 0 /**< LE Secure Connections not enabled. */

    define SEC_PARAM_KEYPRESS 0 /**< Keypress notifications not enabled. */

    define SEC_PARAM_IO_CAPABILITIES BLE_GAP_IO_CAPS_DISPLAY_ONLY /**< No I/O capabilities. */

    define SEC_PARAM_OOB 0 /**< Out Of Band data not available. */

    define SEC_PARAM_MIN_KEY_SIZE 7 /**< Minimum encryption key size. */

    define SEC_PARAM_MAX_KEY_SIZE 16 /**< Maximum encryption key size. */

Related