Go Down

Topic: Error while burning bootloader (Arduino 1.6.10) (Read 876 times) previous topic - next topic

bratan

I'm using custom bootloader, basically Optiboot for ATMega328p at 8Mhz.
Using Pololu USB AVR programmer.
Absolute no issues in Arduino 1.6.5, but 1.6.10 gives  me this error:

Code: [Select]
avrdude: verification error, first mismatch at byte 0x0000
         0xff != 0x3f
avrdude: verification error; content mismatch
Error while burning bootloader.


Here's my boards file:
Code: [Select]

SQMT8.name=ATmega328p Squaremote (8Mhz)

SQMT8.upload.tool=arduino:avrdude
SQMT8.upload.protocol=arduino
SQMT8.upload.maximum_size=32256
SQMT8.upload.speed=57600
#SQMT8.upload.speed=38400

SQMT8.bootloader.tool=arduino:avrdude
SQMT8.bootloader.low_fuses=0xE2
SQMT8.bootloader.high_fuses=0xDE
SQMT8.bootloader.extended_fuses=0x06
SQMT8.bootloader.path=arduino:optiboot
SQMT8.bootloader.file=optiboot/optiboot_atmega328_SQMT_8MHz.hex
SQMT8.bootloader.unlock_bits=0x3F
SQMT8.bootloader.lock_bits=0x0F

SQMT8.build.mcu=atmega328p
SQMT8.build.f_cpu=8000000L
SQMT8.build.board=AVR_SQMT8
SQMT8.build.core=arduino:arduino
SQMT8.build.variant=arduino:standard
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, etc.

pert

Here's the issue: https://github.com/arduino/avrdude-build-script/issues/2
It should be fixed in this test build: https://github.com/arduino/Arduino/pull/5202#issuecomment-237322962. If you test the build please post your results either on GitHub or here and I'll relay them to GitHub. You can also switch to Arduino AVR boards 1.6.11 to fix the issue.

pert

If you use the test build you'll also need to change the unlock and lock bits values in your boards file from:
Code: [Select]
SQMT8.bootloader.unlock_bits=0x3F
SQMT8.bootloader.lock_bits=0x0F

to:
Code: [Select]
SQMT8.bootloader.unlock_bits=0xFF
SQMT8.bootloader.lock_bits=0xCF

This will make your boards file incompatible with previous Arduino AVR Boards versions. If your board has its own avrdude.conf that will also need the lock bits read mask changed according to https://savannah.nongnu.org/patch/index.php?8996

bratan

Thanks! I tried running test build (Windows 10 x64), but it won't launch. I get splash screen and then nothing. No processes, nothing in event viewer...
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, etc.

pert

That's a shame. It starts right up for me on Windows 7. If you wanted to look into it more you can start arduino_debug.exe from the command line. I'm hoping the changes in that build will be incorporated in the soon to be released Arduino IDE 1.6.11/Arduino AVR Boards 1.6.13.

You're going to need to make a decision of how you want to deal with the changes caused by Arduino's upgrade to avrdude 6.3. In addition to the unlock/lock_bits values issue you encountered, which doesn't occur with all programmers. There is also a problem with the extended_fuses value: https://github.com/arduino/Arduino/issues/5175. I see two choices:
  • Drop support for previous Arduino AVR Boards versions. Change your unlock_bits, lock_bits, and extended_fuses values to be compatible with Arduino AVR Boards 1.6.13 and note in the documentation that any previous version is not supported.
  • Add avrdude tool and avrdude.conf. This will allow compatibility with all Arduino AVR Boards versions because your boards file will always be using the avrdude version it was written for. The disadvantage is this will increase the complexity of your project and make the install size larger. If you want to include all avrdude versions for one download manual installation it will add 10 MB. You could also add instructions for the user to download and install the correct version of avrdude for their OS but this will make installation more complicated. Boards Manager installation makes this a bit better because it will automatically detect the OS and install only the correct avrdude version but it's some work adding Boards Manager support.

Go Up