I've managed to get really stuck with a project and I'm not sure how to fix it.
I have a small DIY development board with a Microchip SAMD10 MCU on it.
I have 2 laptops - an old Macbook Pro (~2010) with Ubuntu installed, and a newer Macbook Pro on which I've recently installed Mint 19.2.
On Ubuntu I was using OpenOCD to program my dev board with a cheap USB STLink v2 clone. I'd had to apply a patch to OpenOCD to make it work properly but it was working fine with Ubuntu.
I'm attempting to get things working now under Mint, but it's not working properly. I've followed the same steps I took to get it working with Ubuntu. When I try to upload the firmware, the function that I patched doesn't work properly and it fails.
But it doesn't fail every time. Sometimes it will flash the firmware successfully.
I added some debugging code to the function that is failing ( samd_issue_nvmctrl_command() ). When upload is successful, the function is called 10 times for the program I'm uploading. Sometimes it fails on the first call, sometimes the second etc etc.
I've tried quite a few things - including ensuring that both laptops were compiled from the same source version. I even copied the OpenOCD binary from the working laptop to the new one but this made no difference.
This leads me to suspect that the problem is actually with the OS somewhere interfering with the USB transfer.
I'm at a loss as to where I can look to try and diagnose the issue, so I was hoping someone might have some experience?