PlatformIO Community

Can Only Upload to Due after Deleting Bossac

Hey folks, I’m having kind of a bizarre problem. At some point in this past month, the platformio environment on my laptop stopped being capable of uploading to my Arduino Due. Every time I would go to upload, it would auto-detect the port correctly, initiate the 1200 baud reset, then error with

No device found on COM7
*** [upload] Error 1

After a lot of trial and error, I found that I could get it to reliably upload only if I deleted the tool-bossac folder in packages before each upload, forcing platformio to reinstall bossac. The upload would then work perfectly once, and would not work again until I again deleted bossac.

I found this workaround after a lot of testing. In brief:

  • I am currently running platformio 5.2.5 with the atmelsam platform and all tools up to date. I use CLion as my IDE, but I tested uploading from the command line and get the same results.
  • Rolling back platformio to 5.0 did not resolve the issue
  • Deleting other tools or the main atmelsam package did not resolve the issue
  • The Arduino IDE meanwhile has no problems uploading
  • On my desktop, where I have what I thought was an identical pio environment, I have no problems. Same versions of all tools and packages, same IDE. The only difference I can think of is that I’m running Python 3.7 on my desktop and Python 3.10 on my laptop?

While I’ve identified a reliable workaround, it’s pretty dumb, and I have no idea how or why it works. If anyone thinks they know how to fix this more permanently, that would be awesome!

But the timing is that first bossac is (re)installed, then the 1200bps is done, then bossac is invoked? Or is bossac installed between the 1200bps reset and bossac invocation?

Do you have any antivirus activate that could scan the invocation of bossac?

The former; after hitting “Upload” bossac is installed, 1200bps reset is sent, and bossac is invoked and uploads.

I have Malwarebytes running, but that hasn’t been an issue in the past. I’ll disable it and see if that changes anything.

Malwarebytes was the problem. Specifically, the ransomware protection feature. Disabling it allowed uploads to run normally.

1 Like