Go Down

Topic: Bootloader needs to be loaded everytime?? (Read 1 time) previous topic - next topic

We've been using Arduinos for quick prototyping and development at work. On our designs I notice that the bootloader has to be burned in after every compile with my MKII and AVR studio. I read some threads about situations similar to this but is everytime on several different arduinos. I was wondering if someone knew what causes this issue?

retrolefty

#1
Feb 25, 2011, 01:50 am Last Edit: Feb 25, 2011, 01:52 am by retrolefty Reason: 1

We've been using Arduinos for quick prototyping and development at work. On our designs I notice that the bootloader has to be burned in after every compile with my MKII and AVR studio. I read some threads about situations similar to this but is everytime on several different arduinos. I was wondering if someone knew what causes this issue?


My guess is that the fuse settings are not being setup correctly for bootloading operation in AVR studio. The correct values for the fuse settings for all the various arduino boards can be found in the boards.txt file in the Arduino core directory. Here is where mine is located:

Quote
C:\Documents and Settings\Primary Windows User\My Documents\My Programs\Arduino\arduino-0022\hardware\arduino

3 Folders:

bootloaders
cores
firmwares


2 Files:

boards.txt
programmers.txt


And here is the listing for one common arduino board showing fuse settings:

Quote
##############################################################

atmega328.name=Arduino Duemilanove or Nano w/ ATmega328

atmega328.upload.protocol=stk500
atmega328.upload.maximum_size=30720
atmega328.upload.speed=57600

atmega328.bootloader.low_fuses=0xFF
atmega328.bootloader.high_fuses=0xDA
atmega328.bootloader.extended_fuses=0x05
atmega328.bootloader.path=atmega
atmega328.bootloader.file=ATmegaBOOT_168_atmega328.hex
atmega328.bootloader.unlock_bits=0x3F
atmega328.bootloader.lock_bits=0x0F
atmega328.build.mcu=atmega328p
atmega328.build.f_cpu=16000000L
atmega328.build.core=arduino

##############################################################


Lefty


So I changed the fuses to what it says in boards.txt but it won't program them. I get this error.


Entering programming mode.. OK!
Writing fuses address 0 to 2.. 0xFF, 0xDA, 0x05 .. OK!
Reading fuses address 0 to 2.. 0xFF, 0xDA, 0xFD .. OK!

WARNING: Fuse bits verification..  FAILED
Leaving programming mode.. OK!

The other way it works runs my program. I'm just tired of programming a bootloader every single time.

Coding Badly

Have you tried burning the bootloader using the Arduino IDE and your MKII?

I just tried that. I get this error.

Error while burning bootloader.
avrdude: usbdev_open(): did not find any USB device "usb"


I'm guessing there is some kind of configuration in arduino for this somewhere. Any ideas?

westfw

Quote
I notice that the bootloader has to be burned in after every compile with my MKII and AVR studio.

I think this is normal.  If you're programming the device using a "real programmer" instead of the bootloader, a "full chip erase" is usually part of the programming procedure, and that will erase the bootloader as well as any other previous sketch.

I believe this is required.  Locations need to be erased (at least one page at a time) before they can be programmed, and External programming doesn't have access to a single-page-erase command like the self-programming uses from the bootloader.  So you have to erase the entire chip unless you KNOW that the pages you are programming are already erased...

Well, I'm burning in the bootloader with AVR studio, but the sketches I've been loading up the Arduino environment. I only use the MKII because the usb bub isn't loading the bootloader. I did some reading and found that the usb drivers for the MKII have to be uninstalled to install the drivers to use it with Arduino environment. I want to keep it installed for Studio. I am wondering why I can't get the fuses to program to what they are in boards.txt though. ???

Tried it again today. When I try to burn the fuses that are in the boards.txt file it fails to burn them to my chip. Has anyone had this happen? If so, do you think it is the reason I constantly have to burn the bootloader?

Ok, now I have another board that is built in a very similar way and this one does not require the bootloader each time. Same fuses and everything. I believe it has to be something in the hardware.

Go Up