Difference between revisions of "Upload bootloader"

From Flav's Wiki
Jump to: navigation, search
(Upload Issues)
(Read Current Fuse Settings)
Line 55: Line 55:
  
 
==Read Current Fuse Settings==
 
==Read Current Fuse Settings==
<pre>
+
<code enclose="div">
 
C:\Users\mike>"C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude" -C"C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -patmega328p -cstk500v1 -PCOM10 -b19200 -v
 
C:\Users\mike>"C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude" -C"C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -patmega328p -cstk500v1 -PCOM10 -b19200 -v
  
Line 121: Line 121:
  
 
avrdude done.  Thank you.
 
avrdude done.  Thank you.
 +
</code>
 +
 +
==Write Fuse==
 +
<pre>
 +
C:\Users\mike>"C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude" -C
 +
"C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -patmega
 +
328p -cstk500v1 -PCOM10 -b19200 -U lfuse:w:0xff:m -U hfuse:w:0xda:m -U efuse:w:0
 +
x05:m
 +
 +
avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
 +
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
 +
        Copyright (c) 2007-2009 Joerg Wunsch
 +
 +
        System wide configuration file is "C:\Program Files (x86)\Arduino\hardw
 +
are\tools\avr/etc/avrdude.conf"
 +
 +
        Using Port                    : COM10
 +
        Using Programmer              : stk500v1
 +
        Overriding Baud Rate          : 19200
 +
        AVR Part                      : ATmega328P
 +
        Chip Erase delay              : 9000 us
 +
        PAGEL                        : PD7
 +
        BS2                          : PC2
 +
        RESET disposition            : dedicated
 +
        RETRY pulse                  : SCK
 +
        serial program mode          : yes
 +
        parallel program mode        : yes
 +
        Timeout                      : 200
 +
        StabDelay                    : 100
 +
        CmdexeDelay                  : 25
 +
        SyncLoops                    : 32
 +
        ByteDelay                    : 0
 +
        PollIndex                    : 3
 +
        PollValue                    : 0x53
 +
        Memory Detail                :
 +
 +
                                  Block Poll              Page
 +
      Polled
 +
          Memory Type Mode Delay Size  Indx Paged  Size  Size #Pages MinW  Max
 +
W  ReadBack
 +
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
 +
-- ---------
 +
          eeprom        65    20    4    0 no      1024    4      0  3600  36
 +
00 0xff 0xff
 +
          flash        65    6  128    0 yes    32768  128    256  4500  45
 +
00 0xff 0xff
 +
          lfuse          0    0    0    0 no          1    0      0  4500  45
 +
00 0x00 0x00
 +
          hfuse          0    0    0    0 no          1    0      0  4500  45
 +
00 0x00 0x00
 +
          efuse          0    0    0    0 no          1    0      0  4500  45
 +
00 0x00 0x00
 +
          lock          0    0    0    0 no          1    0      0  4500  45
 +
00 0x00 0x00
 +
          calibration    0    0    0    0 no          1    0      0    0
 +
0 0x00 0x00
 +
          signature      0    0    0    0 no          3    0      0    0
 +
0 0x00 0x00
 +
 +
        Programmer Type : STK500
 +
        Description    : Atmel STK500 Version 1.x firmware
 +
        Hardware Version: 2
 +
        Firmware Version: 1.18
 +
        Topcard        : Unknown
 +
        Vtarget        : 0.0 V
 +
        Varef          : 0.0 V
 +
        Oscillator      : Off
 +
        SCK period      : 0.1 us
 +
 +
avrdude: AVR device initialized and ready to accept instructions
 +
 +
Reading | ################################################## | 100% 0.11s
 +
 +
avrdude: Device signature = 0x1e950f
 +
avrdude: safemode: lfuse reads as FF
 +
avrdude: safemode: hfuse reads as DE
 +
avrdude: safemode: efuse reads as 5
 +
avrdude: reading input file "0xff"
 +
avrdude: writing lfuse (1 bytes):
 +
 +
Writing | ################################################## | 100% 0.03s
 +
 +
avrdude: 1 bytes of lfuse written
 +
avrdude: verifying lfuse memory against 0xff:
 +
avrdude: load data lfuse data from input file 0xff:
 +
avrdude: input file 0xff contains 1 bytes
 +
avrdude: reading on-chip lfuse data:
 +
 +
Reading | ################################################## | 100% 0.02s
 +
 +
avrdude: verifying ...
 +
avrdude: 1 bytes of lfuse verified
 +
avrdude: reading input file "0xda"
 +
avrdude: writing hfuse (1 bytes):
 +
 +
Writing | ################################################## | 100% 0.05s
 +
 +
avrdude: 1 bytes of hfuse written
 +
avrdude: verifying hfuse memory against 0xda:
 +
avrdude: load data hfuse data from input file 0xda:
 +
avrdude: input file 0xda contains 1 bytes
 +
avrdude: reading on-chip hfuse data:
 +
 +
Reading | ################################################## | 100% 0.03s
 +
 +
