Git Product home page Git Product logo

arduino_sketches's Introduction

arduino_sketches

Publicly-released sketches for the Arduino microprocessor.

Update

As from 19th January 2015, the various sketches below "time out" if they don't enter programming mode after 50 attempts.

The code displays a dot for every attempt, so if it fails you will see something like this:

Attempting to enter programming mode ......................................................
Failed to enter programming mode. Double-check wiring!

(There are 53 dots because the initial message is "Attempting to enter programming mode ...").

Wiring

For all sketches except for:

  • Atmega_Hex_Uploader
  • Atmega_Self_Read_Signature
  • Atmega_Hex_Uploader_Fixed_Filename

... connect hardware SPI pins together as below:

  • MISO to MISO
  • MOSI to MOSI
  • SCK to SCK
  • Vcc to Vcc
  • Gnd to Gnd
  • Reset on target board to D10 on programming board

These pins are generally exposed on the ICSP header of most boards (except "breadboard" boards).

ICSP header

For "breadboard" boards you will need to read the datasheet for the appropriate chip to find which pins to use.

Atmega_Board_Detector

See forum post: http://www.gammon.com.au/forum/?id=11633

This uses one Arduino to detect the signature, fuses, and bootloader of another one.

Only some Arduinos are supported to run the sketch. It has been tested on a Uno, Mega2560 and Leonardo.

It sumchecks the bootloader so you can quickly see if a particular one is installed. Some bootloader sumchecks are known and the bootloader "name" reported if found.

Example of use:

Atmega chip detector.
Written by Nick Gammon.
Version 1.11
Compiled on Nov  4 2014 at 11:10:33
Entered programming mode OK.
Signature = 1E 95 0F
Processor = ATmega328P
Flash memory size = 32768 bytes.
LFuse = FF
HFuse = DE
EFuse = FD
Lock byte = CF
Clock calibration = 8D
Bootloader in use: Yes
EEPROM preserved through erase: No
Watchdog timer always on: No
Bootloader is 512 bytes starting at 7E00

Bootloader:

7E00: 11 24 84 B7 14 BE 81 FF F0 D0 85 E0 80 93 81 00
7E10: 82 E0 80 93 C0 00 88 E1 80 93 C1 00 86 E0 80 93
...
7FE0: 11 50 E9 F7 F2 DF 1F 91 08 95 80 E0 E8 DF EE 27
7FF0: FF 27 09 94 FF FF FF FF FF FF FF FF FF FF 04 04

MD5 sum of bootloader = FB F4 9B 7B 59 73 7F 65 E8 D0 F8 A5 08 12 E7 9F
Bootloader name: optiboot_atmega328

First 256 bytes of program memory:

0: 0C 94 52 05 0C 94 7A 05 0C 94 7A 05 0C 94 7A 05
10: 0C 94 7A 05 0C 94 7A 05 0C 94 7A 05 0C 94 7A 05
...

Atmega_Fuse_Calculator

See forum post: http://www.gammon.com.au/forum/?id=11653

Only some Arduinos are supported to run the sketch. It has been tested on a Uno, Mega2560 and Leonardo.

Similar to the Atmega_Board_Detector sketch, this reads a target board's fuses, and displays which fuses are set in a nicer interface, for example:

External Reset Disable.................. [ ]
Debug Wire Enable....................... [ ]
Enable Serial (ICSP) Programming........ [X]
Watchdog Timer Always On................ [ ]
Preserve EEPROM through chip erase...... [ ]
Boot into bootloader.................... [X]
Divide clock by 8....................... [ ]
Clock output............................ [ ]

Atmega_Self_Read_Signature

See forum post: http://www.gammon.com.au/forum/?id=11633&reply=2#reply2

Similar to the Atmega_Board_Detector sketch this "self-detects" a signature, so an Arduino can report back its own fuses, and bootloader MD5 sum.

Example of use:


Signature detector.
Written by Nick Gammon.
Signature = 1E  95  0F
Fuses
Low = FF High = D6 Ext = FD Lock = CF

Processor = ATmega328P
Flash memory size = 32768
Bootloader in use: Yes
EEPROM preserved through erase: Yes
Watchdog timer always on: No
Bootloader is 512 bytes starting at 7E00

Note: Depending on the fuse settings, it may not be able to read the bootloader.

The Atmega_Self_Read_Signature sketch does not require any additional wiring.

Atmega_Board_Programmer

See forum post: http://www.gammon.com.au/forum/?id=11635

This will re-flash the bootloader in selected chips.

Only some Arduinos are supported to run the sketch. It has been tested on a Uno, Mega2560 and Leonardo.

Supported target chips are:

  • Atmega8 (1024 bytes)
  • Atmega168 Optiboot (512 bytes)
  • Atmega328 Optiboot (for Uno etc. at 16 MHz) (512 bytes)
  • Atmega328 (8 MHz) for Lilypad etc. (2048 bytes)
  • Atmega32U4 for Leonardo (4096 bytes)
  • Atmega1280 Optiboot (1024 bytes)
  • Atmega1284 Optiboot (1024 bytes)
  • Atmega2560 with fixes for watchdog timer problem (8192 bytes)
  • Atmega16U2 - the bootloader on the USB interface chip of the Uno

You can use that to install or update bootloaders on the above chips (using another Arduino as the programmer).

The bootloader code is built into the sketch, so it is self-contained (it does not require an SD card, PC or anything like that).

Example of use:

Atmega chip programmer.
Written by Nick Gammon.
Version 1.25
Compiled on Nov  4 2014 at 07:33:18
Entered programming mode OK.
Signature = 0x1E 0x95 0x0F
Processor = ATmega328P
Flash memory size = 32768 bytes.
LFuse = 0xFF
HFuse = 0xDE
EFuse = 0xFD
Lock byte = 0xCF
Clock calibration = 0x8D
Bootloader address = 0x7E00
Bootloader length = 512 bytes.
Type 'L' to use Lilypad (8 MHz) loader, or 'U' for Uno (16 MHz) loader ...

Atmega_Hex_Uploader

See forum post: http://www.gammon.com.au/forum/?id=11638

This lets you:

  • Verify flash memory
  • Read from flash and save to disk
  • Read from disk and flash a chip
  • Check fuses
  • Update fuses
  • Erase flash memory

Most operations (except changing fuses) require an external SD card, described in the forum post. You can easily connect one by obtaining a Micro SD "breakout" board for around $US 15.

The SD card uses the hardware SPI pins, and thus the programming of the target chip uses bit-banged SPI, which means that the connections to the board to be programmed differs from the above sketches.

Example of use:

Attempting to enter programming mode ...
Entered programming mode OK.
Signature = 0x1E 0x95 0x0F
Processor = ATmega328P
Flash memory size = 32768 bytes.
LFuse = 0xFF
HFuse = 0xDE
EFuse = 0xFD
Lock byte = 0xCF
Clock calibration = 0x8D
Actions:
 [E] erase flash
 [F] modify fuses
 [L] list directory
 [R] read from flash (save to disk)
 [V] verify flash (compare to disk)
 [W] write to flash (read from disk)
Enter action:
Programming mode off.

Wiring for the Atmega_Hex_Uploader sketch:

Arduino    SD Card
--------------------------------
SS         CS (chip select)
MOSI       DI (data in)
MISO       DO (data out)
SCK        CLK (clock)
+5V        5V
Gnd        Gnd

Arduino    Target chip/board
-------------------------------------
D6         MISO
D7         MOSI
D4         SCK
D5         Reset
D9         Clock of target (if required)
+5V        5V
Gnd        Gnd

This sketch uses "bit banged" SPI for programming the target chip, which is why it uses pins D4, D5, D6, D7 instead of the hardware SPI pins.

Atmega_Hex_Uploader_Fixed_Filename

See forum post: http://www.gammon.com.au/forum/?id=11638&reply=5#reply5

This lets you read from disk and flash a chip, with a "fixed" filename (firmware.hex) and no serial port interface. Instead, three LEDs are used to display status, and flash to show errors.

It requires an external SD card, described in the forum post. You can easily connect one by obtaining a Micro SD "breakout" board for around $US 15.

The SD card uses the hardware SPI pins, and thus the programming of the target chip uses bit-banged SPI, which means that the connections to the board to be programmed differs from the above sketches (apart from Atmega_Hex_Uploader, which uses the same wiring).

Wiring for the Atmega_Hex_Uploader_Fixed_Filename sketch:

