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?

Parents
  • Where did you get "if FDS_VIRTUAL_PAGE_SIZE is 1024" from?

    Do you want to reserve your complete application? Don't you just wanted to reserve the part of flash that FDS uses?

    You should find the value of FDS_VIRTUAL_PAGES in your application, you can search for it, but usually it is found in sd_config.h, and unmodified the value is 3. Then DFU_APP_DATA_RESERVED should be set to 3.

  • 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.

Reply
  • 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.

Children
No Data
Related