Issue with nRF52840, USB MSC class, and Windows Explorer

I am at the breadboard stage of this project using an nRF5240DK and various sensor evaluation boards. Additionally, I have an embedded SDCard connected via SPI. The firmware is written using the Zephyr RTS, using NCS in VSCode.

The device needs to expose a storage card via USB MSC, this is implemented using USB Stack Next. The device uses FATFS to writing settings and log files to the embedded storage device. These files need to be viewed, and in some cases, modified using a Windows PC through Windows Explorer.

The basic issue is that Explorer appears to cache the filesystem of the embedded storage, so, when a file is changed by the device the new content is not viewable through Explorer. I have added a small usbd_msc_scsi overlay file to add the ability to notify the PC when files change. I also tried adding UNIT ATTENTION notification to the PC. Unfortunately this approach does not appear to work, the old file content remains. The only method I have found that works, is to have the device unmount and remount the storage card. This is not ideal from a user experience perspective.

I would appreciate any insight you may have that could help here,

Sid

Parents Reply Children
Related