4
\$\begingroup\$

Two parts:

  1. Is it possible to write an Arduino Bootloader for a Tiny AVR?

  2. Is it worthwhile to write a Arduino Bootloader for an Tiny AVR? (more subjective, contingent on 1)

Regards, Vic

\$\endgroup\$
4
\$\begingroup\$

It's not worthwhile to write a new one. There are plenty of existing serial bootloaders for the Tiny AVR and it would be pretty trivial to port the actual Arduino bootloader. It's not even necessary to speak the same protocol to work with the Arduino environment. The Arduino IDE can be configured to upload to any programmer supported by avrdude.

\$\endgroup\$
4
\$\begingroup\$

I would say it worthwhile if for no other reason as an educational experience. Just because a chip has a default or popular bootloader doesnt make it good or mean you have to use it. If you have never written one I would highly recommend it, if nothing else modify the existing/popular one.

Now saying that, it is best to do this on a platform where you have a recovery path. So boards/devices where you have a jtag interface and experience using that jtag are preferred. Or to just get through inventing/using a protocol, have the default bootloader launch your (secondary) bootloader and work through the bootloader/programmer experience (using the original bootloader as your recover path). But there is another half to the problem that you wont get, and that is the chip initialisation stuff, and that can be difficult to get right and takes many iterations (and most of those iterations result in a nonfunctional bootloader requiring the backdoor recovery path).

The arduino in particular suffered from the transition from 32 to 64 bit (on the host) for a while there so the choice was to change my day to day habits for this board, or step out of the sandbox and do my own thing with this board? You find this very often in the microcontroller or eval board world, the canned sandboxes are usually windows first then maybe mac and then sometimes linux. Even today pre-vista or pre windows 7 works but you may not have access to those on your development machine, may not want or be able to buy a copy just to play with a $20 toy. Linux is usually the last host environment supported, so I often find myself writing a bootloader, using windows or whatever briefly, to load it then I can work in an environment I am more comfortable with to continue to use or evaluate the product. In the case of the arduino it was easier to write a programmer that worked with the existing bootloader on the current Linux than to write a new or modified bootloader using an older or 32 bit linux or windows. For the devices that have well designed built in bootloaders either in hardware or in a protected flash, it is often better to replace the programmer than the bootloader. Which is is part of the bootloader development process anyway, so here again an educational experience as well as sometimes a practical solution.

The corollary to your question is Am I forced to use the IDE/sandbox provided with an eval or developer board, or can I use other tools or create my own? Do I have to use such and such library to do something or can I write and use my own?

\$\endgroup\$
  • \$\begingroup\$ Huh...as a Mac user, it's been my experience that it's Windows first, Linux second, and Mac third (if ever). \$\endgroup\$ – Kevin Vermeer May 23 '11 at 13:25
3
\$\begingroup\$

There is no need to use a IDE like arduino, to use avr's. look at avr-gcc + isp. you can program the avr in c like arduino, but without the overhead and need for a bootloader.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.