USBasploader, avrdude, libusb and Arduino IDE

I want to use USBasploader on a ATmega2561 project so I've been doing some testing on a ArduinoUNO.

Burnt the bootloader to the UNO with a stk500v2 type programmer through the six pin header.

USBasploader is working... on most platforms.

Using avrdude with -Pusb I can download a test to the UNO from cmdline under Linux, Mac OS-X, even Linux running on a virtual machine.

VCS/PlatformIO works with -Pusb in the upload_protocol for avrdude.

But not ArduinoIDE (1.8.9) which insists on a serial connection, something like /dev/cu.moden147431 on OS-X.

Error message is:

avrdude: ser_open(): can't open device "/dev/cu.usbmodem147431": No such file or directory
Problem uploading to board.

lsusb on OS-X shows:

Bus 020 Device 012: ID 16c0:05dc 16c0 USBasp

I've read the threads where it says it 'just works', it doesn't for me.

Problem seems to be that avrdude uses libusb for USBasp but ArduinoIDE avrdude wants serial over USB.

(edit: works without -Pusb on cmdline)

Is there a solution?

Did you select Tools > Programmer > USBasp?

Did you do a Sketch > Upload Using Programmer?

pert:
Did you select Tools > Programmer > USBasp?

Yes.

Did you do a Sketch > Upload Using Programmer?

No, I didn't but that works.

I was thinking "Upload Using Programmer" only applied when using the ISP header.

After a bit of a re-think it makes sense now.

Thanks.

You're welcome. I'm glad to hear it's working now. Unless you are using a 3rd party board that is specifically configured to always do "Upload Using Programmer", the standard "Upload" in the Arduino IDE attempts to do an upload over serial to the port selected from the Tools > Port menu, which is the most common method of uploading to Arduino boards. The Tools > Programmer menu selection is ignored during a standard upload. If you're doing a lot of Upload Using Programmer, you might like to know the shortcut of holding the shift key while clicking the standard Upload button.

pert:
If you're doing a lot of Upload Using Programmer, you might like to know the shortcut of holding the shift key while clicking the standard Upload button.

I won't be doing a lot of uploading but thanks for the hint.