Hacking.Bootloader History

Hide minor edits - Show changes to markup

June 02, 2010, at 07:09 PM by Equipo Traduccion -
Changed lines 1-8 from:

Desarrollo del Bootloader.

¿Que es un bootloader?

Vea esta página para una explicación mas completa de que es un bootloader y por que necesitamos usar uno.

Uso sin bootloader.

to:

Desarrollo del gestor de arranque.

¿Que es un gestor de arranque?

Vea esta página para una explicación mas completa de que es un gestor de arranque y por que necesitamos usar uno.

Uso sin gestor de arranque.

Changed lines 11-20 from:

Grabando el Bootloader.

Para grabar un bootloader necesitaras comprar un AVR-ISP ( programador "in-system" ), USBtinyISP o construir un programador paralelo. El programador se puede conectar la los pines ICSP ( las 2 filas de 3 pines ) - Asegurate de de conectarlo de la forma correcta. La placa debe ser alimentada por una fuente de energía externa o directamente por un cable USB.

También debes asegurarte de tener correctamente seleccionada la opción correcta en el menú Tools | Board. Por último solo hay que lanzar el comando apropiado desde el menú Tools > Burn Bootloader del Arduino IDE. Grabar un bootloader puede durar 15 segundos o más, así que se paciente.

Grabando el Bootloader en una Arduino Mini.

Aquí están las instrucciones para grabar el bootloader, gracias a Gian Pablo Vilamil.

to:

Grabando el gestor de arranque.

Para grabar un gestor de arranque necesitaras comprar un AVR-ISP ( programador "in-system" ), USBtinyISP o construir un programador paralelo. El programador se puede conectar la los pines ICSP ( las 2 filas de 3 pines ) - Asegurate de de conectarlo de la forma correcta. La placa debe ser alimentada por una fuente de energía externa o directamente por un cable USB.

También debes asegurarte de tener correctamente seleccionada la opción correcta en el menú Tools | Board. Por último solo hay que lanzar el comando apropiado desde el menú Tools > Burn Bootloader del Arduino IDE. Grabar un gestor de arranque puede durar 15 segundos o más, así que se paciente.

Grabando el gestor de arranque en una Arduino Mini.

Aquí están las instrucciones para grabar el gestor de arranque, gracias a Gian Pablo Vilamil.

Changed lines 23-24 from:

Windows XP puede causar problemas en el puerto paralelo e interrumpir el proceso de grabado del bootloader. Necesitas este parche:

to:

Windows XP puede causar problemas en el puerto paralelo e interrumpir el proceso de grabación del gestor de arranque. Necesitas este parche:

Changed lines 32-39 from:

Versiones del bootloader.

Hay diferentes versiones del bootloader para trabajar sobre dispositivos diferentes o por que han cambiado a lo largo del tiempo.

Los bootloaders actuales ( p. e. el incluido en la versión Arduino 0009) son prácticamente idénticos para la Diecimila y la NG (con ATmega168). Ambos corren a 19200 baudios y ocupan unos 2 KB de memoria flash en el ATmega168. La única diferencia está en el tiempo que el bootloader espera para que un nuevo programa llegue y el numero de destellos que emite el LED del pin 13 cuando arranca. Por que en el reset automático en la Diecimila este bootloader necesita muy poco tiempo de espera, menos de un segundo, y para ahorrar tiempo el LED del pin 13 solo destella una vez. El bootloader de la NG espera de 6 a 8 segundos y el LED del pin 13 destella 3 veces.

El gestor de arranque que actualmente carga la Arduino NG es ligeramente diferente. Este activa la resistencia interna pullup en el pin RX. Tampoco espera después de recibir datos no validos, así que si le envías datos inmediatamente después de que se resetee tu sketch nunca se ejecutará.

to:

Versiones del gestor de arranque.

Hay diferentes versiones del gestor de arranque para trabajar sobre dispositivos diferentes o por que han cambiado a lo largo del tiempo.

Los gestores de arranque actuales ( p. e. el incluido en la versión Arduino 0009) son prácticamente idénticos para la Diecimila y la NG (con ATmega168). Ambos corren a 19200 baudios y ocupan unos 2 KB de memoria flash en el ATmega168. La única diferencia está en el tiempo que el gestor de arranque espera para que un nuevo programa llegue y el numero de destellos que emite el LED del pin 13 cuando arranca. Por que en el reseto automático de la Diecimila este gestor de arranque emplea muy poco tiempo de espera, menos de un segundo, y para ahorrar tiempo el LED del pin 13 solo destella una vez. El gestor de arranque de la NG espera de 6 a 8 segundos y el LED del pin 13 destella 3 veces.

El gestor de arranque que actualmente carga la Arduino NG es ligeramente diferente. Este activa la resistencia interna pull-up en el pin RX. Tampoco espera después de recibir datos no validos, así que si le envías datos inmediatamente después de que se resetee tu sketch nunca se ejecutará.

Changed lines 42-45 from:

El bootloader del ATmega8 sólo ocupa 1 KB de memoria flash. Este tampoco espera después de recibir datos no validos, necesitas estar seguro de que no le envías nada durante los 6 u 8 segundos que tarda en ejecutarse.

