Bus Pirate 5 - Windows 11 24H2 - "There's a problem with this drive" constantly appearing

Just picked up a BP5 rev10 and updated to latest firmware (the rev10 firmware from ci-buspirate-main-cfe5e7c). I’m running Windows 11 24H2 (Build 26100.3775).

Every time I plug the BP5 in, OR change a configuration that requires it to detach and re-attach itself (like going into bootloader mode or disconnecting from the terminal), Windows tells me that there’s a problem with the drive:

If going to bootloader mode it says there’s a problem with the RPI-RP2 disk.

It’s worth noting in both instances the drives and mounts are working completely fine, and Explorer lets me use it just fine (and the firmware upgrade I did initially was a success).

Out of curiosity I tried to run the scan and fix, it said it fixed the drive - but upon plugging back in again it decided there was a problem with the disk again. So much for “fixing” the drive and clearing the dirty bit… windows moment lol

Any ideas what this could be/is anyone also seeing this behaviour?

2 Likes

Update with additional troubleshooting I attempted:
Rebooted the machine.
Tried clicking on the notification, choosing “Continue without scanning”, then safe ejecting the BP5 USB drive in case that might have cleared the dirty bit (which I think is part of Microsoft’s own specification for FAT32 that the clean bit is set upon unmounting, but this is Microsoft, why would they follow their own spec…??). But no, still when I unplug/replug, same error.

1 Like

I’m sorry about that. I don’t know why windows thinks it is unclean, but the pop ups are normal. We do some weird stuff to keep the dual use (USB drive and access to the terminal apps) flash synced and not corrupted.

It’s annoying but abnormal. I was on a storm to change it so you had to hold the button to access the USB drive, but it seemed worked out “well enough” that everyone was happy with the current situation.

Are you able to access the drive in read only mode?

When the terminal is connected it goes into read only mode as expected, and Windows recognises it as read only. I can read files and copy them from, but not copy to. Is that what you were asking?

After a bit of playing around, yes, Windows is setting the dirty bit when the drive is surprise-removed.

cmd>fsutil dirty query D:
Volume - D: is Dirty

cmd>chkdsk D: /F
The type of the file system is FAT.

Chkdsk cannot run because the volume is in use by another
process.  Chkdsk may run if this volume is dismounted first.
ALL OPENED HANDLES TO THIS VOLUME WOULD THEN BE INVALID.
Would you like to force a dismount on this volume? (Y/N) y
Volume dismounted.  All opened handles to this volume are now invalid.
Volume Serial Number is 5021-0000
Windows is verifying files and folders...
\System Volume Information\WPSettings.dat is cross-linked on allocation unit 3.
Cross link resolved by copying.
File and folder verification is complete.

Windows has made corrections to the file system.
No further action is required.

   97,681,408 bytes total disk space.
        8,192 bytes in 1 hidden files.
       32,768 bytes in 4 files.
   97,640,448 bytes available on disk.

        8,192 bytes in each allocation unit.
       11,924 total allocation units on disk.
       11,919 allocation units available on disk.

cmd>fsutil dirty query D:
Volume - D: is NOT Dirty

At that point if I disconnect and reconnect the device, it wouldn’t give me a notification again. Although that of course changes as soon as another surprise-remove happens. Although as you said, it’s an unfortunate side effect really and the BP5 firmware is doing exactly what it needs to do to prevent corruption. Windows is also doing exactly as it intends to do, so it’s perhaps not really something that’s “fixable”.

I was going to look into seeing if it’s possible to disable Windows Autoplay (which is the reason the notifications happen in the first place) for just a specific device or devices. Didn’t have much luck there, but honestly I think I might just disable autoplay altogether, I realised I never actually use it and always pick the “Do nothing” option haha.

1 Like

Wait hang on, after running that chkdsk command, it’s not setting the dirty bit anymore or giving me notifications when connecting/disconnecting the terminal or replugging hahahaha I have no idea what’s going on.

1 Like

Thank you so much for the additional info. On my old laptop (win 10) I managed to disable autoplay for the bus pirate and other than the bump beep during shift it was unobtrusive. Since updating and on win 11 I see the notice of device change every time. That seems consistent with your experience.

We’ve discussed implementing MTP but support seems dodgy. The alternative is one (disk) or the other (terminal), or using that at least as the default mode with options to enable the more annoying mode.

I have two different computers, both running Windows 11 Pro Insider Preview OS build 27842.1000 (Canary), and I do not experience any of these issues when trying to duplicate @b4shful’s issue, with or without AutoPlay.

I haven’t tried it today yet, but I didn’t get the errors at all yesterday after running chkdsk on it, even when unplugging/plugging back in and the normal detach/reattaches that happen when using the terminal etc.

So it seems something a bit more complicated is going on than just “dirty bit is being set upon disconnect”. Currently the behaviour seems to be completely gone after that chkdsk, despite not even having touched autoplay.

2 Likes

It could certainly be something about the way FatFS formats the volume.

1 Like

Windows expects “System Volume Information” folder on each drive. Its the same when I format fat32 on linux and then use it on Windows. It says there is a problem with volume. Chkdsk fixes it so if my thesis is right it should re-appear when you format from BP console even the filesystem is completely fine without it.

1 Like