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

Nordic nRF52840 USB MSC File Corruption Issue

     We found USB MSC File Corruption issue on nRF52840 SDK. It is 100% repeatable.

     Below is the test method and  result:

      Test environment:

       Platform: nRF52840

        HW board used: PCA10056

       SDK tested/used: SDK16.0 / SDK17.0

       Example used: sdk16_0\examples\peripheral\usbd_msc

     Test Method:

  1. Replace the main.c  with the attached file. (We just has little modification and add a special test routine.)
  2. Compile and download FW to  PCA10056 EVB.
  3. Open Uart  terminal to see the debug log with buadrate 115200.
  4. Press Button 1 on the PCA10056 EVB. Test1.txt and totally 250 random files will be created automatically. Please refer to the attached debuglog.txt
  5. Connect USB and use notepad to open Test1.txt, found the file Test1.txt was Corrupted due to Random files creation.

Test Result:

 

 

   More information:

  1. You can also download  the attached “usbd_msc_pca10056.hex”  file to your PCA10056 EVB for quick test.
  2. We have tested the most updated SDK.17.0, this issue still exist.
  3. We have searched the internet, and many people have reported this issue before since sdk 15.2 but still no any solution provided.

    Ref link:

    https://devzone.nordicsemi.com/f/nordic-q-a/39428/usb-msc-corruption

    https://devzone.nordicsemi.com/f/nordic-q-a/48535/problem-about-fatfs-and-qspi-on-nrf52840

   This issue is very critical, please help to check the root cause and provide solution to us.

   Thanks.

Best regards,

John


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/**
* Copyright (c) 2016 - 2019, Nordic Semiconductor ASA
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form, except as embedded into a Nordic
* Semiconductor ASA integrated circuit in a product or a software update for
* such product, must reproduce the above copyright notice, this list of
* conditions and the following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its
* contributors may be used to endorse or promote products derived from this
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[00:00:00.000,000] <info> app:
Creating filesystem...
[00:00:00.000,000] <info> app: Mounting volume...
[00:00:00.000,000] <info> app: Done
[00:00:00.000,000] <info> app: 1. Format Disk.
[00:00:00.000,000] <info> app:
Creating filesystem...
[00:00:00.000,000] <info> app: Mounting volume...
[00:00:00.000,000] <info> app: Done
[00:00:00.000,000] <info> app: 2. Create Test file.
[00:00:00.000,000] <info> app:
Test1.ext created Done
[00:00:00.000,000] <info> app: 3. Create Random files.
[00:00:00.000,000] <info> app: File create count(max 250): 1
Creating random file: 1dcf9710.txt ...done
[00:00:00.000,000] <info> app: File create count(max 250): 2
Creating random file: 0b24a2c2.txt ...done
[00:00:00.000,000] <info> app: File create count(max 250): 3
Creating random file: 33a3d95f.txt ...done
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
usbd_msc_pca10056.hex