stass48
October 12, 2023, 11:09am
1
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:
opened 06:30PM - 15 Nov 12 UTC
EDIT: **The original issue from google code has been solved. This issue is still… open to keep track of uploading problems using USBAsp programmer, see comments below for details.**
This is [Issue 388](http://code.google.com/p/arduino/issues/detail?id=388) moved from a Google Code project.
Added by 2010-10-28T20:36:23.000Z by [rdlsoftware@gmail.com](http://code.google.com/u/rdlsoftware@gmail.com/).
Please review that bug for more context and additional comments, but update this bug.
### Original description
**What steps will reproduce the problem?**
1. Wire up a connection between the Arduino Duemilanove and Mega 2560
2. Upload ArduinoISP (from IDE 021) to Arduino Duemilanove
3. Upload a new bootloader to a Mega 2560 via the 'programmer'
**What is the expected output? What do you see instead?**
After uploading, the mega should accept new sketches.
**What version of the Arduino software are you using? On what operating**
**system? Which Arduino board are you using?**
Arduino 021. Arduino Duemilanove as ArduinoISP (version from IDE 021), Arduino Mega 2560 as target hardware. Windows 7 64 bit.
**Please provide any additional information below.**
See http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1287952386 for original post of issue.
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:
stass48
October 12, 2023, 12:07pm
3
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:
opened 04:49PM - 28 Jul 16 UTC
closed 10:22PM - 29 Jul 16 UTC
Hi.
I'm getting following Error on burning bootloader using arduino ide:
`avrdud… e: verifying ...
avrdude: verification error, first mismatch at byte 0xfd00
0xff != 0x09
avrdude: verification error; content mismatch`
I get this error on both Atmega64a and Atmega128a using any clock config and any programmer.
opened 04:01AM - 26 Nov 19 UTC
closed 02:22AM - 27 Nov 19 UTC
can you help me, setting fuse bit ATMega 128 16AU
![eror2](https://user-images.… githubusercontent.com/6671264/69598509-1be07b00-103c-11ea-9b55-d172aabfcada.png)
opened 05:12AM - 20 Apr 21 UTC
closed 06:56AM - 20 Apr 21 UTC
Hello. Tried to burn the bootloader using avrdude and was getting through settin… g the fuses ok but when trying to copy and then **validate** the bootloader, I am getting an error. Having trouble understanding why it would happen. Using USBTinyISP, programming AVR128. Able to upload programs just fine but not sure why burn bootloader is an issue.
The specific error is
avrdude.exe: verification error, first mismatch at byte 0x1fc00
0xff != 0x02
The terminal is shown below. Note that there are two different command line operations that occur consecutively:
```
C:\Users\x\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino18\bin> .\avrdude.exe "-CC:\Users\x\AppData\Local\Arduino15\packages\MegaCore\hardware\avr\2.1.2/avrdude.conf" -v -patmega128 -cusbtiny -e -Ulock:w:0x3f:m -Uefuse:w:0xff:m -Uhfuse:w:0b11001110:m -Ulfuse:w:0b11111111:m
avrdude: Version 6.3-20201216
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\x\AppData\Local\Arduino15\packages\MegaCore\hardware\avr\2.1.2/avrdude.conf"
Using Port : usb
Using Programmer : usbtiny
avrdude: usbdev_open(): Found USBtinyISP, bus:device: bus-0:\\.\libusb0-0001--0x1781-0x0c9f
AVR Part : ATmega128
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 4 12 64 0 no 4096 8 0 9000 9000 0xff 0xff
flash 33 6 128 0 yes 131072 256 512 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 4 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : USBtiny
Description : USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/
avrdude: programmer operation not supported
avrdude: Using SCK period of 10 usec
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x1e9702 (probably m128)
avrdude: erasing chip
avrdude: Using SCK period of 10 usec
avrdude: reading input file "0x3f"
avrdude: writing lock (1 bytes):
Writing | ################################################## | 100% 0.00s
avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3f:
avrdude: load data lock data from input file 0x3f:
avrdude: input file 0x3f contains 1 bytes
avrdude: reading on-chip lock data:
Reading | ################################################## | 100% 0.00s
avrdude: verifying ...
avrdude: 1 bytes of lock verified
avrdude: reading input file "0xff"
avrdude: writing efuse (1 bytes):
Writing | ################################################## | 100% 0.00s
avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0xff:
avrdude: load data efuse data from input file 0xff:
avrdude: input file 0xff contains 1 bytes
avrdude: reading on-chip efuse data:
Reading | ################################################## | 100% 0.00s
avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: reading input file "0b11001110"
avrdude: writing hfuse (1 bytes):
Writing | ################################################## | 100% 0.00s
avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0b11001110:
avrdude: load data hfuse data from input file 0b11001110:
avrdude: input file 0b11001110 contains 1 bytes
avrdude: reading on-chip hfuse data:
Reading | ################################################## | 100% 0.00s
avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0b11111111"
avrdude: writing lfuse (1 bytes):
Writing | ################################################## | 100% 0.00s
avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0b11111111:
avrdude: load data lfuse data from input file 0b11111111:
avrdude: input file 0b11111111 contains 1 bytes
avrdude: reading on-chip lfuse data:
Reading | ################################################## | 100% 0.00s
avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude done. Thank you.
C:\Users\x\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino18\bin> .\avrdude.exe "-CC:\Users\x\AppData\Local\Arduino15\packages\MegaCore\hardware\avr\2.1.2/avrdude.conf" -v -patmega128 -cusbtiny "-Uflash:w:C:\Users\x\AppData\Local\Arduino15\packages\MegaCore\hardware\avr\2.1.2/bootloaders/optiboot_flash/bootloaders/atmega128/7372800L/optiboot_flash_atmega128_UART0_115200_7372800L_B5_BIGBOOT.hex:i" -Ulock:w:0x0f:m
avrdude.exe: Version 6.3-20201216
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\x\AppData\Local\Arduino15\packages\MegaCore\hardware\avr\2.1.2/avrdude.conf"
Using Port : usb
Using Programmer : usbtiny
avrdude.exe: usbdev_open(): Found USBtinyISP, bus:device: bus-0:\\.\libusb0-0001--0x1781-0x0c9f
AVR Part : ATmega128
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 4 12 64 0 no 4096 8 0 9000 9000 0xff 0xff
flash 33 6 128 0 yes 131072 256 512 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 4 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : USBtiny
Description : USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/
avrdude.exe: programmer operation not supported
avrdude.exe: Using SCK period of 10 usec
avrdude.exe: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.11s
avrdude.exe: Device signature = 0x1e9702 (probably m128)
avrdude.exe: safemode: lfuse reads as FF
avrdude.exe: safemode: hfuse reads as CE
avrdude.exe: safemode: efuse reads as FF
avrdude.exe: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: Using SCK period of 10 usec
avrdude.exe: reading input file "C:\Users\x\AppData\Local\Arduino15\packages\MegaCore\hardware\avr\2.1.2/bootloaders/optiboot_flash/bootloaders/atmega128/7372800L/optiboot_flash_atmega128_UART0_115200_7372800L_B5_BIGBOOT.hex"
avrdude.exe: writing flash (131072 bytes):
Writing | ################################################## | 100% 0.03s
avrdude.exe: 131072 bytes of flash written
avrdude.exe: verifying flash memory against C:\Users\x\AppData\Local\Arduino15\packages\MegaCore\hardware\avr\2.1.2/bootloaders/optiboot_flash/bootloaders/atmega128/7372800L/optiboot_flash_atmega128_UART0_115200_7372800L_B5_BIGBOOT.hex:
avrdude.exe: load data flash data from input file C:\Users\x\AppData\Local\Arduino15\packages\MegaCore\hardware\avr\2.1.2/bootloaders/optiboot_flash/bootloaders/atmega128/7372800L/optiboot_flash_atmega128_UART0_115200_7372800L_B5_BIGBOOT.hex:
avrdude.exe: input file C:\Users\x\AppData\Local\Arduino15\packages\MegaCore\hardware\avr\2.1.2/bootloaders/optiboot_flash/bootloaders/atmega128/7372800L/optiboot_flash_atmega128_UART0_115200_7372800L_B5_BIGBOOT.hex contains 131072 bytes
avrdude.exe: reading on-chip flash data:
Reading | ################################################## | 100% 0.03s
avrdude.exe: verifying ...
avrdude.exe: verification error, first mismatch at byte 0x1fc00
0xff != 0x02
avrdude.exe: verification error; content mismatch
avrdude.exe: safemode: lfuse reads as FF
avrdude.exe: safemode: hfuse reads as CE
avrdude.exe: safemode: efuse reads as FF
avrdude.exe: safemode: Fuses OK (E:FF, H:CE, L:FF)
avrdude.exe done. Thank you.
```
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
system
Closed
April 9, 2024, 5:56pm
7
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.