Arduino    SD Card
--------------------------------
SS         CS (chip select)
MOSI       DI (data in)
MISO       DO (data out)
SCK        CLK (clock)
+5V        5V
Gnd        Gnd

Arduino    Target chip/board
-------------------------------------
D6         MISO
D7         MOSI
D4         SCK
D5         Reset
D9         Clock of target (if required)
+5V        5V
Gnd        Gnd

Arduino    Switch and LEDs
--------------------------------
D2         Start-programming switch (normally open, other end to Gnd)
A0         Error LED (red)
A1         Ready LED (green)
A2         Working LED (yellow)

This sketch uses "bit banged" SPI for programming the target chip, which is why it uses pins D4, D5, D6, D7 instead of the hardware SPI pins.

See the source code (and above forum post) for details about the meanings of the different numbers of LED flashes.

High-voltage serial and parallel programming

As from 27th May 2015 the sketches Atmega_Hex_Uploader, Atmega_Board_Detector and Atmega_Board_Programmer also optionally support the high-voltage programming mode of various chips.

This is documented in some detail at http://www.gammon.com.au/forum/?id=12898

For connecting your Arduino Uno to an Atmega328 (or similar) chip this is the wiring:

Arduino    Target chip
-------------------------------------
  D2       12 (PD6)
  D3       13 (PD7)
  D4       25 (PC2)
  D5       7 and 20 (VCC and AVCC)
  D6       14 (PB0) (data bit 0)
  D7       15 (PB1) (data bit 1)
  D8       16 (PB2) (data bit 2)
  D9       17 (PB3) (data bit 3)
  D10      18 (PB4) (data bit 4)
  D11      19 (PB5) (data bit 5)
  D12      23 (PC0) (data bit 6)
  D13      24 (PC1) (data bit 7)
  A0        3 (PD1)
  A1        4 (PD2)
  A2        5 (PD3)
  A3        6 (PD4)
  A4        9 (XTAL1)
  A5        11 (PD5)

  /RESET (pin 1) on target connected to 12V via a transistor and MOSFET as shown in the schematic.
  Also connect the grounds. Gnd to pins 8 and 22.
  Decoupling capacitors: 0.1 uF between VCC/AVCC (pins 7 and 20) and Gnd.
  Not connected on target: pins 2, 10, 21, 26, 27, 28.

###Reset circuitry###

Reset circuit

For connecting your Arduino Uno to an ATtiny85 (or similar) chip this is the wiring:

Arduino    Target chip
-------------------------------------
  D3         8 (VCC)
  D4         5 (PB0)
  D5         6 (PB1)
  D6         7 (PB2)
  D7         2 (PB3)

 /RESET (pin 1) on target connected to 12V via a transistor and MOSFET as shown in the schematic.
 Also connect the ground. GND to pin 4.
 Decoupling capacitor: 0.1 µF (100 nF) between VCC (pin 8) and Gnd.
 Not connected on target: pin 3.

convertHexToByteArray.py

The convertHexToByteArray.py tool allows you to easily convert .hex files into a C array that you can use inside the Atmega_Board_Programmer code. It's an alternative to the Lua script and easier to setup in most cases.

To run the script you need python2 and the intelhex python library which can be downloaded here or via pip.

Example of use:

python convertHexToByteArray.py ATmegaBOOT_168_atmega328_pro_8MHz.hex > bootloader_lilypad328.h

arduino_sketches's People

Contributors

dirtyengineer avatar matthijskooijman avatar nickgammon avatar nicohood avatar smartblug avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino_sketches's Issues

MOSFET Vgs(max)

hi,
your webpage at http://www.gammon.com.au/motors was recently referenced in a thread i've been following, and i notice a design oversight that you seem to be frequently repeating.

when using a P-channel MOSFET as a high-side switch, you often drive the gate with an NPN transistor but fail to include a suitable zener diode (6v8 or similar) to protect the MOSFET from excessive gate voltage. generally Vgs should not exceed the range +/- 8v. if just using an NPN transistor to drive directly into the gate, without suitable gate protection, it is important that the supply voltage connected to the MOSFET's source should not exceed 8v or so.

(the below circuit was for use with a MOSFET that had a slightly higher Vgs(max))
mosfet switch

cheers,
rob :-)

Read/Write to target board EEPROM?

Greetings @nickgammon, I'm really happy I found this and for all the hard work you have put in. Thank you.

First off I'm relatively new to the software side as I'm a hardware guy, so please bare with me. How hard would it be to adapter/modify your Atmega Board Programmer code to read/write to a target boards EEPROM?

For my specific case I'm looking to build a stand alone 328P board to read/write to the EEPROM of Atmega8's in the field without having to haul around a laptop to update them. The legacy program running on the Atmega8's reads the settings stored in it's EEPROM and runs accordingly. I have to periodically read the EEPROM from one target board and then burn it to another target board. A stand alone programmer would save a lot of time. Do you think this is an attainable goal?

Using EEPROM or PROGMEM for "fixed filename"

Let me preface this by saying all of this is GREAT! I have been looking for this very functionality for a long time and I just now came across it.

What I ultimately would be interested in would be reading the .hex (or byte array of .hex) directly from PROGMEM and/or EEPROM. Do you have any plans to implement that feature? I think it would be especially useful in the 'fixed filename' sketch.

Thanks for all your doing.

bootloader erased when using hex_uploader

Hello M. Gammond,
I'm self-learning arduino for years and putting now a foot in the bootload and fuse stuffs but I got a problem here.
I'm trying to use your hex_uploader sketch to upload on some home-made Arduino Pro Mini's from SD card. (ATMega328P, 5V, 16Mhz)
It succeds and the sketch uploaded works perfectly, but if I try to upload then something else from Arduino IDE the usual way it refuses.
Investigating with your wonderful Atmega_Board_Detector, I discovered that the Hex_Uploader is erasing my bootload (and then changing high fuse from 0xDA to 0xDB).
So using the Hex_Uploader with the version of the hex file of my sketch containing the bootloader, and then changing HFuse from 0xDB back to 0xDA I managed to make it work on the IDE uploads again.

But this bothers me. Should'nt the Hex_Uploader work properly with the standard hex file, without wiping out my bootload ?

Here is the Serial output of Hex_Uploader using the standard hex file :

`_Atmega hex file uploader.
Written by Nick Gammon.
Version 1.37
Compiled on Feb 28 2019 at 15:51:41 with Arduino IDE 10805.
Reading SD card ...

HEX files in root directory:

MG_BLK0.HEX : 1858 bytes. Created: 2019-03-01 07:58:56. Modified: 2019-03-01 07:55:22
MG_BLK1.HEX : 4129 bytes. Created: 2019-03-01 07:58:56. Modified: 2019-03-01 07:49:54
MG_BLK2.HEX : 4284 bytes. Created: 2019-03-01 07:58:56. Modified: 2019-03-01 07:54:08
MG_BLK3.HEX : 4235 bytes. Created: 2019-03-01 07:58:56. Modified: 2019-03-01 07:54:34
MG_MSTR.HEX : 68757 bytes. Created: 2019-03-01 07:58:54. Modified: 2019-03-01 07:56:14
PM_BLK0.HEX : 1265 bytes. Created: 2019-03-01 07:58:56. Modified: 2019-02-28 14:09:28
PM_BLK1.HEX : 2640 bytes. Created: 2019-03-01 07:58:56. Modified: 2019-02-28 14:10:58
PM_BLK2.HEX : 2828 bytes. Created: 2019-03-01 07:58:56. Modified: 2019-02-28 14:13:04
PM_BLK3.HEX : 2750 bytes. Created: 2019-03-01 07:58:56. Modified: 2019-02-28 14:13:44
PM_BLK4.HEX : 2750 bytes. Created: 2019-03-01 07:58:56. Modified: 2019-02-28 14:14:16
PM_BT2-2.HEX : 35498 bytes. Created: 2019-03-01 08:59:06. Modified: 2019-03-01 08:58:26
PM_BT2-3.HEX : 35490 bytes. Created: 2019-03-04 08:11:30. Modified: 2019-03-04 08:10:16
PM_PB.HEX : 30544 bytes. Created: 2019-03-01 07:58:56. Modified: 2019-03-01 07:47:10
BTBL_2-3.HEX : 39692 bytes. Created: 2019-03-04 10:25:50. Modified: 2019-03-04 10:23:32

--------- Starting ---------

Attempting to enter ICSP programming mode ...
Entered programming mode OK.
Signature = 0x1E 0x95 0x0F
Processor = ATmega328P
Flash memory size = 32768 bytes.
LFuse = 0xFF
HFuse = 0xDA
EFuse = 0xFD
Lock byte = 0xCF
Clock calibration = 0x9A
Actions:
[E] erase flash
[F] modify fuses
[L] list directory
[R] read from flash (save to disk)
[V] verify flash (compare to disk)
[W] write to flash (read from disk)
Enter action:
Programming mode off.
W
Attempting to enter ICSP programming mode ...
Entered programming mode OK.

Choose disk file [ BTBL_2-3.HEX ] ...
PM_BT2-3.HEX
Processing file: PM_BT2-3.HEX
Checking file ...

####################
Lowest address = 0x0
Highest address = 0x3141
Bytes to write = 12610
No bootloader.
Suggest making high fuse = 0xDB
Attempting to enter ICSP programming mode ...
Entered programming mode OK.
Processing file: PM_BT2-3.HEX
Erasing chip ...
Writing flash ...

################################################################
###################################
Written.
Processing file: PM_BT2-3.HEX
Verifying flash ...

################################################################
##################################
No errors found.
No bootloader.
Setting high fuse = 0xDB
Done.

--------- Starting ---------

Attempting to enter ICSP programming mode ...
Entered programming mode OK.
Signature = 0x1E 0x95 0x0F
Processor = ATmega328P
Flash memory size = 32768 bytes.
LFuse = 0xFF
HFuse = 0xDB
EFuse = 0xFD
Lock byte = 0xFF
Clock calibration = 0x9A
Actions:
[E] erase flash
[F] modify fuses
[L] list directory
[R] read from flash (save to disk)
[V] verify flash (compare to disk)
[W] write to flash (read from disk)
Enter action:
Programming mode off._`

