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

FDS record write returns error 34311

For some reason get the crazy error.

Using: SDK17.0.2 and S132_7.2.0

Im writing 9 entries into a single file, here is a short log:

00> <debug> app: Datalen: 4

00> <debug> app: WR FID/RID/record_decs.record.id 1201,1200,1

00> <debug> app: Datalen: 4
00> <debug> app: WR FID/RID/record_decs.record.id 1201,1207,2
00> <debug> app: Datalen: 4
00> <debug> app:WR FID/RID/record_decs.record.id 1201,1202,3
00> <debug> app: Datalen: 8
00> <debug> app: WR FID/RID/record_decs.record.id 1201,1205,4
00> <debug> app: Datalen: 4
00> <debug> app: WR FID/RID/record_decs.record.id 1201,1204,5
00> <debug> app: Datalen: 4
00> <debug> app:WR FID/RID/record_decs.record.id 1201,1206,6
00> <debug> app: Datalen: 4
00> <debug> app: WR FID/RID/record_decs.record.id 1201,1201,7
00> <debug> app: Datalen: 4
00> <debug> app: WR FID/RID/record_decs.record.id 1201,1209,8
00> <debug> app: Datalen: 4
00> <debug> app: WR RID 1201,120A,0 ERROR: 34311

So file ID is 0x1201 and record ids from 0x1201 to 0x120A

On the last write the error happens. Any idea why?

  • Answering my own question: the problem with writing was the size of the Queue, I have increased it to 10 and write happens. The next problem however that after I reboot device it seems Flash is corrupted and app doesnt start. When I have bootloader programmed its trying to do OTA update on the app as its not considered valid. If I just have the app loaded it hangs on debug here:

    how can I catch this memory corruption problem?

    Thanks!

  • Hi,

    Does this happen regardless of FDS activity?

    Please note that flash writes through FDS are asynchronous (at least with the SoftDevice flash backend), and the writes are not finished until you get the callback event. This means that some FDS records may not be written (or halfway written, but halfway written records should get recognized as invalid records by FDS so they should not be a problem.)

    One thing that you can do, in order to confirm that this is indeed some sort of flash corruption, is to do a flash dump from the device, before and after. You can do that while connected through a J-Link programmer (for instance the one included on a DK), and run the command:

    nrfjprog --readuicr --readcode flashdump.hex

    which will read both the UICR flash page and the rest of the flash, and save it to a hex file named flashdump.hex. Then compare the two dumps, to figure out what areas has changed. If you attach them here then I can have a look, as well as look into what might have happened with the FDS pages.

    Regards,
    Terje

  • Hi Terje,

    They get written because I get callback on which I print the record id in my message, eg

    WR FID/RID/record_decs.record.id 1201,1205,4

    So all seems to be written properly and yet after power reset device wouldnt start.

    I will attach hex files to internal ticket.

    Kind regards,

    Sergey

  • As Terje figured out there was a problem in the code that would make fw read/write from a wrong memory address according to data read from FDS. So there was no real FDS corruption.

  • Hi, exactly what was the problem in the code?

Related