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.

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

Children
  • I can define 1024 or 2048 for FDS_VIRTUAL_PAGE_SIZE, right? I choose 1024, and this is the same as CODE_PAGE_SIZE in nrf_dfu_types.h.

    I want to preserve complete application data on DFU. And I know 11 pages are used for my application data, but it is not clear how much pages peer manager uses. I want to preserve both my application data and peer database.

    So please tell me how much pages peer manager uses.

  • Yes, correct.

    I see. You are storing your application data in flash, but you are not using FDS to do it. If you are using the 11 pages below FDS. And you haven't modified FDS_VIRTUAL_PAGES (3) or FDS_VIRTUAL_PAGE_SIZE (1024) you should set DFU_APP_DATA_RESERVED to 14.

    Please be aware that this only works if you application data is stored in the 11 pages below the flash area FDS is typically using.

  • I'm using FDS to store my application data.

    But still DFU_APP_DATA_RESERVED and FDS_VIRTUAL_PAGES should be 14?

  • Ok.

    FDS_VIRTUAL_PAGES should be whatever you set it to. I can't tell you how many flash pages you need to store you application data in addition to other data (the Peer Manager uses FDS to store bond information for example). Please be aware that this is a file system, it is not 11 pages for application and 2 pages for Peer Manager, they share 13 pages of flash (if FDS_VIRTUAL_PAGES is set to 14 (one page is swap page)).

    DFU_APP_DATA_RESERVED should be set equal to FDS_VIRTUAL_PAGES yes.

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

Related