Algunas versines antiguas del bootloader funcionan a 9600 baudios (en lugar de 19200). Para asegurarnos el éxito a la hora de cargar sketches con este gestor de arranque necesitamos cambiar el valor del parametro serial.download_rate en el archivo preferencias a 9600.

to:

El gestor de arranque del ATmega8 sólo ocupa 1 KB de memoria flash. Este tampoco espera después de recibir datos no validos, necesitas estar seguro de que no le envías nada durante los 6 u 8 segundos que tarda en ejecutarse.

Algunas versiones antiguas del gestor de arranque funcionan a 9600 baudios (en lugar de 19200). Para asegurarnos el éxito a la hora de cargar sketches con este gestor de arranque necesitamos cambiar el valor del parámetro serial.download_rate en el archivo preferencias a 9600.

Changed lines 50-54 from:

Los comandos "Burn Bootloader" en el entorno Arduino utilizan una herramienta open-source, avrdude. Hay cuatro pasos: desbloquear la sección del gestor de arranque en el chip, fijar los fusibles en el chip, subir el código del gestor de arranque al chip y bloquear la sección del gestor de arranque en el chip. Esto está controlado por determinados parametros del archivo de preferencias.

Para el bootloader del ATmega8 son:

to:

Los comandos "Burn Bootloader" en el entorno Arduino utilizan una herramienta open-source, avrdude. Hay cuatro pasos: desbloquear la sección del gestor de arranque en el chip, fijar los fusibles en el chip, subir el código del gestor de arranque al chip y bloquear la sección del gestor de arranque en el chip. Esto está controlado por determinados parámetros del archivo de preferencias.

Para el gestor de arranque del ATmega8 son:

Changed lines 63-64 from:
  • bootloader.atmega8.path (valor por defecto: bootloader) es el subdirectorio (relativo al directorio en que se encuentra la aplicación Arduino) que contiene el bootloader precompilado.
to:
  • bootloader.atmega8.path (valor por defecto: bootloader) es el subdirectorio (relativo al directorio en que se encuentra la aplicación Arduino) que contiene el gestor de arranque precompilado.
June 01, 2010, at 01:55 AM by Equipo Traduccion -
Changed lines 70-90 from:

For the ATmega168, these are (where <BOARD> is either "diecimila" or "ng"):

  • bootloader.atmega168-<BOARD>.programmer (default value: avrispmkii) is the protocal used by the bootloader.

  • bootloader.atmega168-<BOARD>.unlock_bits (default value: 0x3F) is the value to write to the ATmega168 lock byte to unlock the bootloader section.

  • bootloader.atmega168-<BOARD>.extended_fuses (default value: 0x00) is the value to write to the high byte of the ATmega168 fuses.

  • bootloader.atmega168-<BOARD>.high_fuses (default value: 0xdd) is the value to write to the high byte of the ATmega168 fuses.

  • bootloader.atmega168-<BOARD>.low_fuses (default value: 0xff) is the value to write to the low byte of the ATmega168 fuses.

  • bootloader.atmega168-<BOARD>.path (default value: bootloader168) is the path (relative to the Arduino application directory) containing the precompiled bootloader.

  • bootloader.atmega168-<BOARD>.file (default value: ATmegaBOOT_168_<BOARD>.hex) is the name of the file containing the precompiled bootloader code (in bootloader.path).

  • bootloader.atmega168-<BOARD>.lock_bits (default value: 0x0F) is the value to write to the ATmega168 lock byte to lock the bootloader section (so it doesn't get accidently overwritten when you upload a sketch).

Source Code

The bootloader source code is available.

to:

Para el ATmega168, estos son (donde <BOARD> es según corresponda "diecimila" o "ng"):

  • bootloader.atmega168-<BOARD>.programmer (valor por defecto: avrispmkii) es el protocolo usado por el bootloader.

  • bootloader.atmega168-<BOARD>.unlock_bits (valor por defecto: 0x3F) es el valor para escribir en el ATmega168 un byte de bloqueo para desbloquear la sección del gestor de arranque.

  • bootloader.atmega168-<BOARD>.extended_fuses (valor por defecto: 0x00) es el valor para escribir un byte alto en los fusibles del ATmega168.

  • bootloader.atmega168-<BOARD>.high_fuses (valor por defecto: 0xdd) es el valor para escribir un byte alto en los fusibles del ATmega168.

  • bootloader.atmega168-<BOARD>.low_fuses (valor por defecto: 0xff) es el valor para escribir un byte bajo en los fusibles del ATmega168.

  • bootloader.atmega168-<BOARD>.path (valor por defecto: bootloader168) es el subdirectorio (relativo al directorio de la aplicación Arduino) que contiene el gestor de arranque precompilado.

  • bootloader.atmega168-<BOARD>.file (valor por defecto: ATmegaBOOT_168_<BOARD>.hex) es el nombre del fichero que contiene el bootloader precompilado (en bootloader.path).

  • bootloader.atmega168-<BOARD>.lock_bits (valor por defecto: 0x0F) es el valor para escribir en el ATmega168 un byte de bloqueo en la sección del gestor de arranque (para no escribir sobre ella por error al grabar un sketch).

Código fuente.

El código fuente del gestor de arranque.

June 01, 2010, at 01:37 AM by Equipo Traduccion -
Changed lines 48-67 from:

How does it work?

The "Burn Bootloader" commands in the Arduino environment use an open-source tool, avrdude. There are four steps: unlocking the bootloader section of the chip, setting the the fuses on the chip, uploading the bootloader code to the chip, and locking the bootloader section of the chip. These are controlled by a number of preferences in the Arduino preferences file.

For the ATmega8 bootloader, these are:

  • bootloader.atmega8.programmer (default value: stk500) is the protocal used by the bootloader.

  • bootloader.atmega8.unlock_bits (default value: 0xFF) is the value to write to the ATmega8 lock byte to unlock the bootloader section.

  • bootloader.atmega8.high_fuses (default value: 0xca) is the value to write to the high byte of the ATmega8 fuses.

  • bootloader.atmega8.low_fuses (default value: 0xdf) is the value to write to the low byte of the ATmega8 fuses.

  • bootloader.atmega8.path (default value: bootloader) is the path (relative to the Arduino application directory) containing the precompiled bootloader.

  • bootloader.atmega8.file (default value: ATmegaBOOT.hex) is the name of the file containing the precompiled bootloader code (in bootloader.path).

  • bootloader.atmega8.lock_bits (default value: 0x0F) is the value to write to the ATmega8 lock byte to lock the bootloader section (so it doesn't get accidently overwritten when you upload a sketch).
to:

¿Como trabaja?.

Los comandos "Burn Bootloader" en el entorno Arduino utilizan una herramienta open-source, avrdude. Hay cuatro pasos: desbloquear la sección del gestor de arranque en el chip, fijar los fusibles en el chip, subir el código del gestor de arranque al chip y bloquear la sección del gestor de arranque en el chip. Esto está controlado por determinados parametros del archivo de preferencias.

Para el bootloader del ATmega8 son:

  • bootloader.atmega8.programmer (valor por defecto: stk500) es el protocolo usado por el gestor de arranque.

  • bootloader.atmega8.unlock_bits (valor por defecto: 0xFF) es el valor para escribir en el ATmega8 un byte de bloqueo para desbloquear la sección del gestor de arranque.

  • bootloader.atmega8.high_fuses (valor por defecto: 0xca) escribe un byte alto en los fusibles del ATmega8.

  • bootloader.atmega8.low_fuses (valor por defecto: 0xdf) escribe un byte bajo en los fusibles del ATmega8.

  • bootloader.atmega8.path (valor por defecto: bootloader) es el subdirectorio (relativo al directorio en que se encuentra la aplicación Arduino) que contiene el bootloader precompilado.

  • bootloader.atmega8.file (valor por defecto: ATmegaBOOT.hex) es el nombre del fichero que contiene el código precompilado del gestor de arranque (en bootloader.path).

  • bootloader.atmega8.lock_bits (valor por defecto: 0x0F) es el valor para escribir un byte de bloqueo para la sección del gestor de arranque del ATmega8 (para no sobreescribir accidentalmente sobre ella al grabar un sketch).

June 01, 2010, at 01:10 AM by Equipo Traduccion -
Changed lines 36-49 from:

Los bootloaders actuales ( p. e. el incluido en la versión Arduino 0009) son prácticamente idénticos para la Diecimila y la NG (con ATmega168). Ambos corren a 19200 baudios y ocupan unos 2 KB de memoria flash en el ATmega168. La única diferencia está en el tiempo que el bootloader espera para que un nuevo programa llegue y el numero de destellos que emite el LED del pin 13 cuando arranca. Por que el reset automático en la Diecimila, este bootloader

  The only differences is the time the bootloader waits for a new program to arrive and the number of times it flashes the pin 13 LED when it starts.  Because of the automatic reset on the Diecimila, its bootloader needs only wait a very short amount of time (less than a second) - to save time, it also flashes the pin 13 LED only once.  The NG bootloader waits about 6-8 seconds and flashes the LED three times.

The bootloader that actually shipped on the Arduino NG is slightly different. It enables the internal pullup resistor on pin 6, and doesn't enable the internal pullup on the RX pin. Nor does it timeout upon receiving invalid data, so if you send data to it immediately after it resets, your sketch will never start.

The Arduino BT bootloader does some initial configuration of the bluetooth module.

The ATmega8 bootloader only takes up 1 KB of flash. It does not timeout when it receives invalid data, you need to make sure that no data is sent to the board during the 6-8 seconds when the bootloader is running.

Some ancient versions of the bootloader run at 9600 baud (instead of 19200). In order to successfully upload sketches to boards with this bootloader, you'll need to change the serial.download_rate in your preferences file to 9600.

Third parties have also worked on the bootloader. This page is link to some other bootloader development

to:

Los bootloaders actuales ( p. e. el incluido en la versión Arduino 0009) son prácticamente idénticos para la Diecimila y la NG (con ATmega168). Ambos corren a 19200 baudios y ocupan unos 2 KB de memoria flash en el ATmega168. La única diferencia está en el tiempo que el bootloader espera para que un nuevo programa llegue y el numero de destellos que emite el LED del pin 13 cuando arranca. Por que en el reset automático en la Diecimila este bootloader necesita muy poco tiempo de espera, menos de un segundo, y para ahorrar tiempo el LED del pin 13 solo destella una vez. El bootloader de la NG espera de 6 a 8 segundos y el LED del pin 13 destella 3 veces.

El gestor de arranque que actualmente carga la Arduino NG es ligeramente diferente. Este activa la resistencia interna pullup en el pin RX. Tampoco espera después de recibir datos no validos, así que si le envías datos inmediatamente después de que se resetee tu sketch nunca se ejecutará.

El gestor de arranque del Arduino BT hace una configuración inicial del módulo bluetooth.

El bootloader del ATmega8 sólo ocupa 1 KB de memoria flash. Este tampoco espera después de recibir datos no validos, necesitas estar seguro de que no le envías nada durante los 6 u 8 segundos que tarda en ejecutarse.

Algunas versines antiguas del bootloader funcionan a 9600 baudios (en lugar de 19200). Para asegurarnos el éxito a la hora de cargar sketches con este gestor de arranque necesitamos cambiar el valor del parametro serial.download_rate en el archivo preferencias a 9600.

Terceras partes han hecho modificaciones en el gestor de arranque. Esta página contiene enlaces a algunos de ellos.

June 01, 2010, at 12:42 AM by Equipo Traduccion -
Changed lines 17-24 from:

Bootloading an Arduino Mini

Here are some instructions on bootloading the Mini, thanks to Gian Pablo Vilamil.

It still doesn't work! (parallel programmer on Windows XP)

Windows XP may be polling your parallel port and disrupting the bootloader burning process. You'll need this registry patch:

to:

Grabando el Bootloader en una Arduino Mini.

Aquí están las instrucciones para grabar el bootloader, gracias a Gian Pablo Vilamil.

Esto todavía no funciona! (programador paralelo con Windows XP).

Windows XP puede causar problemas en el puerto paralelo e interrumpir el proceso de grabado del bootloader. Necesitas este parche:

Changed lines 30-37 from:

See this forum thread for details.

Versions of the bootloader

There are different versions of the bootloader - both in order to work on different hardware and because it has changed over time.

The current bootloaders (i.e. the ones included in Arduino 0009) are almost identical for the Diecimila and NG (with ATmega168). They both run at 19200 baud and take up 2 KB of flash memory on the ATmega168. The only differences is the time the bootloader waits for a new program to arrive and the number of times it flashes the pin 13 LED when it starts. Because of the automatic reset on the Diecimila, its bootloader needs only wait a very short amount of time (less than a second) - to save time, it also flashes the pin 13 LED only once. The NG bootloader waits about 6-8 seconds and flashes the LED three times.

to:

Mira en este hilo del foro para mas detalles.

Versiones del bootloader.

Hay diferentes versiones del bootloader para trabajar sobre dispositivos diferentes o por que han cambiado a lo largo del tiempo.

Los bootloaders actuales ( p. e. el incluido en la versión Arduino 0009) son prácticamente idénticos para la Diecimila y la NG (con ATmega168). Ambos corren a 19200 baudios y ocupan unos 2 KB de memoria flash en el ATmega168. La única diferencia está en el tiempo que el bootloader espera para que un nuevo programa llegue y el numero de destellos que emite el LED del pin 13 cuando arranca. Por que el reset automático en la Diecimila, este bootloader

  The only differences is the time the bootloader waits for a new program to arrive and the number of times it flashes the pin 13 LED when it starts.  Because of the automatic reset on the Diecimila, its bootloader needs only wait a very short amount of time (less than a second) - to save time, it also flashes the pin 13 LED only once.  The NG bootloader waits about 6-8 seconds and flashes the LED three times.
June 01, 2010, at 12:16 AM by Equipo Traduccion -
Changed lines 1-16 from:

Bootloader Development

What's a bootloader?

See this page for an explanation of what a bootloader is and why we're using one.

Not using a bootloader

If you want to use the full program space (flash) of the chip or avoid the bootloader delay, you can burn your sketches using an external programmer.

Burning the Bootloader

To burn the bootloader, you'll need to buy an AVR-ISP (in-system programmer), USBtinyISP or build a ParallelProgrammer. The programmer should be connected to the ICSP pins (the 2 by 3 pin header) - make sure you plug it in the right way. The board must be powered by an external power supply or the USB port.

Make sure you have the right item selected in the Tools | Board menu. Then, just launch the appropriate command from the Tools > Burn Bootloader menu of the Arduino environment. Burning the bootloader may take 15 seconds or more, so be patient.

to:

Desarrollo del Bootloader.

¿Que es un bootloader?

Vea esta página para una explicación mas completa de que es un bootloader y por que necesitamos usar uno.

Uso sin bootloader.

Si quieres utilizar el total de la memoria disponible para tus programas o evitar el retraso que se produce al encender la placa puedes utilizar cargar tus sketches utilizando un programador externo.

Grabando el Bootloader.

Para grabar un bootloader necesitaras comprar un AVR-ISP ( programador "in-system" ), USBtinyISP o construir un programador paralelo. El programador se puede conectar la los pines ICSP ( las 2 filas de 3 pines ) - Asegurate de de conectarlo de la forma correcta. La placa debe ser alimentada por una fuente de energía externa o directamente por un cable USB.

También debes asegurarte de tener correctamente seleccionada la opción correcta en el menú Tools | Board. Por último solo hay que lanzar el comando apropiado desde el menú Tools > Burn Bootloader del Arduino IDE. Grabar un bootloader puede durar 15 segundos o más, así que se paciente.

October 15, 2009, at 03:39 PM by David A. Mellis -
Changed line 88 from:

The bootloader source code is available.

to:

The bootloader source code is available.

March 25, 2009, at 04:52 PM by David A. Mellis -
Changed lines 66-67 from:
  • bootloader.atmega8.lock_bits (default value: 0xCF) is the value to write to the ATmega8 lock byte to lock the bootloader section (so it doesn't get accidently overwritten when you upload a sketch).
to:
  • bootloader.atmega8.lock_bits (default value: 0x0F) is the value to write to the ATmega8 lock byte to lock the bootloader section (so it doesn't get accidently overwritten when you upload a sketch).
February 14, 2008, at 04:26 AM by David A. Mellis -
Added lines 3-4:

What's a bootloader?

February 14, 2008, at 04:24 AM by David A. Mellis -
Changed lines 3-4 from:

See Bootloader for an explanation of what a bootloader is and why we're using one.

to:

See this page for an explanation of what a bootloader is and why we're using one.

February 14, 2008, at 04:23 AM by David A. Mellis -
Changed lines 1-10 from:

Bootloader

The bootloader is a small piece of software that we've burned onto the chips that come with your Arduino boards. It allows you to upload sketches to the board without external hardware.

When you reset the Arduino board, it runs the bootloader (if present). The bootloader pulses digital pin 13 (you can connect an LED to make sure that the bootloader is installed). The bootloader then listens for commands or data to arrive from the the computer. Usually, this is a sketch that the bootloader writes to the flash memory on the ATmega168 or ATmega8 chip. Then, the bootloader launches the newly-uploaded program. If, however, no data arrives from the computer, the bootloader launches whatever program was last uploaded onto the chip. If the chip is still "virgin" the bootloader is the only program in memory and will start itself again.

Why are we using a bootloader?

The use of a bootloader allows us to avoid the use of external hardware programmers. (Burning the bootloader onto the chip, however, requires one of these external programmers.)

to:

Bootloader Development

See Bootloader for an explanation of what a bootloader is and why we're using one.

January 25, 2008, at 11:58 PM by David A. Mellis -
Changed lines 54-55 from:

The "Burn Bootloader" commands in the Arduino environment use an open-source tool, avrdude. There are four steps: unlocking the bootloader section of the chip, setting the the fuses on the chip, uploading the bootloader code to the chip, and locking the bootloader section of the chip. These are controlled by a number of preferences in the Arduino [[Preferences | preferences file].

to:

The "Burn Bootloader" commands in the Arduino environment use an open-source tool, avrdude. There are four steps: unlocking the bootloader section of the chip, setting the the fuses on the chip, uploading the bootloader code to the chip, and locking the bootloader section of the chip. These are controlled by a number of preferences in the Arduino preferences file.

January 04, 2008, at 05:06 PM by David A. Mellis -
Changed lines 5-6 from:

When you reset the Arduino board, it runs the bootloader (if present). The bootloader pulses digital pin 13 (you can connect an LED to make sure that the bootloader is installed). The bootloader then waits a few seconds for commands or data to arrive from the the computer. Usually, this is a sketch that the bootloader writes to the flash memory on the ATmega8 chip. A few seconds later, the bootloader launches the newly-uploaded program. If no data arrives from the computer, the bootloader launches whatever program was last uploaded onto the chip. If the chip is still "virgin" the bootloader is the only program in memory and will start itself again.

to:

When you reset the Arduino board, it runs the bootloader (if present). The bootloader pulses digital pin 13 (you can connect an LED to make sure that the bootloader is installed). The bootloader then listens for commands or data to arrive from the the computer. Usually, this is a sketch that the bootloader writes to the flash memory on the ATmega168 or ATmega8 chip. Then, the bootloader launches the newly-uploaded program. If, however, no data arrives from the computer, the bootloader launches whatever program was last uploaded onto the chip. If the chip is still "virgin" the bootloader is the only program in memory and will start itself again.

Changed lines 17-20 from:

To burn the bootloader, you'll need to buy an AVR-ISP (in-system programmer) or build a ParallelProgrammer. The programmer should be connected to the ICSP pins (the 2 by 3 pin header) - make sure you plug it in the right way. The board must be powered by an external power supply or the USB port.

Make sure you have the right item selected in the Tools | Microcontroller menu (it should match the chip on your Arduino board). Then, just launch the appropriate command from the Tools menu of the Arduino environment. Burning the bootloader may take 15 seconds or more, so be patient.

to:

To burn the bootloader, you'll need to buy an AVR-ISP (in-system programmer), USBtinyISP or build a ParallelProgrammer. The programmer should be connected to the ICSP pins (the 2 by 3 pin header) - make sure you plug it in the right way. The board must be powered by an external power supply or the USB port.

Make sure you have the right item selected in the Tools | Board menu. Then, just launch the appropriate command from the Tools > Burn Bootloader menu of the Arduino environment. Burning the bootloader may take 15 seconds or more, so be patient.

January 04, 2008, at 12:25 AM by Tom Igoe -
Added lines 21-24:

Bootloading an Arduino Mini

Here are some instructions on bootloading the Mini, thanks to Gian Pablo Vilamil.

October 16, 2007, at 05:17 PM by David A. Mellis - updating link to source code
Changed line 88 from:

The bootloader source code is available: ATmega8, ATmega168

to:

The bootloader source code is available.

October 04, 2007, at 07:51 PM by Paul Badger -
Changed lines 46-47 from:

Third parties have also worked on the bootloader. This page is link to some other bootloader development?

to:

Third parties have also worked on the bootloader. This page is link to some other bootloader development

October 04, 2007, at 07:50 PM by Paul Badger -
Changed lines 46-47 from:

Third parties have also worked on the bootloader. This page is link to some other bootloader development?

to:

Third parties have also worked on the bootloader. This page is link to some other bootloader development?

October 04, 2007, at 07:50 PM by Paul Badger -
Changed lines 46-47 from:

Third parties have also worked on the bootloader. This page is link to some other bootloader development?

to:

Third parties have also worked on the bootloader. This page is link to some other bootloader development?

October 04, 2007, at 07:46 PM by Paul Badger -
October 04, 2007, at 07:43 PM by Paul Badger -
Changed lines 46-47 from:

Third parties have also worked on the bootloader. This page is link to some other bootloader development?

to:

Third parties have also worked on the bootloader. This page is link to some other bootloader development?

October 04, 2007, at 07:42 PM by Paul Badger -
Changed lines 46-47 from:

Third parties have also worked on the bootloader. This page is link to some other bootloader development?

to:

Third parties have also worked on the bootloader. This page is link to some other bootloader development?

October 04, 2007, at 07:41 PM by Paul Badger -
Added lines 46-47:

Third parties have also worked on the bootloader. This page is link to some other bootloader development?

August 13, 2007, at 06:29 PM by David A. Mellis - switching to viewcvs for bootloader source links (since it allows downloads)
Changed line 86 from:

The bootloader source code is available: ATmega8, ATmega168

to:

The bootloader source code is available: ATmega8, ATmega168

August 07, 2007, at 06:05 PM by David A. Mellis -
Changed lines 32-35 from:

Note for older boards.

Newer versions of the bootloader communicate with the computer at 19200 baud; older versions use 9600 baud. In order to successfully upload programs to the board, this rate needs to match the serial.download_rate in your preferences file (which defaults to 19200).

to:

Versions of the bootloader

There are different versions of the bootloader - both in order to work on different hardware and because it has changed over time.

The current bootloaders (i.e. the ones included in Arduino 0009) are almost identical for the Diecimila and NG (with ATmega168). They both run at 19200 baud and take up 2 KB of flash memory on the ATmega168. The only differences is the time the bootloader waits for a new program to arrive and the number of times it flashes the pin 13 LED when it starts. Because of the automatic reset on the Diecimila, its bootloader needs only wait a very short amount of time (less than a second) - to save time, it also flashes the pin 13 LED only once. The NG bootloader waits about 6-8 seconds and flashes the LED three times.

The bootloader that actually shipped on the Arduino NG is slightly different. It enables the internal pullup resistor on pin 6, and doesn't enable the internal pullup on the RX pin. Nor does it timeout upon receiving invalid data, so if you send data to it immediately after it resets, your sketch will never start.

The Arduino BT bootloader does some initial configuration of the bluetooth module.

The ATmega8 bootloader only takes up 1 KB of flash. It does not timeout when it receives invalid data, you need to make sure that no data is sent to the board during the 6-8 seconds when the bootloader is running.

Some ancient versions of the bootloader run at 9600 baud (instead of 19200). In order to successfully upload sketches to boards with this bootloader, you'll need to change the serial.download_rate in your preferences file to 9600.

Changed lines 48-49 from:

A precompiled bootloader (.hex file) comes with the Arduino environment; it communicates at 19200 baud (but see the note for older boards above). The "Burn Bootloader" commands in the Arduino environment use an open-source tool, avrdude. There are four steps: unlocking the bootloader section of the chip, setting the the fuses on the chip, uploading the bootloader code to the chip, and locking the bootloader section of the chip. These are controlled by a number of preferences in the Arduino [[Preferences | preferences file].

to:

The "Burn Bootloader" commands in the Arduino environment use an open-source tool, avrdude. There are four steps: unlocking the bootloader section of the chip, setting the the fuses on the chip, uploading the bootloader code to the chip, and locking the bootloader section of the chip. These are controlled by a number of preferences in the Arduino [[Preferences | preferences file].

August 07, 2007, at 04:07 AM by David A. Mellis -
Changed lines 19-20 from:

Then, just launch the "Burn Bootloader" (for AVR-ISP) or "Burn Bootloader Parallel" command from the Tools menu of the Arduino environment. Burning the bootloader may take 15 seconds or more, so be patient.

to:

Make sure you have the right item selected in the Tools | Microcontroller menu (it should match the chip on your Arduino board). Then, just launch the appropriate command from the Tools menu of the Arduino environment. Burning the bootloader may take 15 seconds or more, so be patient.

August 07, 2007, at 04:05 AM by David A. Mellis -
Changed lines 38-53 from:

A precompiled bootloader (.hex file) comes with the Arduino environment; it communicates at 19200 baud (but see the note for older boards above). The "Burn Bootloader" commands in the Arduino environment use an open-source tool, uisp. There are four steps (each a separate call to uisp): unlocking the bootloader section of the chip, setting the the fuses on the chip, uploading the bootloader code to the chip, and locking the bootloader section of the chip. These are controlled by a number of preferences in the Arduino preferences file:

  • bootloader.programmer (default value: stk500) is the protocal used by the bootloader.

  • bootloader.unlock_bits (default value: 0xFF) is the value to write to the ATmega8 lock byte to unlock the bootloader section.

  • bootloader.high_fuses (default value for an ATmega8 on an Arduino board: 0xca) is the value to write to the high byte of the ATmega8 fuses.

  • bootloader.low_fuses (default value for an ATmega8 on an Arduino board: 0xdf) is the value to write to the low byte of the ATmega8 fuses.

  • bootloader.path (default value: bootloader) is the path (relative to the Arduino application directory) containing the precompiled bootloader.

  • bootloader.file (default value: ATmegaBOOT.hex) is the name of the file containing the precompiled bootloader code (in bootloader.path).

  • bootloader.lock_bits (default value: 0xCF) is the value to write to the ATmega8 lock byte to lock the bootloader section (so it doesn't get accidently overwritten when you upload a sketch).
to:

A precompiled bootloader (.hex file) comes with the Arduino environment; it communicates at 19200 baud (but see the note for older boards above). The "Burn Bootloader" commands in the Arduino environment use an open-source tool, avrdude. There are four steps: unlocking the bootloader section of the chip, setting the the fuses on the chip, uploading the bootloader code to the chip, and locking the bootloader section of the chip. These are controlled by a number of preferences in the Arduino [[Preferences | preferences file].

For the ATmega8 bootloader, these are:

  • bootloader.atmega8.programmer (default value: stk500) is the protocal used by the bootloader.

  • bootloader.atmega8.unlock_bits (default value: 0xFF) is the value to write to the ATmega8 lock byte to unlock the bootloader section.

  • bootloader.atmega8.high_fuses (default value: 0xca) is the value to write to the high byte of the ATmega8 fuses.

  • bootloader.atmega8.low_fuses (default value: 0xdf) is the value to write to the low byte of the ATmega8 fuses.

  • bootloader.atmega8.path (default value: bootloader) is the path (relative to the Arduino application directory) containing the precompiled bootloader.

  • bootloader.atmega8.file (default value: ATmegaBOOT.hex) is the name of the file containing the precompiled bootloader code (in bootloader.path).

  • bootloader.atmega8.lock_bits (default value: 0xCF) is the value to write to the ATmega8 lock byte to lock the bootloader section (so it doesn't get accidently overwritten when you upload a sketch).

For the ATmega168, these are (where <BOARD> is either "diecimila" or "ng"):

  • bootloader.atmega168-<BOARD>.programmer (default value: avrispmkii) is the protocal used by the bootloader.

  • bootloader.atmega168-<BOARD>.unlock_bits (default value: 0x3F) is the value to write to the ATmega168 lock byte to unlock the bootloader section.

  • bootloader.atmega168-<BOARD>.extended_fuses (default value: 0x00) is the value to write to the high byte of the ATmega168 fuses.

  • bootloader.atmega168-<BOARD>.high_fuses (default value: 0xdd) is the value to write to the high byte of the ATmega168 fuses.

  • bootloader.atmega168-<BOARD>.low_fuses (default value: 0xff) is the value to write to the low byte of the ATmega168 fuses.

  • bootloader.atmega168-<BOARD>.path (default value: bootloader168) is the path (relative to the Arduino application directory) containing the precompiled bootloader.

  • bootloader.atmega168-<BOARD>.file (default value: ATmegaBOOT_168_<BOARD>.hex) is the name of the file containing the precompiled bootloader code (in bootloader.path).

  • bootloader.atmega168-<BOARD>.lock_bits (default value: 0x0F) is the value to write to the ATmega168 lock byte to lock the bootloader section (so it doesn't get accidently overwritten when you upload a sketch).
Changed lines 76-78 from:

The bootloader source code is available.

For historical reasons we maintain the following link, that will give you access to the release of the bootloader's source code we used in the first prototype we made, it is including two batch files to do the compilation and download of it under windows.

to:

The bootloader source code is available: ATmega8, ATmega168

November 05, 2006, at 04:48 PM by David A. Mellis -
Changed lines 34-35 from:

Newer versions of the bootloader communicate with the computer at 19200 baud; older versions use 9600 baud. In order to successfully upload programs to the board, this rate needs to match the serial.download_rate in your preferences.txt file (which defaults to 19200). See the FAQ? for instructions on changing it.

to:

Newer versions of the bootloader communicate with the computer at 19200 baud; older versions use 9600 baud. In order to successfully upload programs to the board, this rate needs to match the serial.download_rate in your preferences file (which defaults to 19200).

Changed lines 38-39 from:

A precompiled bootloader (.hex file) comes with the Arduino environment; it communicates at 19200 baud (but see the note for older boards above). The "Burn Bootloader" commands in the Arduino environment use an open-source tool, uisp. There are four steps (each a separate call to uisp): unlocking the bootloader section of the chip, setting the the fuses on the chip, uploading the bootloader code to the chip, and locking the bootloader section of the chip. These are controlled by a number of preferences in the Arduino preferences file:

to:

A precompiled bootloader (.hex file) comes with the Arduino environment; it communicates at 19200 baud (but see the note for older boards above). The "Burn Bootloader" commands in the Arduino environment use an open-source tool, uisp. There are four steps (each a separate call to uisp): unlocking the bootloader section of the chip, setting the the fuses on the chip, uploading the bootloader code to the chip, and locking the bootloader section of the chip. These are controlled by a number of preferences in the Arduino preferences file:

November 05, 2006, at 12:27 PM by David A. Mellis -
Added lines 1-58:

Bootloader

The bootloader is a small piece of software that we've burned onto the chips that come with your Arduino boards. It allows you to upload sketches to the board without external hardware.

When you reset the Arduino board, it runs the bootloader (if present). The bootloader pulses digital pin 13 (you can connect an LED to make sure that the bootloader is installed). The bootloader then waits a few seconds for commands or data to arrive from the the computer. Usually, this is a sketch that the bootloader writes to the flash memory on the ATmega8 chip. A few seconds later, the bootloader launches the newly-uploaded program. If no data arrives from the computer, the bootloader launches whatever program was last uploaded onto the chip. If the chip is still "virgin" the bootloader is the only program in memory and will start itself again.

Why are we using a bootloader?

The use of a bootloader allows us to avoid the use of external hardware programmers. (Burning the bootloader onto the chip, however, requires one of these external programmers.)

Not using a bootloader

If you want to use the full program space (flash) of the chip or avoid the bootloader delay, you can burn your sketches using an external programmer.

Burning the Bootloader

To burn the bootloader, you'll need to buy an AVR-ISP (in-system programmer) or build a ParallelProgrammer. The programmer should be connected to the ICSP pins (the 2 by 3 pin header) - make sure you plug it in the right way. The board must be powered by an external power supply or the USB port.

Then, just launch the "Burn Bootloader" (for AVR-ISP) or "Burn Bootloader Parallel" command from the Tools menu of the Arduino environment. Burning the bootloader may take 15 seconds or more, so be patient.

It still doesn't work! (parallel programmer on Windows XP)

Windows XP may be polling your parallel port and disrupting the bootloader burning process. You'll need this registry patch:

 
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Parport\Parameters]
"DisableWarmPoll"=dword:00000001

See this forum thread for details.

Note for older boards.

Newer versions of the bootloader communicate with the computer at 19200 baud; older versions use 9600 baud. In order to successfully upload programs to the board, this rate needs to match the serial.download_rate in your preferences.txt file (which defaults to 19200). See the FAQ? for instructions on changing it.

How does it work?

A precompiled bootloader (.hex file) comes with the Arduino environment; it communicates at 19200 baud (but see the note for older boards above). The "Burn Bootloader" commands in the Arduino environment use an open-source tool, uisp. There are four steps (each a separate call to uisp): unlocking the bootloader section of the chip, setting the the fuses on the chip, uploading the bootloader code to the chip, and locking the bootloader section of the chip. These are controlled by a number of preferences in the Arduino preferences file:

  • bootloader.programmer (default value: stk500) is the protocal used by the bootloader.

  • bootloader.unlock_bits (default value: 0xFF) is the value to write to the ATmega8 lock byte to unlock the bootloader section.

  • bootloader.high_fuses (default value for an ATmega8 on an Arduino board: 0xca) is the value to write to the high byte of the ATmega8 fuses.

  • bootloader.low_fuses (default value for an ATmega8 on an Arduino board: 0xdf) is the value to write to the low byte of the ATmega8 fuses.

  • bootloader.path (default value: bootloader) is the path (relative to the Arduino application directory) containing the precompiled bootloader.

  • bootloader.file (default value: ATmegaBOOT.hex) is the name of the file containing the precompiled bootloader code (in bootloader.path).

  • bootloader.lock_bits (default value: 0xCF) is the value to write to the ATmega8 lock byte to lock the bootloader section (so it doesn't get accidently overwritten when you upload a sketch).

Source Code

The bootloader source code is available.

For historical reasons we maintain the following link, that will give you access to the release of the bootloader's source code we used in the first prototype we made, it is including two batch files to do the compilation and download of it under windows.

Share