Mega 2560, IDE 2.2.1 Brick if using programmer

Hello!
There is an Arduino Mega 2560 board. When loading the sketch via the USB port on the board (USB-COM), everything works fine. However, if you try to upload the sketch through an external programmer (using the Upload Using Programmer button in the IDE), then nothing works, the board turns into a brick! If you flash the bootloader (TOOLS button - Burn Bootloader) and upload the sketch, then everything works again.

I found out that if I flash the fuse bits (remove BOOTRST), flash EEPROM, and then FLASH (the files are generated by Sketch - Export Compiled Binary, flashed using UsbAsp, SinaProg), then everything works. But I feel like I shouldn't have to do this manually. I want to press one button (Sketch - Upload Using Programmer) and let the IDE do all the work. By the way, this worked on Arduino Pro Mini (Atmega328).

I think this is a BUG. I want to see comments from the IDE developers to understand whether this is true or whether I’m doing something wrong, because it’s not a fact that my solution to the problem is completely correct. Thank you!

Arduino Mega 2560 (Arduino Mega or Mega 2560 (arduino:avr:mega)), Windows 10 (x64), Arduino IDE 2.2.1, UsbAsp, SinaProg.

Hi @stass48. You can learn all about this problem and the solutions from the discussion here:

It is not a bug in the IDE. Rather it is a bug in the USBasp firmware. You can flash the community version of the firmware with the bug fixed to your USBasp and it will work as expected:

Thanks for your reply. But I just tried UsbTiny ISP and it doesn’t work either. IDE writes that the upload is complete, but the sketch does not work until I reflash BUTRST fuse manually.

What happened after you updated the USBasp firmware?

Not yet. They wrote to me that the problem was in the programmer, I changed the programmer to another (USBtini), but the problem was not solved. By the way, either I'm blind, or the compiled file 1.06 is not here. I don’t know how to compile from source code, if I start to figure it out, I’ll spend another half a day. If they gave me a ready-made hex 1.06, I would flash it into my programmer.

Yeah, the USBtinyISP is not a good choice for using with the chips with >64 kB of flash memory. I believe it can be used, but you will get spurious verification errors. For example:

In my opinion, the USBasp with the community firmware is the perfect AVR ISP programmer. It is a bit challenging to update the firmware and there is some risk that if you fumble it the programmer might be left in a non-functional state, but with enough persistence I think you can manage it. The USBtinyISP programmer can be used to flash the firmware to the USBasp.

I see. The 1.05 version available from the link I provided is a good one. However, a 1.06 version is available. Unfortunately as with many open source projects the people working on it kind of stalled out just before crossing the finish line with the project, leaving things in a messy state. It seems the 1.06 firmware is only available from a fork of the PeterVH/usbasp repository. You can get it here:

I've been using that "1.06-alpha-2016-05-18" version of the firmware on my USBasp for the last 7 years without any problems at all.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.