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

Using Flash Data Storage library with nrf52840+external memory (connected through the QSPI) as backend

Hi,

I want to use Flash Data Storage library  to operate with data on external memory, connected through QSPI. So, as I see in this thread it should be possible, but for me not very clear, how I can start to impement it? What can be a starting point? I'm using SDK17, nrf52840-DK.

Thank you in advance.

  • Hello,

    If you want to use the FDS library with qspi you need to write a new backend for the FDS.

    There already is a softdevice backend and a non-softdevice backend. You can see how they are implemented if you compare the examples:

    SDK\examples\peripheral\flash_fds\pca10056\s140

    vs

    SDK\examples\peripheral\flash_fds\pca10056\blank

    The discussion in the thread that you linked to doesn't really conclude by using the FDS library at all, so that is probably also an option.

    Best regards,

    Edvin

  • Thank you, I will try to write my own backend for this.

  • But is work only in backend? Inside FDS library for reading from Flash, pointers to neccesary addresses in Flash are used, instead FStorage library's functions. For example in this function from fds.c:

    // Reads a page tag, and determines if the page is used to store data or as swap.
    static fds_page_type_t page_identify(uint32_t const * const p_page_addr)
    {
        if (   (p_page_addr == NULL)    // Should never happen.
            || (p_page_addr[FDS_PAGE_TAG_WORD_0] != FDS_PAGE_TAG_MAGIC))    // here
        {
            return FDS_PAGE_UNDEFINED;
        }
    
        switch (p_page_addr[FDS_PAGE_TAG_WORD_1])
        {
            case FDS_PAGE_TAG_SWAP:
                return FDS_PAGE_SWAP;
    
            case FDS_PAGE_TAG_DATA:
                return FDS_PAGE_DATA;
    
            default:
                return FDS_PAGE_UNDEFINED;
        }
    }


    So, I need to write not only backend, but also modify code of the FDS. Is it correct?
    Best regards

  • So, it seems that I almost successfully wrote own QSPI backend  for Fstorage library and rewrite sone functions in Flash Data Storage library. Now, all my code that I used for storing/removing records on internal flash works on external Flash.

    Unfortunately there is a trable with Peer Manager, it can't successfully store data on the external flash... So, at least on current implementation bonding functionality doesn't work... 

  • Have you managed to solve this (Peer Manager to store data on external flash)?  Is there a way to set both internal and external flash to work with FDS at the same time?

    Thanks in advance and regards

Related