fds_init() Fault

The fault was caught by the weak handler, which I think means it was totally not expected.

 The trace starts from peer_manager_init() which is part of the Buttonless DFU Template Application.

 Log message: “peer_manager_pds: Could not initialize Flash. FD0002FF1”

 This comes from peer_data_storage.c, after returning from fds_init() (fds.c) but the log message in the source code has more text. Odd.

 Fault information: id=0x4001, pc=0x2FFF1, info=0x2003ffb8.

 After the fault I ran several times using breakpoints to track it down to the return from fds_init().

 

QUESTIONS:

Prior to  adding the Buttonless DFU code (over 300 lines), I was already using fstorage for direct read and write of the Config data flash (8Kbytes just below the B/L start address.) Is that the problem? Is fstorage incompatible with FDS?

Parents
  • Hello,

    It sounds like your fstorage data might be overlaping with the FDS area. FDS may fail to initialize in that case (it won't claim flash pages that don't have a valid Page tag)

    Please try the following:

    1. Allocate 2 flash pages for the fstorage data below the bootloader by setting the FDS_VIRTUAL_PAGES_RESERVED to '2' in sdk_config.h

    2. Make sure both fstorage and fds data is preserved by the bootloader. This is done by increasing the NRF_DFU_APP_DATA_AREA_SIZE configuration in the bootloader project.

    Best regards,

    Vidar

Reply
  • Hello,

    It sounds like your fstorage data might be overlaping with the FDS area. FDS may fail to initialize in that case (it won't claim flash pages that don't have a valid Page tag)

    Please try the following:

    1. Allocate 2 flash pages for the fstorage data below the bootloader by setting the FDS_VIRTUAL_PAGES_RESERVED to '2' in sdk_config.h

    2. Make sure both fstorage and fds data is preserved by the bootloader. This is done by increasing the NRF_DFU_APP_DATA_AREA_SIZE configuration in the bootloader project.

    Best regards,

    Vidar

Children
  • Setting  FDS_VIRTUAL_PAGES_RESERVED is set to 2.

     Since FDS need 3 pages, and I need 2 pages for fstorage, is 5 pages (5*4096) what i need for the DATA_AREA_SIZE?

     where is my flash area? – I’m assuming that it still is 8Kbytes immediately below the start of the bootloader, because of comments in the sdk_config.h file for FDS_VIRTUAL_PAGES_RESERVED. Is that correct?

    FDS does its thing in three pages, right? (per the example code), and I do my thing with nrf_fstorage_sd calls in two pages. They must be totally independent because I have my own structure and format for my config data that includes a crc. That’s why I think I need 5 pages total, not 3.  So the reserved data size (just below the bootloader) is 5*4096?

  • Correct, you will need to reserve 5 pages (FDS_VIRTUAL_PAGES_RESERVED + FDS_VIRTUAL_PAGES_RESERVED).

     where is my flash area? – I’m assuming that it still is 8Kbytes immediately below the start of the bootloader, because of comments in the sdk_config.h file for FDS_VIRTUAL_PAGES_RESERVED. Is that correct?

    Yes.

    FDS does its thing in three pages, right? (per the example code)

    Yes, it selects 3 pages by default.

Related