(notice that the output with the hex file with bootloader is quite the same
except
#######################
Lowest address = 0x0
Highest address = 0x7F9D
Bytes to write = 14412
No bootloader.
Suggest making high fuse = 0xDB )

Extranous gpl.txt and md5.{c,h} in Atmega_Board_Programmer

I was just looking at the Atmega_Board_Programmer sketch. It has an md5 implementation included, but unless I'm very much mistaken, it is not used at all?

Furthermore, there is a gpl.txt in there, but the sketch seems to be licensed under a more liberal license. Does the gpl perhaps apply to the bootloaders? If so, some clarification is needed.

Atmega_Board_Detector patch

Here's a patch similar to issue #39 but for Atmega_Board_Detector sketch;
as I did read the patch to signature.h should go to Atmega_Hex_Uploader ...

--- Atmega_Board_Detector.ino.orig  2016-08-31 07:31:47 +0200
+++ Atmega_Board_Detector.ino   2016-09-15 19:14:16 +0200
@@ -72,6 +72,7 @@
  or the use or other dealings in the software.

 */
+#pragma GCC optimize ("-O0") // avoid GCC memcpy inline

 #include <SPI.h>
 extern "C"
@@ -327,6 +328,8 @@
     // show address
     if (i % 16 == 0)
       {
+      if ((addr + i) < 16)
+        Serial.print (F("0"));
       Serial.print (addr + i, HEX);
       Serial.print (F(": "));
       }
##############################################################################
--- md5.c.orig  2016-08-31 07:31:47 +0200
+++ md5.c   2016-09-18 19:38:23 +0200
@@ -17,7 +17,9 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
+#pragma GCC optimize ("-O0") // avoid GCC memcpy inline

+#include <string.h>  // for memcpy
 #include "md5.h"

 #define GET_UINT32(n,b,i)                       \
##############################################################################
--- Signatures.h.orig   2016-08-31 07:31:47 +0200
+++ Signatures.h    2016-09-18 01:29:55 +0200
@@ -63,7 +63,9 @@
   { { 0x1E, 0x92, 0x0A }, "ATmega48PA",   4 * kb,         0,    64,  NO_FUSE,  false  },
   { { 0x1E, 0x93, 0x0F }, "ATmega88PA",   8 * kb,       256,   128,  extFuse,  false },
   { { 0x1E, 0x94, 0x0B }, "ATmega168PA", 16 * kb,       256,   128,  extFuse,  false },
+  { { 0x1E, 0x94, 0x06 }, "ATmega168V",  16 * kb,       256,   128,  extFuse,  false },
   { { 0x1E, 0x95, 0x0F }, "ATmega328P",  32 * kb,       512,   128,  highFuse, false },
+  { { 0x1E, 0x95, 0x16 }, "ATmega328PB", 32 * kb,       512,   128,  highFuse, false },
   { { 0x1E, 0x95, 0x14 }, "ATmega328",   32 * kb,       512,   128,  highFuse, false },

   // Atmega644 family
@@ -94,6 +96,7 @@

   // ATmega1284P family
   { { 0x1E, 0x97, 0x05 }, "ATmega1284P", 128 * kb,   1 * kb,   256,  highFuse, false },
+  { { 0x1E, 0x97, 0x06 }, "ATmega1284",  128 * kb,   1 * kb,   256,  highFuse, false },

   // ATtiny4313 family
   { { 0x1E, 0x91, 0x0A }, "ATtiny2313A",   2 * kb,        0,    32,  NO_FUSE,  false   },

Atmega_Board_Detector.diff.txt

Missing F() makro in board programmer

https://github.com/nickgammon/arduino_sketches/blob/master/Atmega_Board_Programmer/Atmega_Board_Programmer.ino#L480
https://github.com/nickgammon/arduino_sketches/blob/master/Atmega_Board_Programmer/Atmega_Board_Programmer.ino#L595
https://github.com/nickgammon/arduino_sketches/blob/master/Atmega_Board_Programmer/Atmega_Board_Programmer.ino#L681

I am also wondering if we should put this into a special function to make it more clear (and easier to modify) Maybe something with a better API to also add BootLoaders for Micro and Pro Micro for example.
https://github.com/nickgammon/arduino_sketches/blob/master/Atmega_Board_Programmer/Atmega_Board_Programmer.ino#L519-L542

And btw a little note here:
My modified version uses 99% of the Unos memory. One guy got a verification error at byte 0x7800. Seems that he has no Optiboot installed. For further development you should keep in mind to no exceed this size for an uno. Also the sketch does not compile by default with a Leonardo. But you have the settings, which are nice. Should be fine, just wanted to mention it. Maybe you could default outcomment some bootloader but add some more for specific MCUs like Pro Micro, Micro etc.

Trying to identify a bootloader

Hi,

I have a few Arduino Nano and Pro mini boards. I backed-up the bootloaders (before erasing the flash) and then tried to identify them by searching for the first bytes: "0c 94 34 3c 0c 94 51 3c", so I found your repository.

I can see the bootloader stored in bootloader_lilypad328.h file has the same starting and ending bytes as bootloaders in my boards despite my boards work with 16 MHz crystal and the bootloader in bootloader_lilypad328.h file is for 8 MHz clock. I made a diff of these bootloaders (after converting them to binary) and the bytes are quite similar (at least in the first half of the code) but not the same.

Can you please tell if there is a source code of the bootloader stored in bootloader_lilypad328.h available somewhere on the net and what is its name?

Here you are the bootloader read from my Nano&Pro mini boards in Intel hex format, in case you can identify it. I would appreciate any info on that bootloader.

Regards
bootloader_ATmega328_16MHz.zip

Atmega_Self_Read_Signature not reading bootloader

Hi Nick,
thanks for making your great programs available!
I tested Atmega_Self_Read_Signature on some of my boards, but only with my China Uno clone the sketch dumps something which looks like a real bootloader, with my China Nano and 2 China ProMini I get only:

Bootloader:

7800: 02 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F
7810: 02 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F
...

as you wrote at other places this is most likely because of the lock fuse (0xCF); but wouldnt it be better to just write out "bootloader is locked and cant be read" instead of dumping the garbage?

Add at90usb162 and at90usb82 support

They are equal to the 16u2 and 8u2 but have a different signature. I just dont know where to look them up. It would be nice to add them because some older/Chinese boards have them instead. So the user knows what chip he has and dont get a "not supported" error.

Problem with LilyPad bootloader

Hello Nick,

