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

FDS change flash size using DFU

NRF52832

SDK is 14

System has bootloader, softdevice s132 5.0.0 and app.

App uses FDS, FDS config:

#ifndef FDS_ENABLED
#define FDS_ENABLED 1
#endif
#ifndef FDS_VIRTUAL_PAGES
#define FDS_VIRTUAL_PAGES 25
#endif
#ifndef FDS_VIRTUAL_PAGE_SIZE
#define FDS_VIRTUAL_PAGE_SIZE 1024
#endif
#ifndef FDS_BACKEND
#define FDS_BACKEND 2
#endif
#ifndef FDS_OP_QUEUE_SIZE
#define FDS_OP_QUEUE_SIZE 4
#endif
#ifndef FDS_CRC_CHECK_ON_READ
#define FDS_CRC_CHECK_ON_READ 0
#endif
#ifndef FDS_CRC_CHECK_ON_WRITE
#define FDS_CRC_CHECK_ON_WRITE 0
#endif
#ifndef FDS_MAX_USERS
#define FDS_MAX_USERS 4
#endif
Everything works perfectly but now there is need to have bigger FDS size, around 24kb. And I can only update app using DFU.
How can I do it?
Parents
  • Hi,

    The number you specify with FDS_VIRTUAL_PAGES in sdk_config.h is used by pages_init(). It sees the last page before the bootloader as the last FDS page and uses the specified number of pages below that. During initialization, it checks all the FDS pages to see if it is already a valid FDS page (has a valid FDS page header). If so, it is used. If not, it checks if the page is empty. If it is, it is used. But if the page does not have a valid FDS header and is not empty, it is not touched.

    This means that in order to expand the number of FDS pages you need to do two things:

    • Set FDS_VIRTUAL_PAGES to the new number.
    • The first time you boot after the DFU you need to erase all the new FDS pages before you call fds_init(). This way you ensure that the flash is empty and can be used. If not, the flash may not be erased (if for instance, the bootloader used it for dual bank updates).
  • Hi,
    I also have the same settings as him, but I am using sdk17. Due to product design issues, I cannot start after upgrading to dfu. So, if I want to increase the size of fds, can I only modify the "FDS.VIRTUAL-PAGES" value of the application?
    Looking forward to your reply, thank you.

Reply Children
No Data
Related