LittleFS on large QSPI NOR

I am having issues using a 2Gb NOR flash part for LittleFS storage on an nRF52840 based project (using the nRF Connect SDK). I am not sure yet if the issue is in the LittleFS module itself, the Zephyr fs (filesystem) module, or the QSPI/NOR driver. The symptom that I am seeing is that when I configure the size of the partition to larger than 16MB, after some amount of time (typically 15-20 minutes), the device begins reporting write errors (I'm writing to the device once per millisecond in my test app, in my final app, the writes will be in the range of every 40ms to every 4ms.

I have opened a ticket in the Zephyr project (https://github.com/zephyrproject-rtos/zephyr/issues/40453) which includes a piece of sample code and description for re-creating the problem, but I thought it might worth posting something here as well to see if anyone else has run into any similar issues.

Thanks!

Parents
  • I just discovered that I was not setting the address-size-32 field in the QSPI DTS entry. Obviously, that would map pretty well to the fact that I don't see symptoms with flash area sizes below 16MB. I'm rebuilding and re-running my code now, but I don't see anywhere in the code that this field is actually/obviously consumed.

    Is this field actually used by the driver to determine addressing mode (24-bit vs. 32-bit)? If not determined by this field, how does the driver decide which addressing mode to use, how can I ensure that we are using 32-bit mode for this part?

Reply
  • I just discovered that I was not setting the address-size-32 field in the QSPI DTS entry. Obviously, that would map pretty well to the fact that I don't see symptoms with flash area sizes below 16MB. I'm rebuilding and re-running my code now, but I don't see anywhere in the code that this field is actually/obviously consumed.

    Is this field actually used by the driver to determine addressing mode (24-bit vs. 32-bit)? If not determined by this field, how does the driver decide which addressing mode to use, how can I ensure that we are using 32-bit mode for this part?

Children
  • After setting this field, I see that erasing the partition is much faster (is that expected?) but I am now not able to format the device (error -28 LFS_ERR_NOSPC) which seems strange given that I just erased the entire flash partition (unless, of course the partition didn't actually get erased). I have stepped through the erase operation which appears to work (returns NRF_SUCCESS), but, again, based on timing seems like it might not actually be performing the operation.

Related