avrdude: verifying ...
 +
avrdude: 1 bytes of hfuse verified
 +
avrdude: reading input file "0x05"
 +
avrdude: writing efuse (1 bytes):
 +
 +
Writing | ################################################## | 100% 0.03s
 +
 +
avrdude: 1 bytes of efuse written
 +
avrdude: verifying efuse memory against 0x05:
 +
avrdude: load data efuse data from input file 0x05:
 +
avrdude: input file 0x05 contains 1 bytes
 +
avrdude: reading on-chip efuse data:
 +
 +
Reading | ################################################## | 100% 0.02s
 +
 +
avrdude: verifying ...
 +
avrdude: 1 bytes of efuse verified
 +
 +
avrdude: safemode: lfuse reads as FF
 +
avrdude: safemode: hfuse reads as DA
 +
avrdude: safemode: efuse reads as 5
 +
avrdude: safemode: Fuses OK (H:05, E:DA, L:FF)
 +
 +
avrdude done.  Thank you.
 +
 
</pre>
 
</pre>

Revision as of 10:54, 12 July 2015

This page describes how to upload a bootloader on an Arduino Pro Mini with an Arduino Uno.

References:

Hardware Connexion

Arduino Uno (Programmer) Arduino Pro Mini
3.3V or 5V (depending on on Mini version) Vcc
GND GND
10 Reset
11 (MOSI) 11 (MOSI)
12 (MISO) 12 (MISO)
13 (SCK) 13 (SCK)

Programming with IDE

Disconnect the Arduino Pro Mini

Program the programmer

Steps:

  1. Select the ArduinoISP Sketch: Select File>Examples>Arduino ISP
  2. Select your programmer board (Arduino Uno): Tools>Board>Arduino Uno
  3. Select the serial port: Tools>Serial Port>COMXXX
  4. Upload

Connect the Arduino Pro Mini

Flash the bootloader

Steps:

  1. Select the target board: Tools>Board>Arduino Pro Mini ...
  2. Select type of programmer: Tools>Programmer>Arduino as ISP
  3. Burn: Tools>Burn Bootloader

Flash optiboot

Read:

Upload Issues

Read Current Fuse Settings

C:\Users\mike>"C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude" -C"C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -patmega328p -cstk500v1 -PCOM10 -b19200 -v

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58

        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
        Copyright (c) 2007-2009 Joerg Wunsch
        System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"
        Using Port                    : COM10
        Using Programmer              : stk500v1
        Overriding Baud Rate          : 19200
        AVR Part                      : ATmega328P
        Chip Erase delay              : 9000 us
        PAGEL                         : PD7
        BS2                           : PC2
        RESET disposition             : dedicated
        RETRY pulse                   : SCK
        serial program mode           : yes
        parallel program mode         : yes
        Timeout                       : 200
        StabDelay                     : 100
        CmdexeDelay                   : 25
        SyncLoops                     : 32
        ByteDelay                     : 0
        PollIndex                     : 3
        PollValue                     : 0x53
        Memory Detail                 :
                                 Block Poll               Page      Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
          flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
          lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
          hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
          efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
          lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
          calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
          signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
        Programmer Type : STK500
        Description     : Atmel STK500 Version 1.x firmware
        Hardware Version: 2
        Firmware Version: 1.18
        Topcard         : Unknown
        Vtarget         : 0.0 V
        Varef           : 0.0 V
        Oscillator      : Off
        SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.09s

avrdude: Device signature = 0x1e950f avrdude: safemode: lfuse reads as FF avrdude: safemode: hfuse reads as DA avrdude: safemode: efuse reads as 5

avrdude: safemode: lfuse reads as FF avrdude: safemode: hfuse reads as DA avrdude: safemode: efuse reads as 5 avrdude: safemode: Fuses OK (H:05, E:DA, L:FF)

avrdude done. Thank you.

Write Fuse

C:\Users\mike>"C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude" -C
"C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -patmega
328p -cstk500v1 -PCOM10 -b19200 -U lfuse:w:0xff:m -U hfuse:w:0xda:m -U efuse:w:0
x05:m

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardw
are\tools\avr/etc/avrdude.conf"

         Using Port                    : COM10
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  36
00 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  45
00 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0
 0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0
 0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.11s

avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DE
avrdude: safemode: efuse reads as 5
avrdude: reading input file "0xff"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.03s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xff:
avrdude: load data lfuse data from input file 0xff:
avrdude: input file 0xff contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.02s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude: reading input file "0xda"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.05s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xda:
avrdude: load data hfuse data from input file 0xda:
avrdude: input file 0xda contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.03s

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0x05"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.03s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0x05:
avrdude: load data efuse data from input file 0x05:
avrdude: input file 0x05 contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.02s

avrdude: verifying ...
avrdude: 1 bytes of efuse verified

avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DA
avrdude: safemode: efuse reads as 5
avrdude: safemode: Fuses OK (H:05, E:DA, L:FF)

avrdude done.  Thank you.