I'm having trouble burning the bootloader to an ATMEGA328P for using the internal 8mhz clock. I am trying to make the 'minimal configuration' with the internal 8Mhz clock, from : https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard

Using your Atmega Board Programmer, the bootloader burns fine, but I am unable to program the chip afterwards. Note: Reburning it as an Uno, I am able to program it.

The next time I went to burn the Lilypad bootloader I used the 'Verify' option and got a lot of verification errors:

'''
Type 'L' to use Lilypad (8 MHz) loader, or 'U' for Uno (16 MHz) loader ...
Using Lilypad 8 MHz loader.
Bootloader address = 0x7800
Bootloader length = 1932 bytes.
Type 'Q' to quit, 'V' to verify, or 'G' to program the chip with the bootloader ...
Verifying ...
Verification error at address 7800. Got: 0xFF Expected: 0x0C
Verification error at address 7801. Got: 0xFF Expected: 0x94
Verification error at address 7802. Got: 0xFF Expected: 0x34
Verification error at address 7803. Got: 0xFF Expected: 0x3C
Verification error at address 7804. Got: 0xFF Expected: 0x0C
Verification error at address 7805. Got: 0xFF Expected: 0x94
Verification error at address 7806. Got: 0xFF Expected: 0x51
Verification error at address 7807. Got: 0xFF Expected: 0x3C
Verification error at address 7808. Got: 0xFF Expected: 0x0C
Verification error at address 7809. Got: 0xFF Expected: 0x94
Verification error at address 780A. Got: 0xFF Expected: 0x51
Verification error at address 780B. Got: 0xFF Expected: 0x3C
Verification error at address 780C. Got: 0xFF Expected: 0x0C
Verification error at address 780D. Got: 0xFF Expected: 0x94
Verification error at address 780E. Got: 0xFF Expected: 0x51
Verification error at address 780F. Got: 0xFF Expected: 0x3C
Verification error at address 7810. Got: 0xFF Expected: 0x0C
Verification error at address 7811. Got: 0xFF Expected: 0x94
Verification error at address 7812. Got: 0xFF Expected: 0x51
Verification error at address 7813. Got: 0xFF Expected: 0x3C
Verification error at address 7814. Got: 0xFF Expected: 0x0C
Verification error at address 7815. Got: 0xFF Expected: 0x94
Verification error at address 7816. Got: 0xFF Expected: 0x51
Verification error at address 7817. Got: 0xFF Expected: 0x3C
Verification error at address 7818. Got: 0xFF Expected: 0x0C
Verification error at address 7819. Got: 0xFF Expected: 0x94
Verification error at address 781A. Got: 0xFF Expected: 0x51
Verification error at address 781B. Got: 0xFF Expected: 0x3C
Verification error at address 781C. Got: 0xFF Expected: 0x0C
Verification error at address 781D. Got: 0xFF Expected: 0x94
Verification error at address 781E. Got: 0xFF Expected: 0x51
Verification error at address 781F. Got: 0xFF Expected: 0x3C
Verification error at address 7820. Got: 0xFF Expected: 0x0C
Verification error at address 7821. Got: 0xFF Expected: 0x94
Verification error at address 7822. Got: 0xFF Expected: 0x51
Verification error at address 7823. Got: 0xFF Expected: 0x3C
Verification error at address 7824. Got: 0xFF Expected: 0x0C
Verification error at address 7825. Got: 0xFF Expected: 0x94
Verification error at address 7826. Got: 0xFF Expected: 0x51
Verification error at address 7827. Got: 0xFF Expected: 0x3C
Verification error at address 7828. Got: 0xFF Expected: 0x0C
Verification error at address 7829. Got: 0xFF Expected: 0x94
Verification error at address 782A. Got: 0xFF Expected: 0x51
Verification error at address 782B. Got: 0xFF Expected: 0x3C
Verification error at address 782C. Got: 0xFF Expected: 0x0C
Verification error at address 782D. Got: 0xFF Expected: 0x94
Verification error at address 782E. Got: 0xFF Expected: 0x51
Verification error at address 782F. Got: 0xFF Expected: 0x3C
Verification error at address 7830. Got: 0xFF Expected: 0x0C
Verification error at address 7831. Got: 0xFF Expected: 0x94
Verification error at address 7832. Got: 0xFF Expected: 0x51
Verification error at address 7833. Got: 0xFF Expected: 0x3C
Verification error at address 7834. Got: 0xFF Expected: 0x0C
Verification error at address 7835. Got: 0xFF Expected: 0x94
Verification error at address 7836. Got: 0xFF Expected: 0x51
Verification error at address 7837. Got: 0xFF Expected: 0x3C
Verification error at address 7838. Got: 0xFF Expected: 0x0C
Verification error at address 7839. Got: 0xFF Expected: 0x94
Verification error at address 783A. Got: 0xFF Expected: 0x51
Verification error at address 783B. Got: 0xFF Expected: 0x3C
Verification error at address 783C. Got: 0xFF Expected: 0x0C
Verification error at address 783D. Got: 0xFF Expected: 0x94
Verification error at address 783E. Got: 0xFF Expected: 0x51
Verification error at address 783F. Got: 0xFF Expected: 0x3C
Verification error at address 7840. Got: 0xFF Expected: 0x0C
Verification error at address 7841. Got: 0xFF Expected: 0x94
Verification error at address 7842. Got: 0xFF Expected: 0x51
Verification error at address 7843. Got: 0xFF Expected: 0x3C
Verification error at address 7844. Got: 0xFF Expected: 0x0C
Verification error at address 7845. Got: 0xFF Expected: 0x94
Verification error at address 7846. Got: 0xFF Expected: 0x51
Verification error at address 7847. Got: 0xFF Expected: 0x3C
Verification error at address 7848. Got: 0xFF Expected: 0x0C
Verification error at address 7849. Got: 0xFF Expected: 0x94
Verification error at address 784A. Got: 0xFF Expected: 0x51
Verification error at address 784B. Got: 0xFF Expected: 0x3C
Verification error at address 784C. Got: 0xFF Expected: 0x0C
Verification error at address 784D. Got: 0xFF Expected: 0x94
Verification error at address 784E. Got: 0xFF Expected: 0x51
Verification error at address 784F. Got: 0xFF Expected: 0x3C
Verification error at address 7850. Got: 0xFF Expected: 0x0C
Verification error at address 7851. Got: 0xFF Expected: 0x94
Verification error at address 7852. Got: 0xFF Expected: 0x51
Verification error at address 7853. Got: 0xFF Expected: 0x3C
Verification error at address 7854. Got: 0xFF Expected: 0x0C
Verification error at address 7855. Got: 0xFF Expected: 0x94
Verification error at address 7856. Got: 0xFF Expected: 0x51
Verification error at address 7857. Got: 0xFF Expected: 0x3C
Verification error at address 7858. Got: 0xFF Expected: 0x0C
Verification error at address 7859. Got: 0xFF Expected: 0x94
Verification error at address 785A. Got: 0xFF Expected: 0x51
Verification error at address 785B. Got: 0xFF Expected: 0x3C
Verification error at address 785C. Got: 0xFF Expected: 0x0C
Verification error at address 785D. Got: 0xFF Expected: 0x94
Verification error at address 785E. Got: 0xFF Expected: 0x51
Verification error at address 785F. Got: 0xFF Expected: 0x3C
Verification error at address 7860. Got: 0xFF Expected: 0x0C
Verification error at address 7861. Got: 0xFF Expected: 0x94
Verification error at address 7862. Got: 0xFF Expected: 0x51
Verification error at address 7863. Got: 0xFF Expected: 0x3C
Verification error at address 7864. Got: 0xFF Expected: 0x0C
1889 verification error(s).
First 100 shown.
Programming mode off.
'''

Optiboot

I converted the optiboot bootloader optiboot_atmega328_pro_8MHz with convertHexToByteArray.py, replaced the file bootloader_lilypad328.h in Atmega_Board_Programmer with it and adjusted the start address in Atmega_Board_programmer on line 418 to 0x7e00.
Burning and verifying works afterwards but I am not able to upload a sketch to it using the 8Mhz breadboard board in the Arduino IDE. The LED on output 13 flashes three times quickly.
Any hints are appreciated.

is:issue is:open Modifying original sketch

Would it be OK to change this section after modifying original sketch and adding some additional functionality in order to avoid possible wiring confusion because of slightly different board before publishing my modifications?

So, in this section, from this:

