Flash memory error : FDS_ERR_NO_PAGES

Hi DevZone !

I am using the nRF52840 for development and after some tests one of the chips could not access its memory flash in the function fds_init() in the library fds.c. I debugged it with Ozone and I saw the error FDS_ERR_NO_PAGES popping up. Can I repair the flash in some way ? Any suggestion on why it happened ?

Thank you !

Joel V.

  • I see, so you'll only write to the FDS once after programming the IC? How many resets before you get FDS_ERR_NO_PAGES from fds_init()? 

    Exactly Slight smile

    I couldn't count the number of resets but it may be a lot because this particuliar application is temporarly resetting a lot because I want to be sure it receives the mesh packets of the other applications because it is used as repeater. However right now it repeats only one other which may cause resets often. 

    I'm suspecting if you're getting alot of corrupted data that is caused by resetting the chip before the write operation has been completed.

    So the only reason that could explain this corrupted flash is that I did not comment the function that writes the flash at start ? Because like I said, in my final application, it is only supposed to read the flash at boot and never to write. Could it be corrupted in any way while reading ?

    I read Terjes response to your other ticket and I do agree with him on a second thought. My understanding of your application was different then how I understand it now.

    Perfect

    FDS_EVT_GC will be generated by the callback handler. You can set a flag in the callback handler which you can wait for with a while(flag) {}  loop. 

    I will try to do so.

    Thank you very much for your time, it is much appreciated,

    Joël V.

  • Joel V said:

    So the only reason that could explain this corrupted flash is that I did not comment the function that writes the flash at start ? Because like I said, in my final application, it is only supposed to read the flash at boot and never to write. Could it be corrupted in any way while reading ?

    You don't wait for the write operation to complete when you write to the flash the first time(step2). If you reset the application during the write operation then you can corrupted data. When the application then resets it will try to write to the flash again(step2) since the previous write didn't complete, but again the application will reset before the write completes and so on until the flash fills up with corrupted data. 

    I'm not excluding that the culprit could be something else, but this is my suspicion atm. An easy fix is to wait for the application to complete the write operation before the reset. Could you implement this in your application and see if you still get FDS_ERR_NO_PAGES?

    regards

    Jared 

Related