MSC exception

Hi,

Our production uses NRF52840 as the master chip. We encountered a strange problem where two folders have the same name and a file name has illegal characters. 

The probability of this happening is very low, so we can not find the root cause so far. As we know, the file system does not allow a folder with the same name and a file name with illegal characters. What are the possible causes of this problem?

The normal directory structure is shown below.

-----------------------------------------------------------------------------------------

I would like to provide more details for the MSC issue as below.

I attached the nrf_block_dev_qspi.c that I used, you may diff with the original file of the SDK.

There are two major modifications.

1.the issue was reported in this link https://devzone.nordicsemi.com/f/nordic-q-a/36654/usbd_msd-disk-initialization-fails-in-usb-unplug-with-sdk15-0

the difference was I added a timeout for the wait_for_idle()  function because I found it would hang on this function sometimes.

2. add debug message for troubleshooting 

We got the debug log sometimes(please find debug.log), although everything looks good, I thought it was unexpected. 

By the way, there were not any debug logs when the issue "two folders have the same name and a file name has illegal characters"  occurred.

Parents Reply Children
  • I see. I think we need a way to reproduce the issue in order to investigate and debug. How did you make it occur before (even if it may not be a reliable way to reproduce)?

  • This issue was reported by our testing team. Actually, they didn't know exactly when this happened. They just found it when connected to the PC to check the fit file of training.

    For the debug log issue, it can be caught sometimes and I can't see there is any regularity.

  • Does that mean it has happened only once or multiple times? I think we need to find a pattern and a way to reproduce in order to proceed.

  • So far, it has happened more than 10 times on different devices(We have about thirty devices on hand), and four times in the last month.
    I would like to confirm if the debug log I caught is expected. What I understand, it is unexpected.
    From a code perspective, I think this is also due to unexpected write operations, just like this thread we reported before.
    As it is difficult to find a pattern to reproduce it. Is it possible to find out the root cause by code review(nrf_block_dev_qspi.c)?

  • Hi,

    I agree the debug log looks unexpected and indicates an issue. But I do not  understand the issue enough to say much. I have asked for input from the maintainers and will inform you of any updates. Please let me know any new findings you may have in the mean time, especially if you find a good way to reproduce the issue.

    Update:

    The team has reviewed the code and do not see any good way forward without having a method to easily reproduce the issue. There are a few things we would like to know, though (which again makes more sense when able to reproduce):

    1. What other components (e.g. SoftDevice) are used alongside filesystem in the application that could cause race conditions?
    2. In case there are many other components used alongside filesystem, if your could disable them temporarily and then check out whether the filesystem issue still occurs.
    3. Can you somehow log all of the file operations that are performed? Then we could try to reproduce on our end using this log.
Related