/*
For more details, photos, wiring, instructions, see:
http://www.gammon.com.au/forum/?id=11638
...
Copyright 2012 Nick Gammon.
*/

To:

// Original Author: Nick Gammon
// Modified by ...
/*
For original project idea, details, photos, wiring, instructions, see:
http://www.gammon.com.au/forum/?id=11638
Copyright 2012 Nick Gammon.
...
*/

set bootloader every time

Hi,
I install the bootloader on my Nega using Duemilanove, but when i upload some sketch to Mega cant send another one. Need to install bootloader every time..

thanks

Verification error at address 7861. Got: 0x30 Expected: 0x94

Hi to all, and thank you for this fantastic library!
First of all, I want say that with the "official guide" Arduino To Breadobard on the official site of Arduino every time I get the error "Yikes! Invalide signature".

With Gammon detector, I can read that I have a ATMEGA328P on breadboard, programmed with a bootloader that use the ext crystal.

I have only 2 22pf capacitator, so I did use it for the two pins current (decoupling capacitator) and I set the crystal from Pin 9.

With this configuration, as I did say, I can read and get info from the ATMEGA on breadboard (from my Arduno UNO R3 and IDE 1.6.13, last one).

But, If I load the sketches for the programmer and in serial I select Lily (to use the 8MhZ) I get 1092 errors.

Errors are:

[...] Committing page starting at 0x7F80 Written. Verifying ... Verification error at address 7800. Got: 0x00 Expected: 0x0C Verification error at address 7801. Got: 0x00 Expected: 0x94 Verification error at address 7802. Got: 0x01 Expected: 0x34 Verification error at address 7803. Got: 0x01 Expected: 0x3C Verification error at address 7804. Got: 0x02 Expected: 0x0C Verification error at address 7805. Got: 0x02 Expected: 0x94 Verification error at address 7806. Got: 0x03 Expected: 0x51

And so on.

