# Flashing to Arduino using external program

**URL:** <https://forum.arduino.cc/t/flashing-to-arduino-using-external-program/1024428>\
**Category:** General Guidance\
**Created:** [August 22, 2022, 5:05am UTC](https://forum.arduino.cc/t/flashing-to-arduino-using-external-program/1024428 "2022-08-22T05:05:46Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![notoriousblt](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/notoriousblt/32/616566_2.png) [@notoriousblt](https://forum.arduino.cc/u/notoriousblt)\
**Post date:** [August 22, 2022, 5:05am UTC](https://forum.arduino.cc/t/flashing-to-arduino-using-external-program/1024428/1 "2022-08-22T05:05:46Z")

</div>

Hey everyone,  
I am attempting to make my own GUI for some of my arduino projects. I was hoping to implement flashing of Bin or Hex files.

I have attempted a few python libraries but the ones I have found have compatibility issues with current versions of python. Unsure if I can get AVRdude to work with a python tool.

I also tried the ArduinoProgramUpload library in C# with no luck. DotNet code is outside of my experience but if there is a working library I’m willing to dive in.

If anyone has had luck with flashing from their own program any guidance would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![lastchancename](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/lastchancename/32/215426_2.png) [@lastchancename](https://forum.arduino.cc/u/lastchancename)\
**Post date:** [August 22, 2022, 5:31am UTC](https://forum.arduino.cc/t/flashing-to-arduino-using-external-program/1024428/2 "2022-08-22T05:31:17Z")

</div>

Use whatever. environment you like, invoke ABRDUDE with your preferred command line - and away you go.

If using one of the bootloaders, ensure you have wired RESET as needed.

If your using SPI, also need to consider RESET, but wired differently.

---

<div class="post-metadata">

**Author:** ![johnwasser](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johnwasser/32/214270_2.png) [@johnwasser](https://forum.arduino.cc/u/johnwasser)\
**Post date:** [August 22, 2022, 2:23pm UTC](https://forum.arduino.cc/t/flashing-to-arduino-using-external-program/1024428/3 "2022-08-22T14:23:22Z")

</div>

Did you want to upload through the serial bootloader, or through the ICSP header? Same protocol, different interface (UART vs SPI).

The Arduino UNO and Nano are flashed with the STK500 protocol. The MEGA uses the STK500V2 protocol.

---

<div class="post-metadata">

**Author:** ![notoriousblt](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/notoriousblt/32/616566_2.png) [@notoriousblt](https://forum.arduino.cc/u/notoriousblt)\
**Post date:** [August 22, 2022, 2:56pm UTC](https://forum.arduino.cc/t/flashing-to-arduino-using-external-program/1024428/4 "2022-08-22T14:56:52Z")

</div>

Ideally I would like to use serial as I already have my live graphing via Serial on USB.

---

<div class="post-metadata">

**Author:** ![notoriousblt](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/notoriousblt/32/616566_2.png) [@notoriousblt](https://forum.arduino.cc/u/notoriousblt)\
**Post date:** [August 22, 2022, 2:58pm UTC](https://forum.arduino.cc/t/flashing-to-arduino-using-external-program/1024428/5 "2022-08-22T14:58:59Z")

</div>

Do you mean a physical reset? Or a software reset? My apologies still learning the software process.

---

<div class="post-metadata">

**Author:** ![mrburnette](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/mrburnette/32/702556_2.png) [@mrburnette](https://forum.arduino.cc/u/mrburnette)\
**Post date:** [August 22, 2022, 3:20pm UTC](https://forum.arduino.cc/t/flashing-to-arduino-using-external-program/1024428/6 "2022-08-22T15:20:49Z")

</div>

> [@notoriousblt](#):
>
> I was hoping to implement flashing of Bin or Hex files.

Example is for eeprom, but any section of flash can be backuped or flashed from command line:

> Specifically for EEPROM:

`avrdude -c arduino -P com4 -p ATMEGA328P -b 19200 -U eeprom:r:%temp%\backup_eeprom.hex:i`

and

`avrdude -c arduino -P com4 -p ATMEGA328P -b 19200 -U eeprom:w:\Users\owner\AppData\Local\Temp\backup_eeprom.hex`

The first command uses ISP on com4 to create a backup file of the EEPROM contents.  
The second command uses ISP on com4 to write the file "backup\_eeprom" to the uC

Make changes in the script files to suit your environment.

Paths & enviro for Win 8.1

Added:  
[AVR Tutorial - AVRDUDE (ladyada.net)](https://www.ladyada.net/learn/avr/avrdude.html#:~:text=AVRDUDE%20option%201%20-p%20%3Cpartno%3E%3A%20This%20is%20just,talks%20to%20the%20chip.%20...%20More%20items...%20)

---

<div class="post-metadata">

**Author:** ![johnwasser](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johnwasser/32/214270_2.png) [@johnwasser](https://forum.arduino.cc/u/johnwasser)\
**Post date:** [August 22, 2022, 3:32pm UTC](https://forum.arduino.cc/t/flashing-to-arduino-using-external-program/1024428/7 "2022-08-22T15:32:03Z")

</div>

> [@mrburnette](#):
>
> Example is for eeprom, but any section of flash can be backuped or flashed from command line:

optiboot.c says:

```arduino
/* What you lose: */
/* Implements a skeleton STK500 protocol which is */
/* missing several features including EEPROM */
/* programming and non-page-aligned writes */

/* */
/* Optional defines: */
/* */
/ ********************************************************** /
/*   
/* SUPPORT_EEPROM: */
/* Support reading and writing from EEPROM. This is not */
/* used by Arduino, so off by default. */

```

---

<div class="post-metadata">

**Author:** ![mrburnette](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/mrburnette/32/702556_2.png) [@mrburnette](https://forum.arduino.cc/u/mrburnette)\
**Post date:** [August 22, 2022, 8:24pm UTC](https://forum.arduino.cc/t/flashing-to-arduino-using-external-program/1024428/8 "2022-08-22T20:24:51Z")

</div>

> [@johnwasser](#):
>
> optiboot.c says:

Back early last decade, I used a UNO with a ZIF shield and created a little ISP programmer for Atmeg386P-PU and Attiny85 DIPs. Bootloader at the time was Optiboot in an early stage:

```arduino
/* Copyright 2013-2015 by Bill Westfield. */
/* Copyright 2010 by Peter Knight.

```

Anyway, my personal stance on bootloaders are they are generally a Pain In The Chip ...  
I use ISP programmer:  
 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/8/d/c/8dcc96708edcb6bc8e10b12b1f40e4ac0b8a4877.jpeg)

The scripts documented at that time (Aug 2013) for Win 8.0/8.1 did work with confirmation that they also worked on Windows 7.

[Copy 'n Paste Arduino Firmware - Community / Exhibition / Gallery - Arduino Forum](https://forum.arduino.cc/t/copy-n-paste-arduino-firmware/178469)

Ray

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [February 18, 2023, 8:25pm UTC](https://forum.arduino.cc/t/flashing-to-arduino-using-external-program/1024428/9 "2023-02-18T20:25:14Z")

</div>

Closed on February 18, 2023, 8:25pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
