4
\$\begingroup\$

In the Arduino IDE, what exactly happens when you choose the 'upload with programmer' option to program via a AVR programmer instead of the USB cable? Does it upload just your program, or does it include the bootloader too? If i previously uploaded the bootloader will it still be there, or does it get overridden? Does it set the fusebits during this process?

Toby Jaffey
29k19 gold badges99 silver badges151 bronze badges
asked Feb 20, 2012 at 2:52
\$\endgroup\$
1

2 Answers 2

1
\$\begingroup\$

These answers apply to only the general case - I haven't used the Arduino IDE.

  • Does it upload just your program or does it include the bootloader too?

Just your program - bootloader will be overwritten unless someone made an effort to relocate where the image will be programmed in flash. The Arduino IDE may do this but if you find that after you used the 'upload with programmer' option you can't talk to the board any other way, then the programer may have wiped out the bootloader.

Generally fusebits are not set during normal programming. You have to specify that option. Again, the Arduino IDE may have its own tricks, but generally you have to explicitly request the fuse bits be programmed.

answered Feb 20, 2012 at 12:52
\$\endgroup\$
1
  • \$\begingroup\$ This was kinda what I was thinking. I was thinking that I couldn't program via USB because the bootloader may have been overwritten, but I bricked the controller before I was able to test further. A loose wire interupped the programming, and the controller stopped responding to the programmer, which is why I asked about the fuse bits. \$\endgroup\$ Commented Feb 21, 2012 at 0:50
0
\$\begingroup\$

the usb interface on an arduino gets you at the avr serial port, where you need a bootloader, etc. Using the ISP interface or whatever they call it (I think it is SPI) you can take over the chip and reload the bootloader (might have fuse limitations). I assume that depends on the binary you are loading and where it wants to load.

The bootloader protocol is often referred to some standard protocol (within the avr world), but if you actually look at the bootloader source (quite easy to read and follow) you find that most of the bootloaders barely support that protocol and each incarnation has its own features. I find it easier to just look at the protocol used by the bootloader and not spend much time outside that.

As far as the other programming interfaces the xmega has an interesting interface, pdi which is not hard to use, and there is the spi interface the other smaller avr devices uses. both are documented with the chips themselves.

answered Feb 20, 2012 at 15:45
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.