Ok, I know that I need to buy some other capacitators and try with a real crystal (I think), but why I get that error? Another info, my breadboard get power from a USB Samsung charger (so 5 volts are not get from the UNO, to don't strees it).

Thank you

Arduino board programmer does not see Arduino Mega 2560 R2 and R3

The sketch and cable ( as shown here: http://www.gammon.com.au/forum/?id=11635 ) work perfectly with all other arduinos (duemilanove,UNO R3 and BBB) I have tried, but it does not react to my Mega 2560 R2 and R3 boards.

I am concerned about the Mega R2 as it does not communicate at all with the IDE (the main reason I found your page in the first place), but the Mega R3 is in perfect order and yet behaves exactly the same way - it just displays the two top lines:

Atmega chip programmer.
Written by Nick Gammon.

Any suggestions for this odd behavior? I am using Arduino 1.0 and tested both in XP and Windows 7 with same results.

Different (high fuse) boot start address

Good day,
I try your Atmega_Board_Detector on ATmega328p, but program show me different (high fuse) boot start address compared to http://www.engbedded.com/fusecalc/
Maybe dumb question, can you explain how you recalculate in program bootloader size and startup address? Thank you in advance.

I found the answer:
Example
32 kB memory - 1 kB bootloader = 31 * 1024 = 0x7C00 (31744)
32 kB memory - 2 kB bootloader = 30 * 1024 = 0x7800 (30720)

word -> byte
0x3F00 -> 0x7E00 (512 byte bootloader)
0x3E00 -> 0x7C00 (1024 byte bootloader)
0x3C00 -> 0x7800 (2048 byte bootloader)
0x3800 -> 0x7000 (4096 byte bootloader)

There are two bytes per word, so multiply the word addresses by 2 to get the byte address.

Atmega_Hex_Uploader_Fixed_Filename error codes

Hi

I build a Atmega_Hex_Uploader_Fixed_Filename board.
Just to let you know if SD card board is not present (or not recognized), error led flashes 5 times, so you should update error code description to:

Red x 5 = Cannot read chip signature (Sg) OR SD card reader not present

Regards

Atmega8 support

Hi, I am trying to use ATMEGA_HEX_UPLOADER_FIXED_FILENAME with Atmega8 (with no crystal, Internal clock of 8MHz). I tried to modify your code, but all failed. Is it possible that you can share the code for the ATMEGA8 (with internal oscillator, 8MHz)? I am using the LED's and switch as discussed on your blog.

Thank you.

Support to change onboard LED pin function

I have a custom MEGA2560-based board that uses D10 instead of D13 for an onboard status LED.

I understand that the optiboot bootloader code flashed D13:
-at Arduino boot time (the LED blinks a few times)
-when uploading a sketch to Arduino

Please allow the user to change the pin associated with the functionality of the LED, preferably in the
file ATmega_Board_Programmer.ino. I do not feel experienced enough to re-compile the bootloader on my own!

P.S. your code is awesome, what a life saver for custom projects - especially on MEGA2560!

error while compling

dear nickgammon
thanks for that great job and for sharing it
i have this error while compling
Using library SdFat in folder: C:\Users\miro\Documents\Arduino\libraries\SdFat (legacy)
exit status 1
'class SdFile' has no member named 'getFilename'

any ideas

Compilation error

Hello guys,
I tried to compil the atmega_board_detector with a 1.6.5 arduino IDE. I have the following errors and I don't understand...
Thanks for your help!

Atmega_Board_Detector\md5.c.o: In function md5_starts': C:\Users\pvack\Documents\Arduino\libraries\Atmega_Board_Detector/md5.c:40: multiple definition ofmd5_starts'
md5.c.o:C:\Users\pvack\AppData\Local\Temp\build5762215785007529461.tmp/md5.c:40: first defined here
Atmega_Board_Detector\md5.c.o: In function md5_starts': C:\Users\pvack\Documents\Arduino\libraries\Atmega_Board_Detector/md5.c:40: multiple definition ofmd5_process'
md5.c.o:C:\Users\pvack\AppData\Local\Temp\build5762215785007529461.tmp/md5.c:40: first defined here
Atmega_Board_Detector\md5.c.o: In function md5_starts': C:\Users\pvack\Documents\Arduino\libraries\Atmega_Board_Detector/md5.c:40: multiple definition ofmd5_update'
md5.c.o:C:\Users\pvack\AppData\Local\Temp\build5762215785007529461.tmp/md5.c:40: first defined here
Atmega_Board_Detector\md5.c.o: In function md5_starts': C:\Users\pvack\Documents\Arduino\libraries\Atmega_Board_Detector/md5.c:40: multiple definition ofmd5_finish'
md5.c.o:C:\Users\pvack\AppData\Local\Temp\build5762215785007529461.tmp/md5.c:40: first defined here
collect2.exe: error: ld returned 1 exit status
Erreur lors de la compilation.

Use bootloader

Hi! Sorry I'm really n00b in this topics so I would like to ask how I use the bootlader for a Lilypad USB? I mean where I run the code or how I use the code? Thanks so much for all help that you could bring me.

HEX uploader, on CrossRoads programmer: verification error when programming Mega2560 with bootloader

This is a continuation of Arduino forum PMs, so i will summarize.
I create the HEX file, with the bootloader, using the Arduino IDE. (Menu: Sketch -> Export compiled binary), which creates two HEX files (one with, one without the bootloader).
I then load the HEX with the bootloader onto the SD card, and rename to the correct naming convention (like: CODE01.HEX).
Upon programming, the HEX is written, but it fails to verify, with code "bd" on the LED display, and also flashes 8 red. the bootloader seems to work, as it can be USB programmed afterward, it just fails verification.
By contrast, if i follow the same procedure for the HEX file without the bootloader, it passes verification, and as expected, it no longer is programmable via USB.

In PM you mentioned the order of the sketch and bootloader in the HEX file. when i examined the HEX files directly, the bootloader is added after the sketch.
I haven't done the chip detector sketch, but i tried the Blink example as an indicator. pin 13 did not blink with either the HEX with or without the bootloader. though the same sketch programmed via USB worked fine. I will see if i can do the chip detector either tomorrow, or this weekend.
very odd results with the testing i have done so far.

Board Detector: Add Attiny Bootloader Signatures

Hello, @nickgammon . Firstly, thank you for your tools provided here. I've used the Atmega_Board_Detector and Atmega_Self_Read_Signature several times in order to get insights into what bootloaders my Arduinos are running.

As an addition to the existing library of bootloader hashes included in the board detector, it would be great if Attiny bootloaders were included, particularly the versions of micronucleus (used in Digispark and Digispark Pro), the Adafruit Trinket bootloader, and the Arduino Gemma bootloader.

(I've done some brief research on this, and it looks like there isn't going to be a definitive answer on how to do this, because there is no specialized "bootloader space" on these devices. Even so, a heuristic would be nice... in the case of Attiny85, potentially hash the memory from 0x1C00 to 0x1FFF and use that as the signature basis? Reading the reset vector might help in determining the bootloader size, but I don't know how to even do that.)

Board programmer Upload 16u2 DFU (+ USBSerial) doesnt work properly

Hi,
I modified the Atmega_Board_Programmer.ino to add a custom 16u2 Bootloader. Thats working fine.
Now i want to switch back to the official 16u2 DFU. There are two options I tried and both arent working:

  1. Uploading the combined hex file from address 0x0000 to 0x4000. The DFU once was present (it changed somehow) but never loaded the USB-Serial. But with manual FLIP sketch execution i could run the sketch. Now (after some attempts) the DFU isnt loading at all, only the sketch.

  2. Uplading the official atmel DFU for the at90usb162 (had no 16u2 version handy, should be the same). You can use the DFU, program but after a replug the DFU always loads.

it is NOT a fuse problem. I used the correct fuses from the Arduino Documentation and i also tried with my 16u2 as ISP (see https://github.com/NicoHood/Hoodloader#16u2-as-isp-usage ) and with this one the DFU is working as intended.

You can get the source here: (tell me if the license thing is okay too)
https://github.com/NicoHood/HoodLoader2/tree/master/tools/Atmega_Board_Programmer

Bootloader versions

Dear nickgammon,
Many thinks for creating these sketches, they helped me much.
I'm wondering where I can see the versions of the bootloaders used. Could you please add them if they are not mentioned somewhere? I think perfect would be to mention them in the corresponding header files like bootloader_atmega328.h.

A quick helpful update

I just noticed on your forum post: http://gammon.com.au/forum/?id=11638

Producing a .hex file

Well, now in the Arduino IDE you can

Sketch - Export Compiled Binary

Which puts the hex file right into your project directory.
Works with 1.8.5, I don't know what version it was implemented.

Add 16u2 Mega Firmware

The user should be able to select the 16u2 Firmware with another #define to also upload the 16u2 Mega firmware.

Atmega Board Programmer for teensy 2.0

Hi

Im trying to get your programmer to work on my teensy 2.0.
Im able to build it and upload it to my Teensy but after that its not going so well.
The teensy is not showing up as a serial device so i am unable to enter serial monitor to start burning bootloaders.

Can you point me in the right direction to be able to use my teensy with your program?

make unique ID with chip specification

hi @nickgammon , I have plan to protect my sketch by similar unique MAC address, so in setup function check whether sketch's license match the chip ID or not and if ok goto loop function
storing the address in EEPROM is not good idea because every body can extract hex code of both flash and EEPROM and use it in other hardware , I really appreciated if you could help me
BR

Could you please add 1284P support?

Nick,

Thanks for your continued support on this great project! I've added my own 1284P support to your code. Since you already added 1284P support to the fixed file uploader, could you add to this code too?

There are two variants:
Standard (manicbug's mighty), and bobuino (CrossRoad's board). I am using pin defs from bobuino since it makes closer mapping to the UNO convention:

// for fast port access

if defined (AVR_ATmega2560)

// Atmega2560
#define BB_MISO_PORT PINH
#define BB_MOSI_PORT PORTH
#define BB_SCK_PORT PORTG
const byte BB_SCK_BIT = 5;
const byte BB_MISO_BIT = 3;
const byte BB_MOSI_BIT = 4;

elif defined (AVR_ATmega1284P)

// Atmega1284P
#define BB_MISO_PORT PINB
#define BB_MOSI_PORT PORTB
#define BB_SCK_PORT PORTB
const byte BB_SCK_BIT = 0;
const byte BB_MISO_BIT = 2;
const byte BB_MOSI_BIT = 3;

else

// Atmega328
#define BB_MISO_PORT PIND
#define BB_MOSI_PORT PORTD
#define BB_SCK_PORT PORTD
const byte BB_SCK_BIT = 3;
const byte BB_MISO_BIT = 6;
const byte BB_MOSI_BIT = 7;

endif

I'm not sure how to tell different variants at compile time such as bobuino or standard. Having that in the code would be even better!

ATmega328PB not programming

I am attempting to burn a bootloader on a ATmega328PB. I see version 1.38 added support for this chip. When connecting a brand new chip to a master arduino with Atmega_Board_Programmer.ino, it detects the chip, and prompts me to start programming the board. It gets to the "Divide clock by 8" prompt and changes a fuse. After this, the program can no longer find the board. It just says "Attempting to enter ICSP programming mode..." indefinitely.

Download

Hi,

I just replaced my arduino atmega16U2 and I need to reprogram it with bootloader then the firmware. I found interesting information here but how can I download the Atmega_Board_Programmer folder?

Can someone help, and then I need to place in my software I believe but where. A lot of esential basic information is missing.

thanks, Octavian

Supporting atmega256rfr2 / Pinoccio Scout

I've been working on an official update for the bootloader for the Pinoccio Scout board. Previously, we've distributed a custom sketch based on your code for updating. Now, I'm wondering if you would be willing to have direct support for the rfr2 / Pinoccio Scout in your Atmega_Board_Programmer sketch (possibly disabled by default).

If the answer is yes, I'll submit a PR with the relevant code, and supply a bit of documentation and pictures to include here (assuming that's still the most recent documentation location): http://www.gammon.com.au/forum/?id=11635

Bootloader programmer fails to enter programming mode

Below shows what is displayed on serial monitor. What is the possible cause? My 'programming' board is Arduino UNO and my 'target' board is Arduino Pro Mini 5V. I connected using manual programming cable. i successfully upload the sketch, so I doubt its the connection problem.

Atmega chip programmer.
Written by Nick Gammon.
Version 1.37
Compiled on Oct 27 2017 at 17:06:38 with Arduino IDE 10803.
Attempting to enter ICSP programming mode ......................................................
Failed to enter programming mode. Double-check wiring!
Type 'C' when ready to continue with another chip ...

EDIT.1: I resolder connection pin on Pro Mini and performed continuity test of wire connections. Connection is good.

EDIT.2: My Arduino IDE setting are:
Board: Arduino/Genuino UNO
Programmer: Arduino as ISP

Below is compilation and upload verbose output

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\user\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\user\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\user\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10803 -build-path C:\Users\user\AppData\Local\Temp\arduino_build_928836 -warnings=none -build-cache C:\Users\user\AppData\Local\Temp\arduino_cache_739103 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\user\Downloads\arduino_sketches-master\Atmega_Board_Programmer\Atmega_Board_Programmer.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\user\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\user\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\user\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10803 -build-path C:\Users\user\AppData\Local\Temp\arduino_build_928836 -warnings=none -build-cache C:\Users\user\AppData\Local\Temp\arduino_cache_739103 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\user\Downloads\arduino_sketches-master\Atmega_Board_Programmer\Atmega_Board_Programmer.ino
Using board 'uno' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Detecting libraries used...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\user\AppData\Local\Temp\arduino_build_928836\sketch\Atmega_Board_Programmer.ino.cpp" -o "nul"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "C:\Users\user\AppData\Local\Temp\arduino_build_928836\sketch\Atmega_Board_Programmer.ino.cpp" -o "nul"
Using cached library dependencies for file: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src\SPI.cpp
Generating function prototypes...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "C:\Users\user\AppData\Local\Temp\arduino_build_928836\sketch\Atmega_Board_Programmer.ino.cpp" -o "C:\Users\user\AppData\Local\Temp\arduino_build_928836\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\user\AppData\Local\Temp\arduino_build_928836\preproc\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "C:\Users\user\AppData\Local\Temp\arduino_build_928836\sketch\Atmega_Board_Programmer.ino.cpp" -o "C:\Users\user\AppData\Local\Temp\arduino_build_928836\sketch\Atmega_Board_Programmer.ino.cpp.o"
Compiling libraries...
Compiling library "SPI"
Using previously compiled file: C:\Users\user\AppData\Local\Temp\arduino_build_928836\libraries\SPI\SPI.cpp.o
Compiling core...
Using precompiled core
Linking everything together...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p  -o "C:\Users\user\AppData\Local\Temp\arduino_build_928836/Atmega_Board_Programmer.ino.elf" "C:\Users\user\AppData\Local\Temp\arduino_build_928836\sketch\Atmega_Board_Programmer.ino.cpp.o" "C:\Users\user\AppData\Local\Temp\arduino_build_928836\libraries\SPI\SPI.cpp.o" "C:\Users\user\AppData\Local\Temp\arduino_build_928836/..\arduino_cache_739103\core\core_arduino_avr_uno_0c812875ac70eb4a9b385d8fb077f54c.a" "-LC:\Users\user\AppData\Local\Temp\arduino_build_928836" -lm
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0  "C:\Users\user\AppData\Local\Temp\arduino_build_928836/Atmega_Board_Programmer.ino.elf" "C:\Users\user\AppData\Local\Temp\arduino_build_928836/Atmega_Board_Programmer.ino.eep"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-objcopy" -O ihex -R .eeprom  "C:\Users\user\AppData\Local\Temp\arduino_build_928836/Atmega_Board_Programmer.ino.elf" "C:\Users\user\AppData\Local\Temp\arduino_build_928836/Atmega_Board_Programmer.ino.hex"
Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI 
Sketch uses 27184 bytes (84%) of program storage space. Maximum is 32256 bytes.
Global variables use 243 bytes (11%) of dynamic memory, leaving 1805 bytes for local variables. Maximum is 2048 bytes.
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM5 -b115200 -D -Uflash:w:C:\Users\user\AppData\Local\Temp\arduino_build_928836/Atmega_Board_Programmer.ino.hex:i 

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

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

         Using Port                    : COM5
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
         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 : Arduino
         Description     : Arduino
         Hardware Version: 3
         Firmware Version: 4.4
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "C:\Users\user\AppData\Local\Temp\arduino_build_928836/Atmega_Board_Programmer.ino.hex"
avrdude: writing flash (27184 bytes):

Writing | ################################################## | 100% 4.24s

avrdude: 27184 bytes of flash written
avrdude: verifying flash memory against C:\Users\user\AppData\Local\Temp\arduino_build_928836/Atmega_Board_Programmer.ino.hex:
avrdude: load data flash data from input file C:\Users\user\AppData\Local\Temp\arduino_build_928836/Atmega_Board_Programmer.ino.hex:
avrdude: input file C:\Users\user\AppData\Local\Temp\arduino_build_928836/Atmega_Board_Programmer.ino.hex contains 27184 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 3.24s

avrdude: verifying ...
avrdude: 27184 bytes of flash verified

avrdude done.  Thank you.

Bootloader programmer fails to enter programming mode with second chip.

The bootloader programmer is working great for the first chip, but with the second one it fails to enter programming mode until I restart the programmer. Any suggestions for this? Thanks! The second chip is identical to the first. Note: If instead of a second chip I bootload the first chip again after a successful attempt, it works fine.

Attempting to enter programming mode ...
Entered programming mode OK.
Signature = 0x1E 0x95 0x0F
Processor = ATmega328P
Flash memory size = 32768 bytes.
LFuse = 0x62
HFuse = 0xD9
EFuse = 0xFF
Lock byte = 0xFF
Clock calibration = 0x8E
Type 'L' to use Lilypad (8 MHz) loader, or 'U' for Uno (16 MHz) loader ...
Using Uno Optiboot 16 MHz loader.
Bootloader address = 0x7E00
Bootloader length = 512 bytes.
Type 'Q' to quit, 'V' to verify, or 'G' to program the chip with the bootloader ...
Clearing 'Divide clock by 8' fuse bit.
Fixing low fuse setting ...
Attempting to enter programming mode ...
Entered programming mode OK.
Erasing chip ...
Writing bootloader ...
Committing page starting at 0x7E00
Committing page starting at 0x7E80
Committing page starting at 0x7F00
Committing page starting at 0x7F80
Written.
Verifying ...
No errors found.
Writing fuses ...
LFuse = 0xFF
HFuse = 0xDE
EFuse = 0xFE
Lock byte = 0xEF
Clock calibration = 0x8E
Done.
Programming mode off.
Type 'C' when ready to continue with another chip ...
Attempting to enter programming mode ...
((sticks here and never enters programming mode))

Atmega_Hex_Uploader_Fixed_Filename and serial baud

Hi

I'm using arduino to program a standalone 328p running on internal clock @ 8Mhz. I uploaded a sketch that prints "hello world" to serial UART @ 57600 baud. My terminal program shows it correctly.
I builted a Atmega_Hex_Uploader_Fixed_Filename board and uploaded the same sketch to the standalone board, but now my serial terminal shows garbish. After some trials, i had to low baud rate on the terminal program to 28800 (half of 57600) to see the correct chars.

So, it seems that your Atmega_Hex_Uploader_Fixed_Filename code slows down sketch.
Any idea why?

Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3 question

Hi,

I have more of questions than an issues, if you don't mind. I noticed in the Atmega_Board_Programmer file bootloader_atmega16u2.h that the hex code which has been put in the array may have come from the file Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex and there is a comment saying Loader start: 3000, length: 4096. So I suppose just the DFU bootloader extracted from Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex to form the bootloader_atmega16u2.h file, and the USB-serial program was skipped over when the .h file was created, is that correct?

I am wondering if there is potential for including the whole Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex in the .h file so when programming the DFU bootloader the USB-serial program can also be included. It seems that would be harmless since the chip is getting erased anyway, and it could be useful because it would give a one-step "factory reset" of the UNO.

I understand there is a memory gap between the USB-serial program and the bootloader which would make a combined image a big hog of the programmer's flash unless there was some sort of gap-filler or compression logic in the programmer.

Thanks,
David

Arduino Micro is detected as Leonardo - and flashes outdated firmware as well

When programming the Arduino Micro, the only option is to use the Leonardo firmware which isn't quite the same - I'd expect to flash Micro-prod-firmware-2012-12-10.hex, which appears to be what my board came with (which was detected only as "unknown MD5 sum"). Reflashing the Micro using Arduino ISP with the firmware from the IDE restored the original bootloader successfully.

Note that the Leonardo firmware included is "Leonardo-prod-firmware-2012-04-26.hex" while the current version shipping with the IDE is Leonardo-prod-firmware-2012-12-10.

(My baseline is the bootloaders included with the Arduino 1.6.4 IDE.)

ATmega328PB bootloader

Would there be any chance of updating these bootloaders to support the new ATmega328PB microcontrollers?

problem compiling Atmega_Hex_Uploader

Hi,
I am using IDE 1.6.5 and I cannot compile Atmega_Hex_Uploader
it complains about unable to find SPI.h
I have managed to use your other apps and have also managed to load a 'boot loader' onto a chip.
I have tried reinstalling the ide, but with no luck.
I have also written a dummy sketch using the afending library and that seems to compile fine.
Please help.

KND RGS

Mo.

Error Compiling

Hi Nick, I get this message whenever i try to compile the Board Detector sketch

Arduino: 1.6.1 (Mac OS X), Board: "Arduino Uno"

Using library SPI in folder: /Users/macuser/Desktop/Arduino1.6.1.app/Contents/Resources/Java/hardware/arduino/avr/libraries/SPI

/Users/macuser/Desktop/Arduino1.6.1.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10601 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Users/macuser/Desktop/Arduino1.6.1.app/Contents/Resources/Java/hardware/arduino/avr/cores/arduino -I/Users/macuser/Desktop/Arduino1.6.1.app/Contents/Resources/Java/hardware/arduino/avr/variants/standard -I/Users/macuser/Desktop/Arduino1.6.1.app/Contents/Resources/Java/hardware/arduino/avr/libraries/SPI /var/folders/8z/n_ywnmp90_z9xrs0sp3kxbcr0000gn/T/build1851827936627584348.tmp/Atmega_Board_Detector.cpp -o /var/folders/8z/n_ywnmp90_z9xrs0sp3kxbcr0000gn/T/build1851827936627584348.tmp/Atmega_Board_Detector.cpp.o
Atmega_Board_Detector.ino:53:19: fatal error: md5.h: No such file or directory
compilation terminated.
Error compiling.

Compiling Error

Atmega Board Detector on Arduino IDE 1.6.5 under Ubuntu 14.04 I get:

Arduino: 1.6.5 (Linux), Platine: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Verwende die Bibliothek SPI im Ordner: /home/jose/Jo/100_Prog/arduino-1.6.5/hardware/arduino/avr/libraries/SPI 
Verwende die Bibliothek Atmega_Board_Detector im Ordner: /home/jose/Jo/100_Prog/arduino-1.6.5/libraries/Atmega_Board_Detector (legacy)

/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-gcc -c -g -Os -Wall -Wextra -ffunction-sections -fdata-sections -MMD -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/arduino/avr/cores/arduino -I/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/arduino/avr/variants/mega -I/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/arduino/avr/libraries/SPI -I/home/jose/Jo/100_Prog/arduino-1.6.5/libraries/Atmega_Board_Detector /tmp/build7606571625362604800.tmp/md5.c -o /tmp/build7606571625362604800.tmp/md5.c.o 
/tmp/build7606571625362604800.tmp/md5.c: In function 'md5_update':
/tmp/build7606571625362604800.tmp/md5.c:190:9: warning: implicit declaration of function 'memcpy' [-Wimplicit-function-declaration]
         memcpy( (void *) (ctx->buffer + left),
         ^
/tmp/build7606571625362604800.tmp/md5.c:190:9: warning: incompatible implicit declaration of built-in function 'memcpy' [enabled by default]
/tmp/build7606571625362604800.tmp/md5.c:207:9: warning: incompatible implicit declaration of built-in function 'memcpy' [enabled by default]
         memcpy( (void *) (ctx->buffer + left),
         ^
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -Wextra -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/arduino/avr/cores/arduino -I/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/arduino/avr/variants/mega -I/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/arduino/avr/libraries/SPI -I/home/jose/Jo/100_Prog/arduino-1.6.5/libraries/Atmega_Board_Detector /tmp/build7606571625362604800.tmp/Atmega_Board_Detector.cpp -o /tmp/build7606571625362604800.tmp/Atmega_Board_Detector.cpp.o 
In file included from Atmega_Board_Detector.ino:91:0:
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
   };  // end of signatures
   ^
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
/tmp/build7606571625362604800.tmp/Signatures.h:113:3: warning: missing initializer for member 'signatureType::timedWrites' [-Wmissing-field-initializers]
Atmega_Board_Detector.ino: In function 'void readBootloader()':
Atmega_Board_Detector.ino:252:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Atmega_Board_Detector.ino:286:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
In file included from Atmega_Board_Detector.ino:92:0:
/tmp/build7606571625362604800.tmp/General_Stuff.h:37:72: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define NUMITEMS(arg) ((unsigned int) (sizeof (arg) / sizeof (arg [0])))
                                                                        ^
Atmega_Board_Detector.ino:295:25: note: in expansion of macro 'NUMITEMS'
Atmega_Board_Detector.ino: In function 'void readProgram()':
Atmega_Board_Detector.ino:323:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
In file included from Atmega_Board_Detector.ino:92:0:
Atmega_Board_Detector.ino: In function 'void getSignature()':
/tmp/build7606571625362604800.tmp/General_Stuff.h:37:72: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define NUMITEMS(arg) ((unsigned int) (sizeof (arg) / sizeof (arg [0])))
                                                                        ^
Atmega_Board_Detector.ino:353:23: note: in expansion of macro 'NUMITEMS'
Programming_Utils.ino: In function 'void showHex(byte, boolean, boolean)':
Programming_Utils.ino:66:38: warning: narrowing conversion of '((((int)(b >> 4)) & 255) | 48)' from 'int' to 'char' inside { } is ill-formed in C++11 [-Wnarrowing]
Programming_Utils.ino:66:56: warning: narrowing conversion of '((((int)b) & 15) | 48)' from 'int' to 'char' inside { } is ill-formed in C++11 [-Wnarrowing]
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/SPI/SPI.cpp.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/Atmega_Board_Detector/md5.c.o
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-gcc -c -g -x assembler-with-cpp -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/arduino/avr/cores/arduino -I/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/arduino/avr/variants/mega /home/jose/Jo/100_Prog/arduino-1.6.5/hardware/arduino/avr/cores/arduino/wiring_pulse.S -o /tmp/build7606571625362604800.tmp/wiring_pulse.S.o 
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/wiring_digital.c.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/wiring_shift.c.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/WInterrupts.c.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/wiring_pulse.c.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/wiring.c.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/wiring_analog.c.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/hooks.c.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/IPAddress.cpp.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/Print.cpp.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/USBCore.cpp.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/HardwareSerial3.cpp.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/CDC.cpp.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/new.cpp.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/abi.cpp.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/WString.cpp.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/Tone.cpp.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/HardwareSerial0.cpp.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/HardwareSerial.cpp.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/WMath.cpp.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/HardwareSerial1.cpp.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/Stream.cpp.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/HardwareSerial2.cpp.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/HID.cpp.o
Verwende die zuvor kompilierte Datei: /tmp/build7606571625362604800.tmp/main.cpp.o
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/wiring_pulse.S.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/wiring_digital.c.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/wiring_shift.c.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/WInterrupts.c.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/wiring_pulse.c.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/wiring.c.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/wiring_analog.c.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/hooks.c.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/IPAddress.cpp.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/Print.cpp.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/USBCore.cpp.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/HardwareSerial3.cpp.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/CDC.cpp.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/new.cpp.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/abi.cpp.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/WString.cpp.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/Tone.cpp.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/HardwareSerial0.cpp.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/HardwareSerial.cpp.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/WMath.cpp.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/HardwareSerial1.cpp.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/Stream.cpp.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/HardwareSerial2.cpp.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/HID.cpp.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-ar rcs /tmp/build7606571625362604800.tmp/core.a /tmp/build7606571625362604800.tmp/main.cpp.o 
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/avr-gcc -Wall -Wextra -Os -Wl,--gc-sections,--relax -mmcu=atmega2560 -o /tmp/build7606571625362604800.tmp/Atmega_Board_Detector.cpp.elf /tmp/build7606571625362604800.tmp/md5.c.o /tmp/build7606571625362604800.tmp/Atmega_Board_Detector.cpp.o /tmp/build7606571625362604800.tmp/SPI/SPI.cpp.o /tmp/build7606571625362604800.tmp/Atmega_Board_Detector/md5.c.o /tmp/build7606571625362604800.tmp/core.a -L/tmp/build7606571625362604800.tmp -lm 
/tmp/build7606571625362604800.tmp/Atmega_Board_Detector/md5.c.o: In function `md5_starts':
/home/jose/Jo/100_Prog/arduino-1.6.5/libraries/Atmega_Board_Detector/md5.c:40: multiple definition of `md5_starts'
/tmp/build7606571625362604800.tmp/md5.c.o:/tmp/build7606571625362604800.tmp/md5.c:40: first defined here
/home/jose/Jo/100_Prog/arduino-1.6.5/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/bin/ld: Disabling relaxation: it will not work with multiple definitions
/tmp/build7606571625362604800.tmp/Atmega_Board_Detector/md5.c.o: In function `md5_starts':
/home/jose/Jo/100_Prog/arduino-1.6.5/libraries/Atmega_Board_Detector/md5.c:40: multiple definition of `md5_process'
/tmp/build7606571625362604800.tmp/md5.c.o:/tmp/build7606571625362604800.tmp/md5.c:40: first defined here
/tmp/build7606571625362604800.tmp/Atmega_Board_Detector/md5.c.o: In function `md5_starts':
/home/jose/Jo/100_Prog/arduino-1.6.5/libraries/Atmega_Board_Detector/md5.c:40: multiple definition of `md5_update'
/tmp/build7606571625362604800.tmp/md5.c.o:/tmp/build7606571625362604800.tmp/md5.c:40: first defined here
/tmp/build7606571625362604800.tmp/Atmega_Board_Detector/md5.c.o: In function `md5_starts':
/home/jose/Jo/100_Prog/arduino-1.6.5/libraries/Atmega_Board_Detector/md5.c:40: multiple definition of `md5_finish'
/tmp/build7606571625362604800.tmp/md5.c.o:/tmp/build7606571625362604800.tmp/md5.c:40: first defined here
collect2: error: ld returned 1 exit status
Multiple libraries were found for "md5.h"
 Used: /home/jose/Jo/100_Prog/arduino-1.6.5/libraries/Atmega_Board_Detector
 Not used: /home/jose/Jo/100_Prog/arduino-1.6.5/libraries/Atmega_Self_Read_Signature
Fehler beim Kompilieren.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.